core/i18n/translate.service.ts
A service to manage the language of the application.
Properties |
|
Methods |
constructor(ngxTranslate: NgxTranslateService, ui: AppStateService, options: OptionsService)
|
||||||||||||
Parameters :
|
convertToLanguageCodePO | ||||||||
convertToLanguageCodePO(lang: string)
|
||||||||
Converts a iso language code to a PO language code (e.g. de-de gets de_de).
Parameters :
Returns :
string
|
Static defaultLang |
defaultLang()
|
Returns :
any
|
firstSupportedLanguage |
firstSupportedLanguage()
|
Finds the first supported language
Returns :
any
|
getNativeLanguage | ||||||||
getNativeLanguage(lang: string)
|
||||||||
Returns the language in the native language.
Parameters :
Returns :
string
The native name. |
getSupported | ||||||
getSupported(lang: string)
|
||||||
Parameters :
Returns :
any
|
Async loadLocales | ||||
loadLocales(moduleLang)
|
||||
Parameters :
Returns :
any
|
queryStringLang |
queryStringLang()
|
Gets the language from the query parameter.
Returns :
any
The language two-letter code. |
saveInLocalStorage | ||||||
saveInLocalStorage(lang: string)
|
||||||
Parameters :
Returns :
void
|
setLanguage | ||||||
setLanguage(lang: string)
|
||||||
Parameters :
Returns :
void
|
Async switchToLanguage | ||||||||
switchToLanguage(lang: string)
|
||||||||
Switches to given language.
Parameters :
Returns :
any
|
langs |
langs:
|
Type : any
|
Default value : keys(this.langsDetail).filter(k => this.langsDetail[k])
|
langsDetail |
langsDetail:
|
Type : any
|
Default value : this.options.get('languages', {})
|
Static SAVE_LANGUAGE_KEY |
SAVE_LANGUAGE_KEY:
|
Type : string
|
Default value : 'c8y_language'
|