Constructor
new I18nClass(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
Methods
configure(config) → {Object}
Configure I18n part
Parameters:
Name | Type | Description |
---|---|---|
config |
Object |
- Source:
Returns:
- Current configuration
- Type
- Object
get(key, defValopt) → {String}
Get value
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | ||
defVal |
String |
<optional> |
Default value |
- Source:
Returns:
- value of the key
- Type
- String
getByLanguage(key, language, defVal) → {String}
Get value according to specified language
Parameters:
Name | Type | Default | Description |
---|---|---|---|
key |
String | ||
language |
String | Specified langurage to be used | |
defVal |
String | null | Default value |
- Source:
Returns:
- The corresponding value of the key from dictionary
- Type
- String
putVocabularies(vocabularies)
Add vocabularies for one language
Parameters:
Name | Type | Description |
---|---|---|
vocabularies |
Object | Object that has language as key, vocabularies of each language as value |
- Source:
putVocabulariesForLanguage(langurage, vocabularies)
Add vocabularies for one language
Parameters:
Name | Type | Description |
---|---|---|
langurage |
String | Language of the dictionary |
vocabularies |
Object | Object that has key-value as dictionary entry |
- Source:
setLanguage(lang)
Explicitly setting language
Parameters:
Name | Type | Description |
---|---|---|
lang |
String |
- Source: