Skip to main content
Version: 8.3

translate

This function is used by Ignition's Expression language.

Description​

Returns a translated string, based on the current locale. If the string does not exist in the global translations, the original string will be returned. This function exists in the Client and Gateway scopes.

Syntax​

translate(stringKey, [languageString])

Parameters​

TypeParameterDescription
StringstringKeyThe starting string to translate.
StringlanguageStringThe language or locale to translate against, such as "es" or "es-ES". Accepts both the BCP-47 language tag (recommended) and the legacy underscore formats. Make sure to use locale codes for either format, and not language names, such as "Spanish". If omitted, the current locale is used. [optional]

Results​

String - The starting string translated based on the specified locale, or the current locale if none was given. If the translation does not exist, the original stringKey is returned.