mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
fix eslint warnigs for core project (#7506)
This commit is contained in:
@@ -39,7 +39,7 @@ export class TranslationService {
|
||||
constructor(public translate: TranslateService,
|
||||
userPreferencesService: UserPreferencesService,
|
||||
@Optional() @Inject(TRANSLATION_PROVIDER) providers: TranslationProvider[]) {
|
||||
this.customLoader = <TranslateLoaderService> this.translate.currentLoader;
|
||||
this.customLoader = this.translate.currentLoader as TranslateLoaderService;
|
||||
|
||||
this.defaultLang = 'en';
|
||||
translate.setDefaultLang(this.defaultLang);
|
||||
@@ -61,6 +61,7 @@ export class TranslationService {
|
||||
|
||||
/**
|
||||
* Adds a new folder of translation source files.
|
||||
*
|
||||
* @param name Name for the translation provider
|
||||
* @param path Path to the folder
|
||||
*/
|
||||
@@ -78,6 +79,7 @@ export class TranslationService {
|
||||
|
||||
/**
|
||||
* Loads a translation file.
|
||||
*
|
||||
* @param lang Language code for the language to load
|
||||
* @param fallback Language code to fall back to if the first one was unavailable
|
||||
*/
|
||||
@@ -97,17 +99,19 @@ export class TranslationService {
|
||||
|
||||
/**
|
||||
* Triggers a notification callback when the translation language changes.
|
||||
*
|
||||
* @param lang The new language code
|
||||
*/
|
||||
onTranslationChanged(lang: string): void {
|
||||
this.translate.onTranslationChange.next({
|
||||
lang: lang,
|
||||
lang,
|
||||
translations: this.customLoader.getFullTranslationJSON(lang)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target language for translations.
|
||||
*
|
||||
* @param lang Code name for the language
|
||||
* @returns Translations available for the language
|
||||
*/
|
||||
@@ -118,6 +122,7 @@ export class TranslationService {
|
||||
|
||||
/**
|
||||
* Gets the translation for the supplied key.
|
||||
*
|
||||
* @param key Key to translate
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
* @returns Translated text
|
||||
@@ -128,6 +133,7 @@ export class TranslationService {
|
||||
|
||||
/**
|
||||
* Directly returns the translation for the supplied key.
|
||||
*
|
||||
* @param key Key to translate
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
* @returns Translated text
|
||||
|
Reference in New Issue
Block a user