Translation for HTML5 interface

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
rtownrow
Posts: 15
Joined: Fri Dec 20, 2013 2:55 am

Translation for HTML5 interface

Post by rtownrow »

Hi, can somebody please detail how to add new translations to TimeTrex now it uses the HTML5 interface? It looks like we need to turn our old .mo and .po files into .json format. Is there an automated way to do this?
Thanks!
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Translation for HTML5 interface

Post by shaunw »

The supported translation method is as described here:
http://forums.timetrex.com/viewtopic.php?f=5&t=707
rtownrow
Posts: 15
Joined: Fri Dec 20, 2013 2:55 am

Re: Translation for HTML5 interface

Post by rtownrow »

Thanks Shawnw. I'm not sure why, but the Russian translation I worked on here (https://translations.launchpad.net/time ... imetrex/ru) is working for the Legacy Interface (interface/flex) but not for the HTML5 interface (interface/html5)
Do I have to use the legacy interface for custom translations?
When I look in the LC_MESSAGES folder for other translations (es_ES spanish for example), I see a new file, messages.json , which didn't exist in earlier Flex-only versions of TimeTrex, such as 7.3.4. So I thought perhaps I needed to create this file in the folder found at \TimeTrex\timetrex\interface\locale\ru_RU\LC_MESSAGES .
So what I'm asking is, if this JSON file is needed to use a translation in the new interface:
1) How do I create and easily edit this JSON file?
2) Is there a way to automatically create a JSON file from messages.mo or messages.po , to avoid having to manually enter a lot of Russian strings ?

You previously mentioned the need for new translation work with the HTML5 interface here: http://forums.timetrex.com/viewtopic.php?f=2&t=6491

We are running TimeTrex 7.4.7 on Windows 8 Pro 64-bit edition.
We installed it using the automated installer, recently upgrading from 7.4.5.
We are using the included Apache web server, port 8085.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Translation for HTML5 interface

Post by shaunw »

The Russian translation from launchpad is not included with TimeTrex because it is only 25% translated so far, once it reaches about 75% we will include it automatically.

In the new interface the .JSON file is required in addition to the other files, it can be compiled using the tools/i18n/ scripts if you have all the necessary tools on your system to do this.
rtownrow
Posts: 15
Joined: Fri Dec 20, 2013 2:55 am

Re: Translation for HTML5 interface

Post by rtownrow »

Thanks very much for your advice!
Yes, I was able to add my Russian language translation to the HTML5 interface by generating a messages.json file.

In Ubuntu Linux, I simply copied messages.po into the i18n directory and ran the following command:
php po2json.php -i messages.po -o messages.json -n i18n_dictionary
Then I copied the created file into the relevant LC_MESSAGES folder.
Finally, I emptied the "cache" folder in TimeTrex for the old English text to be fully replaced by the Russian translation.

Just a couple of comments:
1) The po2json.php tool doesn't seem to work in Windows. I got strange messages about phpinfo() .
2) Still there's a few text strings we want translated which aren't in the messages.po file. So I guess we need to start from a different messages.po file (probably the English one) and add all the translations again using poedit or MemoQ? Once we've done that, we can generate a new messages.json file which should be more complete.

Thanks.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: Translation for HTML5 interface

Post by shaunw »

The translations are still in a state of flux right now as TimeTrex v8.0 will be released soon and both legacy interfaces have been removed from it so it should reduce the number of strings requiring translation substantially. You can use the tools/i18n/gen_master_pot.sh to find all possible strings for translation, and "mergelocales" to combine them with existing .po files.

Most of the i18n tools will only work on Linux.
Post Reply