TranslationManager

The translation manager.

Constructor

new TranslationManager(options)

The constructor of the TranslationManager class.

Parameters:
NameTypeDescription
optionsTranslationManagerOptions

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:
NameTypeDescription
nameString

The name of the translation

Returns:
Type: 
Map.<String, function()> | null

get(name) → {function|null}

Gets a translation

Parameters:
NameTypeDescription
nameString

The name of the translation

Returns:
Type: 
function | null

has(name) → {Boolean}

Checks if a translation exists

Parameters:
NameTypeDescription
nameString

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:
NameTypeDescription
nameString

The name of the translation

valuefunction

The function of the translation (.getFixedT)

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:
NameTypeAttributesDefaultDescription
keyString

The key

argsObject<optional>
{}

The args

optionsTranslateOptions

The options

Returns:
Type: 
String | null