Skip to main content

Class: I18nService

Constructors​

constructor​

• new I18nService()

Methods​

czLabelToString​

â–¸ Abstract czLabelToString(value, lang?, fallbackLangs?): string

Parameters​

NameType
valueCzLabel
lang?string
fallbackLangs?string[]

Returns​

string

the extracted string from value, but not processed for translation!

Defined in​

lib/services/i18n.service.ts:51


getActiveLang​

â–¸ Abstract getActiveLang(): string

Returns​

string

the currently active lang in the app, in a short ('en') or long ('en-BE') format.

Defined in​

lib/services/i18n.service.ts:27


getActiveLocale​

â–¸ Abstract getActiveLocale(): string

Returns​

string

the currently active lang in the app, in a short ('en') or long ('en-BE') format.

Defined in​

lib/services/i18n.service.ts:38


getActiveSimpleLang​

â–¸ Abstract getActiveSimpleLang(): string

Returns​

string

the currently active lang in the app, in a short format (so like 'en', not 'en-BE')

Defined in​

lib/services/i18n.service.ts:15


getAvailableLangs​

â–¸ Abstract getAvailableLangs(): string[]

Returns​

string[]

the list of available langs

Defined in​

lib/services/i18n.service.ts:64


getAvailableSimpleLangs​

â–¸ Abstract getAvailableSimpleLangs(): string[]

Returns​

string[]

the list of available langs, in short format

Defined in​

lib/services/i18n.service.ts:69


selectActiveLang​

â–¸ Abstract selectActiveLang(): Observable<string>

Returns​

Observable<string>

the currently active lang in the app, in a short ('en') or long ('en-BE') format, wrapped in an Observable.

Defined in​

lib/services/i18n.service.ts:21


selectActiveLocale​

â–¸ Abstract selectActiveLocale(): Observable<string>

Returns​

Observable<string>

the currently active locale in the app

Defined in​

lib/services/i18n.service.ts:32


selectActiveSimpleLang​

â–¸ Abstract selectActiveSimpleLang(): Observable<string>

Returns​

Observable<string>

the currently active lang in the app, in a short format (so like 'en', not 'en-BE'), in an Observable

Defined in​

lib/services/i18n.service.ts:9


selectTranslate​

â–¸ Abstract selectTranslate<T>(key, params?, lang?): Observable<T>

Type parameters​

NameType
Tunknown

Parameters​

NameType
keyCzLabel
params?Object
lang?string

Returns​

Observable<T>

the translation associated to the given key, using params and in the corresponding lang, as an Observable, in case the translation file is not yet loaded, or if the lang changes (if not given)

Defined in​

lib/services/i18n.service.ts:59


translate​

â–¸ Abstract translate<T>(key, params?, lang?): T

Type parameters​

NameType
Tunknown

Parameters​

NameType
keyCzLabel
params?Object
lang?string

Returns​

T

the translation associated to the given key, using params and in the corresponding lang

Defined in​

lib/services/i18n.service.ts:45