mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1769] Added JSDocs for services (#2961)
This commit is contained in:
committed by
Eugenio Romano
parent
6d0bab9278
commit
de575fd47b
@@ -62,6 +62,11 @@ export class TranslationService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new folder of translation source files.
|
||||
* @param name Name for the translation provider
|
||||
* @param path Path to the folder
|
||||
*/
|
||||
addTranslationFolder(name: string = '', path: string = '') {
|
||||
if (!this.customLoader.providerRegistered(name)) {
|
||||
this.customLoader.registerProvider(name, path);
|
||||
@@ -83,15 +88,29 @@ export class TranslationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the target language for translations.
|
||||
* @param lang Code name for the language
|
||||
*/
|
||||
use(lang: string): Observable<any> {
|
||||
this.customLoader.init(lang);
|
||||
return this.translate.use(lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the translation for the supplied key.
|
||||
* @param key Key to translate
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
*/
|
||||
get(key: string|Array<string>, interpolateParams?: Object): Observable<string|any> {
|
||||
return this.translate.get(key, interpolateParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly returns the translation for the supplied key.
|
||||
* @param key Key to translate
|
||||
* @param interpolateParams String(s) to be interpolated into the main message
|
||||
*/
|
||||
instant(key: string | Array<string>, interpolateParams?: Object): string | any {
|
||||
return this.translate.instant(key, interpolateParams);
|
||||
}
|
||||
|
Reference in New Issue
Block a user