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 | Language name. |
obj |
Object | Language dict from yaml file. |
- Source:
unregister(lang)
Unregister a kind of language.
Parameters:
Name | Type | Description |
---|---|---|
lang |
String | Language name. |
- Source: