I18n
Purpose¶
A utility to manage i18n.
Note
The default locale is EN
Methods¶
Binding name: p6.i18n
getText¶
Reads the locale
pipeline entry and searches for the corresponding text in the map.
Syntax
String p6.i18n.getText(Map texts)
Note
If no entry is found, or the pipeline variable is empty, the default locale EN
is used.
Example
def label = [
EN: "English",
FR: "French"
]
println p6.i18n.getText(label)
getText (with locale)¶
Returns the corresponding text in the map matching the given locale.
Syntax
String p6.i18n.getText(Map texts, String locale)
Note
If no entry is found, the default locale EN
is used.
Example
def label = [
EN: "English",
FR: "French"
]
println p6.i18n.getText(label, "FR")
// Output: French
println p6.i18n.getText(label, "BE")
// Output: English