Constructor
new TranslationManager(options)
The constructor of the TranslationManager class.
Parameters:
Name | Type | Description |
---|---|---|
options | TranslationManagerOptions | The options of the translation manager |
Members
isReady :Boolean
If the translations are loaded.
Type:
- Boolean
options :TranslationManagerOptions
The options of the TranslationManager.
Methods
delete(name) → {Map.<String, function()>|null}
Deletes a translation
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the translation |
Returns:
- Type:
- Map.
<String, function()> |null
get(name) → {function|null}
Gets a translation
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the translation |
Returns:
- Type:
- function |
null
has(name) → {Boolean}
Checks if a translation exists
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the translation |
Returns:
- Type:
- Boolean
list() → {Array.<function()>|null}
Lists all translations
Returns:
- Type:
- Array.
<function()> |null
set(name, value) → (nullable) {Map.<String, function()>}
Sets a translation
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the translation |
value | function | The function of the translation ( |
Returns:
- Type:
- Map.
<String, function()>
size() → {Number}
Gets the number of translations
Returns:
- Type:
- Number
translate(key, argsopt, options) → {String|null}
Translates a string
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key | String | The key | ||
args | Object | <optional> | {} | The args |
options | TranslateOptions | The options |
Returns:
- Type:
- String |
null