From edb307d203aa9b076ab8283ce89801bcf77dbc8d Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 11:58:07 +0300 Subject: [PATCH 1/4] doc(core): add function descriptions --- .../core/src/lib/services/localization.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts index d87d28a938..8d059fc33f 100644 --- a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts @@ -10,6 +10,9 @@ type ShouldReuseRoute = (future: ActivatedRouteSnapshot, curr: ActivatedRouteSna @Injectable({ providedIn: 'root' }) export class LocalizationService { + /** + * Returns currently selected language + */ get currentLang(): string { return this.store.selectSnapshot(state => state.SessionState.language); } @@ -42,6 +45,11 @@ export class LocalizationService { }); } + /** + * Returns translated text with with given the interpolation parameters in current language + * @param key Localizaton key to replace with translation + * @param interpolateParams Values to be interpolated in the translation string. + */ get( key: string | Config.LocalizationWithDefault, ...interpolateParams: string[] From 3627c3c8c0d7798aeb8e448c8ff0fae0e8d45bd7 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 13:32:28 +0300 Subject: [PATCH 2/4] refactor(core): correct the description of functions --- .../core/src/lib/services/localization.service.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts index 8d059fc33f..b12b517156 100644 --- a/npm/ng-packs/packages/core/src/lib/services/localization.service.ts +++ b/npm/ng-packs/packages/core/src/lib/services/localization.service.ts @@ -46,9 +46,9 @@ export class LocalizationService { } /** - * Returns translated text with with given the interpolation parameters in current language - * @param key Localizaton key to replace with translation - * @param interpolateParams Values to be interpolated in the translation string. + * Returns an observable localized text with the given interpolation parameters in current language. + * @param key Localizaton key to replace with localized text + * @param interpolateParams Values to interpolate */ get( key: string | Config.LocalizationWithDefault, @@ -57,6 +57,11 @@ export class LocalizationService { return this.store.select(ConfigState.getLocalization(key, ...interpolateParams)); } + /** + * Returns localized text with the given interpolation parameters in current language. + * @param key Localization key to replace with localized text + * @param interpolateParams Values to intepolate. + */ instant(key: string | Config.LocalizationWithDefault, ...interpolateParams: string[]): string { return this.store.selectSnapshot(ConfigState.getLocalization(key, ...interpolateParams)); } From d3c6d73bc2a7946cc0b2433d6973a471322c13e6 Mon Sep 17 00:00:00 2001 From: TheDiaval Date: Wed, 22 Jan 2020 17:12:05 +0300 Subject: [PATCH 3/4] refactor(settings-management): change bootstrap class name --- .../src/lib/components/setting-management.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html b/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html index 8d5fd0e8d1..c54a581312 100644 --- a/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html +++ b/npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.html @@ -2,7 +2,7 @@

{{ 'AbpSettingManagement::Settings' | abpLocalization }}

-