OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Translation implementation

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.

Translation implementation

Postby ramon » Wed Oct 15, 2003 6:43 am

As John and we, the implementers of IBICT, discussed, here´s our thought on implementing the translation of the OJS system.

All that is needed is to translate the documents into a separate language folder (ie: en, sp (for spanish), pt, fr, etc). We did this before installing the system.

Then, we changed the following in the system:

in the file include/locale.inc.php

##

function availableLocales() {
global $fullpath;
$locale_names = array("en" => "English", "pt" => "Português",
"sp" => "Español",
"fr" => "Français");

##

If the array is not changed, the system gets the folder name and outputs it in the list.
Now, we just need to zip the whole system back again... (We are finishing the admin.inc file.. it´s very long and we are busy with many other things too.... Also, the translation is not as easy and simple as it seems, for we had to rewrite some things to fit our public and image.)

I hope this is helpful to all those translating...
Please tell us if this works for you too!
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Translation Implementation II

Postby ramon » Fri Oct 17, 2003 1:03 pm

Dear OJSers,

While continuing our translation of the admin.inc we came across an issue that is important to discuss...

The standard e-mails, customized online expect certain "variables" in their text:
    [Name of Author]
    [Name of Editor]
    [Name of Copyeditor]
    [Password of Reviewer]
    [One Week Later]


and many others;

However, as we translated the admin.inc file, we translated the reference to those also, not knowing exactly where they would go, since the translation of the emails was made by other people involved in the project. This caused some havoc while people were testing the system, because it wasn´t clear, in the admin.inc were those variables would be used, and if they are used somewhere else...
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Further ideas about translation

Postby Guest » Fri Nov 28, 2003 10:56 am

FROM....

Ramón Martins S. da Fonseca
Desenvolvimento Web
IBICT
Instituto Brasileiro de Informação em Ciência e Tecnologia
+55 61 217 6443 / 6347
.....................................

Here are some of the problems we´ve encountered:

1 - Changes made to code:
- in some files, there is a php code to remove unnecessary HTML tags, to
print the value exactly as in the language files. There will be a problem
with systems with Latin languages.

2 - Javascript erro located at:
login.php, notification.php

3 - Javascript error messages are dificult to maintain, for there is no
mention in the language files where the variables will be used. If HTML is
used in the language files, then these error messages as well as the email
text will not show correctly.

4 - Javascript for form validation is very simple, but it´s not modular and
cannot be used with other forms. There are a few examples, especially using
CSS that may create a more modular and independent script.

5 - to change the list of languages it is necessary to change the array in
the include/locale.inc.php
function availableLocales() {
global $fullpath;
$locale_names = array("en" => "English", "pt" =>"Português");
We suggest creating an external file that creates a more visual structure
like:
$locale_names["en"] => "English";
$locale_names["pt"] => "Português";

etc, and include it in the locale.inc.php, which will make it easier for
non-programmers to update the list, when other languages come.


30/10/03
admin/include/suppupload.php
Changes in the code to print dynamic titles in the page
line 186
<?php if (isset($supid)) {
echo "Edit a Supplementary File";
//echo _tr('EDIT_SUPPLEMENTARY_FILE_UPLOAD');
(this variable is never shown, apparently...)
} else {
// echo "Upload a Supplementary File";
echo _tr('SUPPLEMENTARY_FILE_UPLOAD');
}
?>

Fix in code line 286
<span class="instructions">English=en; French=fr; Spanish=es (<a
href="http://www.loc.gov/standards/iso639-2/langcodes.html"
target="_blank"><?php
//echo _tr('SUPPLEMENTARY_FILE_UPLOAD')
//fixing variable name
echo _tr('ADDITIONAL_CODES');
?>
</a>).</span>


31/10/03
To add your languge, if it´s not already in the list below, copy the
structure, using the abbreviation for the key and the language as the value.
Use HTML code to use special caracters (ex.:ç = &ccedil;).
OBS Important: For this to work, it is imperative that the folder for your
language (ex.:locale/en), be created inside the locale/ folder, with the
translated files. The name of the folder is the key value.
*/

$locale_names["en"] = "English";
$locale_names["pt"] = "Portugu&ecirc;s";
$locale_names["fr"] = "Fran&ccedil;ais";
$locale_names["es"] = "Espa&ntilde;ol";

05/11/03
Solving email problems we had:
- We found that in locale/pt/admin.inc.php (or locale/en/admin.inc.php)there
are variables that cannot be translated (generally everything that´s inside
square brackets, as is instructed in the file itself...). However, only
after translating the document is that we realize the problem...

Solving comment problems
- In the comments.php form there is no way to bring the dynamic values of
the people who make the comment (ex. editor, author, reviewer), for we had
everything translated and the names kept coming in english (Reviewer,
Author, Editor).
We found that in table2.php and table3.php the code is different than that
of table6.php
table6 code
if ($usertype == "editor") {
$from = _tr('EDITOR');
} else if ($usertype == "author") {
$from = _tr('AUTHOR');
} else if ($usertype == "proofreader") {
$from = _tr('PROOFREADER');
//else added by us..
} else if ($usertype == "reviewer") {
$from = _tr('REVIEWER');
}

fix in table2 and table3
added $from variable and used in the popWin
href=\"javascript:openPopWin('../include/comments.php?id=$id&type=reviewer&f
rom=$from&order=".$row["nOrder"]."', 600, 325, 'scrollbars', 30, 30)\">")

in the function
if ($usertype == "reviewer")
{
$from = _tr('REVIEWER');

echo "<tr><td colspan=\"11\">&nbsp;" .
_tr('TYPE_REVIEW_COMMENTS_HERE') . ": " . ($row["dtDateConfirmedDeclined"]
== "" ? "" : "<a
href=\"javascript:openPopWin('../include/comments.php?id=$id&type=reviewer&f
rom=$from&order=".$row["nOrder"]."', 600, 325, 'scrollbars', 30, 30)\">") .
_tr('REVIEWER_COMMENTS') . ($row["dtDateConfirmedDeclined"] == "" ? "" :
"</a>") . "</td></tr>\n";

We believe that a more dynamic function, that receives a $type variable for the $usertype may be simpler to debug and maintain.

In admin/editor/step4.php "Start date:" is not a variable.
We are adding a variable to the admin.inc.php and the necessary code to print it.

In submission/step4.php the submit button's value is not dynamic (Continue).
We added the necessary the code to print correctly.


that´s all.. for now..
.......................................
...........................................
Guest
 

Postby Guest » Fri Nov 28, 2003 10:57 am

code added to admin/editor/step4.php to print START_DATE

<!-- removendo código estático e colocando variável a atualizar no
admin.inc.php das pastas en e pt Start date: --><?php echo
_tr('START_DATE'); echo '&nbsp;'; date_menu("stats", $dtStatsStartDate) ?>


IMPORTANT NOTE:
the variable define('START_DATE', 'Start Date:');

was added to the user.inc.php, not the admin.inc.php as previously stated...


............................................................................
...........................................
Ramón Martins S. da Fonseca
Guest
 

translation

Postby Julian » Thu Dec 04, 2003 9:26 am

We habe been translating to Spanish, Inf facto we have a operating version. The problem is that translation is in the code files, so when a new version arrive, the old translation is out of date.

What can we do to update?

Thanks
Julian
 

Re: translation

Postby ramon » Tue Dec 09, 2003 4:57 am

We are using version 1.1.5 of OJS. It seems you are using the old version, in which there were no language versions....

if so, you should install a new version and copy-paste the text as needed into a new folder "sp". There you should have copies of the install.inc.php, admin.inc.php and user.inc.php, with your spanish translation

then follow the steps on previous posts to implement the translations...

if you have questions emails any one of us or post your questions here.
It would help if you tell us your setup info (server model, php and mysql version, ojs version)

Ramon

Julian wrote:We habe been translating to Spanish, Inf facto we have a operating version. The problem is that translation is in the code files, so when a new version arrive, the old translation is out of date.

What can we do to update?

Thanks
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Changes to admin/editor/editor.php

Postby Willinsky » Thu Dec 11, 2003 10:29 pm

We made a significant (?) change to admin/editor/editor.php, to print
variables correctly in portuguese. The way it was setup before the
translation did not work, so we had to create variables with similar names
(just to remember) and created a translation to fit...

here´s the change:

<tr><td align="center"><b><span class="medtext_white"><?php echo
_tr('EDITOR1') ?></span></b></td></tr>
<tr><td align="center"><nobr><b><span class="medtext_white"><?php echo
_tr('REVIEW1') ?></span></b>&nbsp;</nobr></td></tr>
<td align="center"><b><span class="medtext_white"><?php echo
_tr('COPYEDIT1') ?></span></b></td>

previous code:
<tr><td align="center"><b><span class="medtext_white"><?php echo
_tr('EDITOR') ?></span></b></td></tr>
<tr><td align="center"><nobr><b><span class="medtext_white"><?php echo
_tr('REVIEW') ?></span></b>&nbsp;</nobr></td></tr>
<td align="center"><b><span class="medtext_white"><?php echo _tr('COPYEDIT')
?></span></b></td>

variables added to locale/pt/admin.inc.php

* admin/author/authorconflict.php
line 70 - define('EDITOR1', 'Avaliação');
* admin/author/articlestatus.php
line 57 - define('REVIEW1', 'Editorial');
* admin/include/requestsubmit.php
line 1699 - define('COPYEDIT1', 'Edição Texto');

However, the concern is that the structure of this header is a bit
confusing.. there could be specific variables for each header, and the html
could be simplified greatly... (I wonder why add tables within tables just
for a piece of text, might have been to keep alignment, but still..)

that´s it for the editor.php
----------------------------
we also made changes to admin/include/table2.php
in line 169 it printed a "Declined" so we added the variable that existed
but wasn´t used.
echo _tr('DECLINED'); // inclusão de variável já existente no admin.inc.php

We also changed this a while ago, don´t know if I told you, all the $from
from that same file have to print a specific variable, to show who wrote the
coment (it was printing "editor", "reviewer", instead of...):
$from = _tr('REVIEWER'); (example)

that´s it for today...

:))



............................................................................
...........................................
Ramón Martins S. da Fonseca
Desenvolvimento Web
IBICT
Instituto Brasileiro de Informação em Ciência e Tecnologia
+55 61 217 6443 / 6347
............................................................................
...........................................
Willinsky
 

Re: translation (Spanish)

Postby John » Mon Dec 15, 2003 10:01 pm

Julian
Andrea Groisman <andrea@magnets.com.ar> is also translating OJS 1.1.5 into Spanish (using the locale files). Also Rodrigo Sánchez <rodrigosj@mi.madritel.es> was working on a Spanish version, and he was connecting wityh Andrea on this. I hope that you can consult with then to share resources in building a Spanish version. We intend to post the Spanish files, and assist in keeping them updated, once they are sent to us.
John

Julian wrote:We habe been translating to Spanish, Inf facto we have a operating version. The problem is that translation is in the code files, so when a new version arrive, the old translation is out of date.

What can we do to update?

Thanks
John
 
Posts: 88
Joined: Tue Oct 14, 2003 9:15 pm
Location: University of British Columbia


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 1 guest