Creates a new MultiString object and initializes it with values.
a map with language-text pairs.
Appends a map with language-translation pairs.
the map with language-translation pairs.
Clears all translations from this MultiString object.
Gets a string translation by specified language. When language is not found it defaults to English ('en'). When English is not found it takes the first value.
a language two-symbol code.
a translation for the specified language or default translation.
Gets all languages stored in this MultiString object,
a list with language codes.
Returns the number of translations stored in this MultiString object.
the number of translations.
Puts a new translation for the specified language.
a language two-symbol code.
a new translation for the specified language.
Removes translation for the specified language.
a language two-symbol code.
Creates a new MultiString object from language-translation pairs (tuples).
an array that contains language-translation tuples.
a MultiString Object.
Creates a new MultiString object from language-translation pairs (tuples) specified as array.
an array that contains language-translation tuples.
a MultiString Object.
Creates a new MultiString object from a value that contains language-translation pairs.
the value to initialize MultiString.
a MultiString object.
Generated using TypeDoc
An object that contains string translations for multiple languages. Language keys use two-letter codes like: 'en', 'sp', 'de', 'ru', 'fr', 'pr'. When translation for specified language does not exists it defaults to English ('en'). When English does not exists it falls back to the first defined language.
Example
let values = MultiString.fromTuples( "en", "Hello World!", "ru", "Привет мир!" ); let value1 = values.get('ru'); // Result: "Привет мир!" let value2 = values.get('pt'); // Result: "Hello World!"