Class: Translator

translator~Translator(logger) → {Translator}

new Translator(logger) → {Translator}

String translator.

Parameters:
Name Type Description
logger Logger
Source:
Returns:
Type
Translator

Methods

getTranslateFn(lang) → {translate}

Get a translator function for given language.

Parameters:
Name Type Description
lang String

Registered language.

Source:
Returns:
Type
translate

list() → {Array.<String>}

List registered language.

Source:
Returns:
Type
Array.<String>

register(lang, obj)

Register a kind of language.

Parameters:
Name Type Description
lang String | Array.<String>

Language names.

obj Object

Language dict from yaml file.

Source: