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 options have the following properties:

Name Type Optional Description

langSortation

Array of string

Yes

Priority of language codes.

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.