[ADF-2905] Added JSDocs for core (#3281)

* [ADF-2905] Updated JSDocs for core

* [ADF-2905] Added missing JSDoc for user pref service
This commit is contained in:
Andy Stark
2018-05-08 15:30:23 +01:00
committed by Eugenio Romano
parent d456b3cba1
commit dd1b8893cc
10 changed files with 102 additions and 7 deletions

View File

@@ -90,6 +90,10 @@ 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,
@@ -100,6 +104,7 @@ export class TranslationService {
/**
* Sets the target language for translations.
* @param lang Code name for the language
* @returns Translations available for the language
*/
use(lang: string): Observable<any> {
this.customLoader.init(lang);
@@ -110,6 +115,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
*/
get(key: string|Array<string>, interpolateParams?: Object): Observable<string|any> {
return this.translate.get(key, interpolateParams);
@@ -119,6 +125,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
*/
instant(key: string | Array<string>, interpolateParams?: Object): string | any {
return this.translate.instant(key, interpolateParams);