Internationalisation

From Zymonic

Overview[edit]

TODO: overview of labels within the system

Prerequisites[edit]

The user doing the import/export must have the RolePermission "Administer Label IO", "Administer Label Usage" and "Labels" (TODO: check this).

The script zymonic_lang_importer.pl must be in /usr/local/bin and executable by the apache processuser. This should be done automatically by the Zymonic_Toolkit_Installer

Export the labels[edit]

A label file would generally be delivered to a client as requested, for them to translate.

To generate a label file, login to the system and got to 'Admin Area Page', search for 'Label' in the menu and open the 'Label import and export' process. The Used By search field can be used to limit the labels being generated to just a specific process if required, but this is optional. Click 'Generate HTML for download' – when the block reloads there will be a link from which to download the file. If a specific process was used the the following line needs adding to the downloaded file:

<p id="c2bf187df78bbf3736c96bfc401eff8c825f92763dc9bb43e239c7f3d5fb9faf992a469c8056c682509a65c3e90b71ca">Please correct any errors and then try again.</p>

Translate[edit]

The html file contains a body element which is filled with 'p' (paragraph) elements. Each of the paragraph elements has an 'id' this is the 'key' which will be used on the reimport therefore the form of the imported file should be a body element which is filled with 'p' tags which contain the translations (with the id maintained), i.e., the following:

<p id="2ea989f83006e233627987293f4bde0a1bf5a81cc471bec34eed8b3305973bb183cc564d444e
14bc2b8e21aac626d001">Customer Name</p>

should become:

<p id="2ea989f83006e233627987293f4bde0a1bf5a81cc471bec34eed8b3305973bb183cc564d444e14bc2b8e21aac626d001">Nom du client</p>

It is very important that the 'html → body → p*' structure of the document is maintained, that the ids are maintained as attributes on the 'p' elements, that the 'p' elements contain just the translation and that the document has correctly closed tags throughout. We have designed the file to be compatible with the Google Translator toolkit and it can be used as follows

  1. Navigate to the translator toolkit (you will need a google account).
  2. Select Upload.
  3. Go through each phrase and ensure it is correctly translated – note that anything in double square brackets will be substituted when each page request is generated; these must be maintained unchanged, including the case.
  4. From the 'share' menu select download to download the completed file.

Import[edit]

Important: The file name cannot contain spaces or special characters.

The final step is to import the file; in the 'Admin Area Page', in the menu search for 'Label' and open 'Label Import'. Fill in the language code, subset and select the file, then click import labels. The language code can be chosen freely, as can the subset. The import process deletes any records that match the 'digest' (id), language code and subset before importing each label.

Custom XSL per Language/Subset[edit]

Additionally the system will look in [html directory]/[language code]-[subset]/ for the 'default' XSL file

Viewing translated labels[edit]

simply update your session record in the DB to set zz_sessions.lang_code and zz_sessions.subset to match the values used on Import.