API

 

TranslatableTextList

Provides methods to retrieve a bunch of texts to use in code.

class TranslatableTextList {
  constructor(
    translate: TranslationService,
    keyList: string | Array<string> | object
    );
  get( key: string, args?: any ): string;
}

constructor()

Creates a new instance of the text list.

translate
The translation service.
keyList
Defines the keys of the texts to retrieve.

get()

Returns the text identified by the key in the current language. If the text contains placeholders for values, then they are replaced with the values provided by the second argument.

key
The key of the text to return.
args
That optional argument provides the eventual values to interpolate.
Returns the translated text.