The default language within the portal settings.
ix.api.text.i18n.defaultLang; // e.g. "en"
The currently selected language within the portal settings.
ix.api.text.i18n.lang; // e.g. "en"
Retrieve a portal constant by its key with an optional fallback.
The key of the constant.
Optional
fallback: stringThe fallback to be used, if key wasn't found.
ix.api.text.i18n.get("<LANGUAGE-CONSTANT>", "Fallback text");
// Get the value of the language constant "GEN_SAVE"
ix.api.text.i18n.get("GEN_SAVE");
// Returns:
// - "Save" if the current language is English
// - "Speichern" if the current language is German
// - "Sauvegarder" if the current language is French
Retrieve an application constant by its key with an optional fallback.
The application GUID.
The key of the constant.
Optional
fallback: stringThe fallback to be used, if key wasn't found.
ix.api.text.i18n.getByApp("<APP-GUID>", "<LANGUAGE-CONSTANT>", "Fallback text");
Offers functions to retrieve the text associated with language constants corresponding to the currently selected language within the portal settings.
Important
For ease of use, the methods can be invoked directly through
ix.text.i18n.methodName();
, eliminating the need to create a class instance.Usage
ix.api.text.i18n
Example