core/i18n/translation-loader.service.ts
A service to load translations from different sources. It combines translations from the app, user-defined translations, and plugins. It also caches translations to avoid unnecessary requests.
Is used instead of the default TranslateLoader functionality that ngx-translate provides as otherwise only the first translations from TranslateLoader observable would have been picked up. This would have been problematic, as we can only load the plugin translations after the login and we need to have at least the basic translations already on the login screen.
Methods |
|
constructor(optionsService: OptionsService, cachedLocaleDictionaryService: CachedLocaleDictionaryService, pluginResolverService: PluginsResolveService, translateService: TranslateService, path: string, languages: literal type | null)
|
|||||||||||||||||||||
Parameters :
|
clearCache |
clearCache()
|
Returns :
void
|
getTranslation | ||||||
getTranslation(lang: string)
|
||||||
Parameters :
Returns :
Observable<literal type>
|
Protected getTranslationFromPath |
getTranslationFromPath(path: string, lang: string)
|
Returns :
Observable<literal type>
|
Protected getTranslationsForPlugin |
getTranslationsForPlugin(lang: string, pluginId: string)
|
Returns :
Observable<{ [key: string]: string; }>
|
Protected getTranslationsForPugins | ||||||
getTranslationsForPugins(lang: string)
|
||||||
Parameters :
Returns :
any
|
Protected getTranslationsFromApp | ||||||
getTranslationsFromApp(lang: string)
|
||||||
Parameters :
Returns :
Observable<{ [key: string]: string; }>
|
Protected getUserDefinedTranslations | ||||||
getUserDefinedTranslations(lang: string)
|
||||||
Parameters :
Returns :
Observable<{ [key: string]: string; }>
|
triggerReload |
triggerReload()
|
Returns :
void
|