FunctionalityThis function will return a translation according to selected language.
ArgumentsThe key of a translation from the 'Translations of Application Text' catalog. The translation must be of the 'messages/Messages' base name.
ParametersThe 'translate' function accepts message parameters. See 'example 2' below. Correct use of braces for parameters specification is checked by metamodel check option 'Translations of Application Text'.
Example 1Adding the function e.g. to a treeview...:
valueset(systype) + ': ' + systemname + if(isNull(name),' ', (' [' + name + '] ')) + valueset(status) + translate('deleteFailed')
...will add a translation of the key 'deleteFailed' to the treeview.
Example 2
In calculation: translate('key', desk, 'text', typeLocation) 'key' is the translation key and desk, 'text' and typeLocation are translation parameters.
When 'Translations of Application Text' are used to specify translation for the 'key', the 'Standard Translation' (in the corresponding field of the 'Translation of Application Text' object) can be created e.g. as follows:
param 1: {0} param 2: {1} param 3: {2}
where {0} represents the first position in the calculation, {1} represents the second position and {2} the third position.
The field assigned as 'Attribute For Results' then will display the translation together with corresponding parameter values.