Translation scope for localized text

Translation of localized text depends on the UI session and the current locale.

Overview

Translation of
LocalizedText
variables depends on the session Language and occurs only in a locale-aware UI session.
A locale-aware UI session uses
LocalizationDictionary
entries for the current locale. Objects outside the UI session do not use the current session locale.
The following rules describe translation behavior in the UI session and the root session:
  • Translation applies only in locale-aware UI sessions.
  • Literal strings are not translated automatically.
  • Text translates only when it matches a localization entry.
  • Objects outside the UI session use the root session locale.
  • The root session locale is English by default.

Translation scope

The following objects and contexts use the current session locale for translation.
Translatable objects and contexts
Item
Description
UI object, such as a label or text box, with a link to a key in
LocalizationDictionary
The object runs in the UI session and uses the current locale.
The UI object displays translated text when the linked key has an entry for the current locale.
UI object with a
StringFormatter
converter and a
Format
property linked to a
LocalizationDictionary
key
If a graphic object uses a
StringFormatter
, the UI translates the content when the
Format
property matches a dictionary entry. This behavior supports locale-specific sentence structure.
For example, one locale can use
Value: {0}
, and another locale can use
{0}:値
.
UI object linked to a model variable of type
LocalizedText
with a link to a localization dictionary key
The UI object displays the translation for the current locale when the variable value matches a localization dictionary entry.
The following objects and contexts do not use the current session locale for translation.
Untranslatable objects and contexts
Item
Description
Literal string values, regardless of their location in the project
If a model variable holds a literal string, the string is not automatically translated at runtime. This behavior does not change with the project default locale.
Any variable without a direct localization dictionary entry, regardless of its location in the project or data type
Variables without a localization dictionary entry are not translated.
For example, a label with
hello
text without a dictionary mapping remains unchanged.
Variable of type
LocalizedText
that uses a
StringFormatter
converter and a localized
Format
property outside a UI object
If the
Format
property matches a localization key, but the variable is outside a UI object, translation does not occur.
Does not apply to some objects, for example: Alarms, EventLoggers, Reports.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal