🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators Translate
This page was created by Charles on 2024-09-21. Last edited by Wikiadmin on 2026-07-29.

You can use translate in OCL to display a string in the current user's language when a matching SysTranslation entry exists.

What translate does

String.translate looks up the string in SysTranslation for the user's language.

  • When a translation exists, the operator returns the translated value.
  • When no translation exists, the operator returns the original string.

This fallback means that a missing translation does not leave the user without text.

Use the operator

Call translate on the string you want to display.

'Bonjour'.translate

Example

Assume that SysTranslation contains a translation from Bonjour to Hello for English users.

Expression User language Returned value
'Bonjour'.translate English Hello
'Bonjour'.translate A language with no matching translation Bonjour

Translation fallback

Use the original text as the value passed to translate. It is also the text users see when no translation has been defined. For example, if no translation is available for 'Save', 'Save'.translate returns Save.

For information about managing translated text, see Localization.

See also