new MessageFormatDictionary()
Initializes the dictionary.
Members
-
_dictionary :Object.<string, Object.<string, function(Object.<string, (number|string)>): string>>
-
Stored dictionary.
Type:
- Object.<string, Object.<string, function(Object.<string, (number|string)>): string>>
-
_language :string
-
The language of the phrases in the dictionary, represented as a ISO 639-1 language code.
Type:
- string
Methods
-
get(key [, parameters])
-
Parameters:
Name Type Argument Description key
string The key identifying the localization phrase. The key consists of at least two parts separated by dots. The first part denotes the name of the source JSON localization file, while the rest denote a field path within the localization object within the given localization file.
parameters
Object.<string, (boolean|number|string|Date)> <optional>
The map of parameter names to the parameter values to use. Defaults to an empty plain object.
-
getLanguage()
-
-
has(key)
-
Parameters:
Name Type Description key
string The key identifying the localization phrase. The key consists of at least two parts separated by dots. The first part denotes the name of the source JSON localization file, while the rest denote a field path within the localization object within the given localization file.
-
init(config)
-
Parameters:
Name Type Description config
Object The dictionary field contains the localization phrases organized in a deep plain object map. The top-level key is the name of the phrase group, the bottom-level key is the phrase key. The bottom-level value is the localization phrase generator that takes the phrase placeholder values map as an argument and produces the localization phrase with its placeholders evaluated using the provided placeholder values.