Translator Details

A detailed overview of functions related to translation.

Param Lang

The Param Lang specifies the "primary" or "source" language. This is the language that all translations are based on. Within the GEDI an asterisk in the Language combo box indicates the Param language of your project. It can be set in the config file with the entry [general] paramLang. The default value for this is the first [general] langs entry.

Translation Source Lang

The config entry [general] translationSourceLang can be used for the translation of texts from a sub project, in case the main project does not include the sub project's source text language.

Translation Files

The translation files are stored at the selected project level within the msg > <language> folder with the same name as the project. They can be renamed with the config entry [general] translationFile.

Automatic Translation Check box

The translator functionality is available for most lang strings. The lang string can be entered manually via the lang string editor.

Figure 1. Lang String Editor

Within the lang string editor, activating the Auto check box enables the Translator functionality for this lang string. If this option is not activated, the translations must be entered manually for each string. If a translation is already entered (i.e. when the other language entry is not empty) the check box must be activated manually to use automatic translations. When the check box is active the translation in this editor cannot be changed manually and will remain the same in the panel, but will be shown as the retrieved translation at runtime.

Some shapes have a single language editor for strings, for which the Auto check box can also be activated.

In case no editor is available a translation can still be added via control code.

Note: The translation is only available for translatable data point configs, not for data point values.

Context specific Translations

Translations can be made context dependent by adding a comment. This way multiple translations for one term can be added and used specifically in one panel or script. This functionality is available with the optional parameters of the tr() function.

Deleting Translations

Translations can be deleted both intentionally and unintentionally.

Note: Translations are automatically deleted from the translation source file when it is not used anywhere and Update translation files for the target project is triggered.
CAUTION: Translation entries are also deleted when triggering Update translation files for the target project if the source text is changed. A new entry is then created for which the translation must be added again.

Using Translations in Control Code

Translations loaded during runtime from the translation files can be used within Control Code with the tr() function. The other translation related functions are "subst" (string::subst), projectTranslationUpdate() projectTranslationUnload() and getTranslationFile().

Note: As not all text attributes can open the lang string editor, the tr() function can be used to add translations to these texts.

Retrieving old translation content

The existing getCatStr() function can be used to retrieve the translation from message catalogs.

Note: The message catalogs are not scanned for translatable text.
Important: The message catalogs themselves can not be used with the new Translator feature.

Other Filetype

The translation files can be saved in the international XML Localization Interchange File Format (XLIFF) (*.xlf) within the Qt Linguist window. The XLIFF versions 1.1 and 1.2 are currently supported.