core/i18n/translate.service.ts
A service to manage the language of the application.
Properties |
|
Methods |
constructor(ngxTranslate: NgxTranslateService, ui: AppStateService, options: OptionsService, document: Document, bsLocaleService: BsLocaleService)
|
||||||||||||||||||
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(localeCode: 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(localeCode: string)
|
||||||||
Switches the app to given locale (incl. Angular, Bootstrap, translations).
Parameters :
Returns :
any
|
langs |
Type : any
|
Default value : keys(this.langsDetail).filter(k => this.langsDetail[k])
|
langsDetail |
Type : any
|
Default value : this.options.get('languages', {})
|
Static SAVE_LANGUAGE_KEY |
Type : string
|
Default value : 'c8y_language'
|