How to Translate UI Labels Defined in Logics

Some of the labels of inputs, outputs and other relevant (mostly label-like) entities, whose labels were previously received from backend and pasted 1:1 on frontend are now being translated with interpolation (explained below), which effectively allows you to internationalize the names of e.g., inputs or outputs by using translation keys instead of labels directly.

Till version 14.0, you have been able to do this in Groovy:

someInput.setHelpText("Help text")

This would result in someInput having "Help text" rendered as its tooltip in the UI. From version 14.0, you can do the following:

someInput.setHelpText("translation_key")

and the frontend will translate this translation_key instead of pasting the string directly. Moreover, you can use interpolation to have more flexible control over which parts of the string should be treated as translation keys:

someOutput.setLabel("{{input_name_key}} + 1")

This will treat input_name_key as a translation key, replace the curly braces and translation key in the original string with the translation and leave the rest of the string untouched. Multiple such places can be present inside the string, each of them will be treated this way:

Both output_name_key as well as input_name_key will be translated and the translations will be put back into the original string.

See also Internationalization on how to add translation keys.

Found an issue in documentation? Write to us.