OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Language translation not funchtioning at viewarticle.php

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

Language translation not funchtioning at viewarticle.php

Postby obi1 » Wed Jul 07, 2004 1:52 am

When an alternative language is choosen at viewarticle.php, the system is redirected back to viewissue.php.

What can I do to correct this?
obi1
 

Postby kevin » Wed Jul 07, 2004 2:17 am

You can try changing PHP_SELF to REQUEST_URI in include/header.php and admin/include/header.php

Code: Select all
echo " &nbsp; <select name=\"locale\" onchange=\"location.href='$_SERVER[REQUEST_URI]" . (strstr($_SERVER[REQUEST_URI], "?") === false ? "?" : "&") . "locale='+this.options[this.selectedIndex].value\"><option value=\"\">" . _tr('LANGUAGE') . ":</option>";
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

Re:Language translation not funchtioning at viewarticle.php

Postby obi1 » Wed Jul 07, 2004 6:11 am

That is great. It works.
Thank you very much.
obi1
 

Postby Lars » Tue Jul 13, 2004 4:02 am

kevin wrote:You can try changing PHP_SELF to REQUEST_URI in include/header.php and admin/include/header.php

Code: Select all
echo " &nbsp; <select name=\"locale\" onchange=\"location.href='$_SERVER[REQUEST_URI]" . (strstr($_SERVER[REQUEST_URI], "?") === false ? "?" : "&") . "locale='+this.options[this.selectedIndex].value\"><option value=\"\">" . _tr('LANGUAGE') . ":</option>";


The "select" as it is now is good for sites with more that two languages. I do not want the select because our site has only two languages (English and Swedish). How can I change the "select" so that when one click on the Swedish, only clickable bar for English will appear and when I click on English, the Swedish will only appear.

Regards
Lars
Lars
 

Postby kevin » Tue Jul 13, 2004 11:49 pm

The code for displaying the language select menu is in include/header.php and admin/include/header.php if you wish to change it.
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

Postby Lars » Wed Jul 14, 2004 6:02 am

kevin wrote:The code for displaying the language select menu is in include/header.php and admin/include/header.php if you wish to change it.


Can I get help from you? I am not a php guru. I have just started learning php.

Thanks in advance.

Lars
Lars
 

Postby kevin » Sat Jul 17, 2004 11:38 am

You could try something like this:
Code: Select all
Index: include/header.php
===================================================================
RCS file: /cvs/ojs/include/header.php,v
retrieving revision 1.172
diff -u -r1.172 header.php
--- include/header.php  8 Jul 2004 02:52:50 -0000       1.172
+++ include/header.php  17 Jul 2004 18:38:09 -0000
@@ -174,13 +174,11 @@
                        ?><a href="<?php echo $v ?>" class="headermenu"><?php echo $k ?></a><?php
                }
 
-               if(!empty($otherLocales)) {
-                       // Show other available locales
-                       echo " &nbsp; <select name=\"locale\" onchange=\"location.href='$_SERVER[REQUEST_URI]" . (strstr($_SERVER[REQUEST_URI], "?") === false ? "?" : "&") . "locale='+this.options[this.selectedIndex].value\"><option value=\"\">" . _tr('LANGUAGE') . ":</option>";
-                       foreach($otherLocales as $locale) {
-                               echo "<option value=\"$locale\"" . ($locale == $journalLocale ? " selected=\"selected\"" : "") . ">" . (isset($locale_names[$locale]) ? $locale_names[$locale] : $locale) . "</option>";
-                       }
-                       echo "</select>";
+               $localeUrl = $_SERVER[REQUEST_URI] . (strstr($_SERVER[REQUEST_URI], "?") === false ? "?" : "&") . "locale=";
+               if ($journalLocale == 'en') {
+                       echo " <a href=\"{$localeUrl}pt\">$locale_names[pt]</a>";
+               } else {
+                       echo " <a href=\"{$localeUrl}en\">$locale_names[en]</a>";
                }
                ?>
        </td>
kevin
 
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

Postby Lars » Tue Jul 20, 2004 1:49 am

Thank You, Lars
Lars
 


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: Bing [Bot] and 2 guests