Localization

Localization

Internalization controller. If not efined tries to get localization value from browser. Or expects it's defined in 2 small letters language code like en for English

Constructor

new Localization(lang)

Source:
Parameters:
Name Type Default Description
lang string en

Language code.

Classes

Localization

Methods

message(key) → {string}

Source:
Parameters:
Name Type Description
key string

Key name of identifier.

Returns:

Message in selected langauge.

Type
string

sample(key) → {string}

Gets html markup from sample templates.

Source:

Gets html markup from sample templates.

Parameters:
Name Type Description
key string

name of identifier.

Returns:

HTML-markup as sample.

Type
string

update(shadowRoot)

Update all language related fileds using attribute data-i18n.

Source:

Update all language related fileds using attribute data-i18n.

Parameters:
Name Type Description
shadowRoot Object