OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



HOW-TO: Translating OJS and OCS

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.

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Thu Jun 21, 2012 9:52 am

Thanks a lot, Ramon.
I hope that Alec or another involved developer passes by here and could tell us where to find the month and date file. Or, I should open a related topic.
I looked in the forum and in some php files but didn't find them.
It would be really practical if we have a tool, like Firebug, that allows to locate any item for translation purposes! Just we hover an item and see where is located!
I don't know if such a tool already exists! If so, this is fantastic!

Regards
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Thu Jun 21, 2012 12:03 pm

Hi all,

You can get most of the way there by creating an empty translation (e.g. put it in registry.locales.xml and enable it in your installation, but don't actually translate any content). When OJS can't find a translation for a key it displays the key names between hash symbols, i.e. ##missing.key.name##. If you're not sure what locale key a piece of text comes from, you can switch from English over to your empty translation to find out.

The names of months and days aren't in the OJS translation files anywhere; they come from your system's date functions.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Thu Jun 21, 2012 10:19 pm

Hi Alec,

I followed your method but unfortunately I can't find the items' locations easily!
For example, the archive item appears as ##NAVIGATION.ARCHIVES## but it doesn't tell in which file/folder to find it!
Also, for the information for authors and readers, it is marked:
##PLUGINS.BLOCK.INFORMATION.LINK##
##navigation.infoForAuthors##

This doesn't tell where to find these items, even at first sight, it should be in the Block plugin, but when I lookup inside, there is no info for readers or authors!

The same applies for the other sections in the journal, for example:
##NAVIGATION.HOME##
##NAVIGATION.ABOUT##
##NAVIGATION.USERHOME##
##NAVIGATION.SEARCH##
##NAVIGATION.CURRENT##
##navigation.infoForAuthors##
....


How these information help localize the corresponding items?
I don't know if I miss the wire, but I couldn't make the correspondence between these dashed info and the item location!
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Fri Jun 22, 2012 6:10 am

Hi Ojser,

For that part of the process, I make use of a file search tool. On Linux/UNIX/MacOSX it's fgrep/find, on Windows it used to be Start > Find > Look in files and folders, and I'm not sure what it is in newer versions of Windows. You need to search OJS's XML files for that key. It's much faster and more convenient than trying to guess.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Fri Jun 22, 2012 9:32 am

Ok, thanks Alec.
What about the names of months? Sorry, I didn't catch the issue!
There is nothing to lookup in OJS to fix this?
Is this a server php issue? I mean, should I lookup for it in the server php config or in OJS php config?
The reparation of this issue will be at the ojs-level or server level?


Regards,
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Fri Jun 22, 2012 9:34 am

Hi Ojser,

What is the problem you're having with days and months? Probably it's a PHP or system configuration issue.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Fri Jun 22, 2012 9:49 am

When I click on search menu, there is a drop-down list for the month names (e.g to specify a search range; searchdateForm), but two month names appear wrongly translated. So, I'd like to fix this.
Where could I look for to solve it?

In other word, where to find the month names? I'm looking in the files for January, February...but don't fin them!

Regards,
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Fri Jun 22, 2012 10:45 am

Hi Ojser,

Those come from your system locale files, not files that are part of OJS. OJS uses the setlocale PHP function, which tells the system which language to use. (See http://www.php.net/manual/en/function.setlocale.php). Depending on what your server platform is, PHP will get the month names etc. from different sources. On a Debian server, for example, you need to have the language added in /etc/locale.gen, and then you need to run locale-gen. Your server administrator will have to do this.

It's unlikely that you'll get your server administrator to modify the system files that provide PHP with the month and day names.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Sun Jun 24, 2012 6:05 pm

asmecher wrote:Hi Ojser,
It's unlikely that you'll get your server administrator to modify the system files that provide PHP with the month and day names.

Yes, unless you have own server, VPS for example!
But, what is the argument against not to include date and month config in OJS?
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Sun Jun 24, 2012 6:15 pm

Hi Ojser,

OJS uses Smarty and PHP's built-in date and time functions. To avoid using those we'd have to re-implement a lot of code, which would be counterproductive. Those resources are there to be used and if every project ignored them and rewrote their own versions the software landscape would be a lot buggier and stranger.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Fri Jun 29, 2012 3:24 am

Hi Alec,

Well, what about using tools like Poedit and Launchpad? Isn't possible with OJS?
Such a tool has great advantage that it gets together all the files to be translated!
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Fri Jun 29, 2012 12:15 pm

Hi Ojser,

That wouldn't solve the issue with date and time localization, as those are configured system-wide. However, if we were to overhaul OJS's translation toolkit, a .po file based toolset is probably the prime contender.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Mon Jul 02, 2012 12:45 am

asmecher wrote:Hi Ojser,

If we were to overhaul OJS's translation toolkit, a .po file based toolset is probably the prime contender.

This would be great! I'd switch to it immediately! But this implies losing all the translation done so far, right? :(!
We should start from scratch!
Isn't feasible to generate a .pot file right now? How much would it take?
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

Re: HOW-TO: Translating OJS and OCS

Postby asmecher » Mon Jul 02, 2012 7:19 pm

Hi Ojser,

As far as I'm aware, all you would need is a conversion tool to go from .xml to .po and back again; then you would be able to use the .po toolset. The formats are quite similar so it wouldn't be a tremendously difficult thing to do, but you'd probably need to be able to do some basic scripting to perform the conversion.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8840
Joined: Wed Aug 10, 2005 12:56 pm

Re: HOW-TO: Translating OJS and OCS

Postby Ojser » Tue Jul 03, 2012 12:18 am

Thank you Alec,

I'm trying with Poedit to play around but it doesn't work!
I created a new project >browse OJS folder to set it as the source (for PHP files!), then
I chose English and Hebrew as languages tests.
Then Goback to file>create new catalog (choose ut8 as charset), click OK but Poedit didn't find any files in the scanned directory!
Normally, Poedit creates pot file from PHP files, which is not necessarily needed for OJS as we have the XML files.
So, maybe I'm approaching it from a wrong side and there is a simpler way!
I don't know if it would be feasible to convert the XML files, that Ramon pasted above, to POT file and then convert them back again to XML files in the new language! I'm searching around but didn't get it yet!
As we have xml files, I should use them to create first a pot file then a po file for the translation. Is such an assumption feasible?

Do you have a better idea or clarification on this point?

The better for me would be to merge the XML that I'm trying to translate now with the source files to check and continue from the point where I'm stopped!


Thanks
Ojser
 
Posts: 152
Joined: Wed Mar 28, 2012 6:23 am

PreviousNext

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest