CurrentLanguage
Last updated
Was this helpful?
Last updated
Was this helpful?
The current language active in the Runtime, as configured in the project settings and optionally changed/selected by the user, or the "Change language" process node, in the active session.
This function is SQL compatible. For more information about SQL compatibility, see our .
Returns the language which is currently active in the Runtime User session, based on the configuration in the Portal Settings.
Underscore or Hyphen
The Language Code or Keyword is used with underscore and no doublequotes:
nl_NL
or en_US
The Language as a value, as displayed on a page or used as a text-parameter, uses a hyphen: "nl-NL" or "en-US" (doublequotes in expression as text) or nl-NL / en-US as plain values on page.
When a function or a process node expects a language value as input, it may in some cases accept the keyword (nl_NL) and in other cases the ToString value ("nl-NL"). You can then choose to use the text literal (like "nl-NL") or use the ToString(language) function, like ToString(CurrentLanguage)
or ToString(nl_NL)
.
CurrentLanguage
CurrentLanguage
Result: en_US
(underscored keyword) OR en-US
(hyphened when directly displayed on a page as a label)
ToString(CurrentLanguage)
Result: en-US (hyphened text value)
Comparisons, assuming the actual current language is en_US
CurrentLanguage = en_US
Result: yes
CurrentLanguage = nl_NL
Result: no (because it is en_US
)
CurrentLanguage = "en-US"
warning: expression contains a type mismatch (keyword expected, string used)
CurrentLanguage = nl_NL
Result: no (because it is en_US
)
ToString(CurrentLanguage) = "en-US"
Result: yes
ToString(CurrentLanguage) = "not a language"
Result: no
ToString(CurrentLanguage) = ToString(en_US)
Result: yes
ToString(en_US) = "en-US"
Result: yes