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 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.
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.
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.
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().
Retrieving old translation content
The existing getCatStr() function can be used to retrieve the translation from message catalogs.
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.