Namespace: Translation

sync.api. Translation

Methods


<static> addTranslations(translationSet)

Add a set of translations.
Parameters:
Name Type Description
translationSet object The translated messages.

Object structure:

- to add strings for the target languages:

{
   key1: { 'en_US': 'english string', 'fr_FR': 'french string'... },
   key2: { 'en_US': 'english string2', 'fr_FR': 'french string2'... },
}

- to add a string to be displayed for any language:

{
   key1: 'string1',
   key2: 'string2',
}

<static> getLanguage()

Get the current language for the application. Returns one of the supported languages or the default language.
Returns:
The language in the ISO format. E.g. en_US, de_DE
Type
string