class static
meteoJS/base/named . Named
Source: base/
Class with a name in different languages.
Properties
new Named([options])
Parameter
Name | Type | Optional | Description |
---|---|---|---|
options |
|
Yes |
Options. |
Properties
langSortation Array of string
Default order of the languages.
name string
Default name.
Methods
protected
getDefaultName() → string
Default name.
- Returns
-
string
getNameByLang([lang][, options]) → string
Returns a name, if available in the passed language, otherwise in a fallback language.
Parameters
Name | Type | Optional | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
lang |
string |
Yes |
Language code. |
||||||||
options |
Object |
Yes |
Options. Values in
|
- Returns
-
string
Name in the passed or a fallback language.
getNameByLangNoFallback(lang) → string
Returns the name in the passed language.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
lang |
string |
|
Language code. |
- Returns
-
string
Name in the passed language.
setNameByLang(lang, name)
Sets the name of a certain language. Pass undefined to delete name.
Parameters
Name | Type | Optional | Description |
---|---|---|---|
lang |
string |
|
Language code. |
name |
string |
|
Name. |