Difference between revisions of "GUI Translation"

(Updated ant commands)
Line 15: Line 15:
 
== Generating a translation template ==
 
== Generating a translation template ==
  
Translations are usually performed by filling out a translation template. This template (a file with the extension .pot) is generated by executing the ''pot'' task in Ant. Execute this at your open-xchange-gui '''source''' directory:
+
Translations are usually performed by filling out a translation template. This template (a file with the extension .pot) is generated by executing the ''pot'' task in Ant. Execute this in your open-xchange-gui '''source''' directory:
  
  ant -Dlib.dir=/opt/open-xchange/lib/ pot
+
  ant pot
  
 
The ''-D'' switch should specify the same path as in [[Open_Xchange_Installation#IV.4._Open-Xchange_GUI|section IV.4]] of the installation tutorial. This will produce a file called ''ox.pot'' in the ''i18n'' directory of the GUI source. This file contains all untranslated text strings found in the source code. The corresponding entries can be either entered manually or merged automatically with an existing translation created for an older version of the GUI. In the latter case, only new and changed strings need to be updated manually. You will now have to modify (translate) the created ''.pot'' file with a translation tool of you choice, the dedicated tools are a great help for this task.
 
The ''-D'' switch should specify the same path as in [[Open_Xchange_Installation#IV.4._Open-Xchange_GUI|section IV.4]] of the installation tutorial. This will produce a file called ''ox.pot'' in the ''i18n'' directory of the GUI source. This file contains all untranslated text strings found in the source code. The corresponding entries can be either entered manually or merged automatically with an existing translation created for an older version of the GUI. In the latter case, only new and changed strings need to be updated manually. You will now have to modify (translate) the created ''.pot'' file with a translation tool of you choice, the dedicated tools are a great help for this task.
Line 44: Line 44:
 
After that, the new translation must be transformed to JavaScript and copied to its final destination on the web server. This is done by starting Ant again, as described in [[Open_Xchange_Installation#IV.4._Open-Xchange_GUI|section IV.4]] of the installation tutorial:
 
After that, the new translation must be transformed to JavaScript and copied to its final destination on the web server. This is done by starting Ant again, as described in [[Open_Xchange_Installation#IV.4._Open-Xchange_GUI|section IV.4]] of the installation tutorial:
  
  ant -Dlib.dir=/opt/open-xchange/lib/ deploy
+
  ant deploy

Revision as of 06:22, 13 May 2008

This page describes the steps required to translate the AJAX GUI into a new language. Please have a look at Hyperion_Translation to see which translations are already available and which are missing at the moment.

Preparation

Before translating anything, it is recommended that the server and the GUI are installed as described in the installation tutorial. If translations are tested somewhere else, the server is not strictly necessary. In this case, only sections II.1, II.2, II.7, III.1, the Saxon library from section III.2, and section IV.4 of the tutorial are relevant.

The translations use portable object (PO) files from GNU gettext as file format. There are several tools available to edit the translations:

  • gted (Eclipse Plugin)
  • KBabel (Unix/Linux only (KDE))
  • poEdit (Multi-Platform)
  • Any text editor, since PO files are simple UTF-8 text files.

At least one of these will be required by the translator.

Generating a translation template

Translations are usually performed by filling out a translation template. This template (a file with the extension .pot) is generated by executing the pot task in Ant. Execute this in your open-xchange-gui source directory:

ant pot

The -D switch should specify the same path as in section IV.4 of the installation tutorial. This will produce a file called ox.pot in the i18n directory of the GUI source. This file contains all untranslated text strings found in the source code. The corresponding entries can be either entered manually or merged automatically with an existing translation created for an older version of the GUI. In the latter case, only new and changed strings need to be updated manually. You will now have to modify (translate) the created .pot file with a translation tool of you choice, the dedicated tools are a great help for this task.

Installing

After a POT file is translated or merged, it should be saved as ox.xx_XX.po, where xx_XX is the language code like e. g. de_DE or en_US. Each translation should be saved as i18n/xx_XX/po/ox.xx_XX.po.

For example:

/usr/src/open-xchange-gui/i18n/xx_XX/po/ox.xx_XX.po

To include the new language in the build process, one line must be added to the file i18n/languages.js:

var all_languages = {

"ca_ES": "Català",
"de_DE": "Deutsch",
"en_US": "English",
"fr_FR": "Français",
"ja_JP": "日本語",
"xx_XX": "Language name"

};

Please note that each language line except the last one must end with a comma.

After that, the new translation must be transformed to JavaScript and copied to its final destination on the web server. This is done by starting Ant again, as described in section IV.4 of the installation tutorial:

ant deploy