File

core/i18n/translation-loader.service.ts

Description

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.

Index

Methods

Constructor

constructor(optionsService: OptionsService, cachedLocaleDictionaryService: CachedLocaleDictionaryService, pluginResolverService: PluginsResolveService, translateService: TranslateService, path: string, languages: literal type | null)
Parameters :
Name Type Optional
optionsService OptionsService No
cachedLocaleDictionaryService CachedLocaleDictionaryService No
pluginResolverService PluginsResolveService No
translateService TranslateService No
path string No
languages literal type | null No

Methods

clearCache
clearCache()
Returns : void
getTranslation
getTranslation(lang: string)
Parameters :
Name Type Optional
lang string No
Returns : Observable<literal type>
Protected getTranslationFromPath
getTranslationFromPath(path: string, lang: string)
Parameters :
Name Type Optional
path string No
lang string No
Returns : Observable<literal type>
Protected getTranslationsForPlugin
getTranslationsForPlugin(lang: string, pluginId: string)
Parameters :
Name Type Optional
lang string No
pluginId string No
Returns : Observable<{ [key: string]: string; }>
Protected getTranslationsForPugins
getTranslationsForPugins(lang: string)
Parameters :
Name Type Optional
lang string No
Returns : any
Protected getTranslationsFromApp
getTranslationsFromApp(lang: string)
Parameters :
Name Type Optional
lang string No
Returns : Observable<{ [key: string]: string; }>
Protected getUserDefinedTranslations
getUserDefinedTranslations(lang: string)
Parameters :
Name Type Optional
lang string No
Returns : Observable<{ [key: string]: string; }>
triggerReload
triggerReload()
Returns : void

results matching ""

    No results matching ""