From 0d6db5461dca3a3d2902d3edee5c3c8fa7e59cb1 Mon Sep 17 00:00:00 2001 From: "VENUGOPALAN Uma (DIGIT-EXT)" Date: Wed, 28 Sep 2022 07:49:24 +0200 Subject: [PATCH 1/2] Initiate locale set up and configured locale Id --- src/app/app.component.ts | 7 +++++-- src/config/global.ts | 11 +++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4a0c047..21a5252 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,7 +2,7 @@ import { Component, OnDestroy } from '@angular/core'; import { Store } from '@ngrx/store'; import { getUserState, UserState } from '@eui/core'; import { Observable, Subscription } from 'rxjs'; -import { I18nService } from '@eui/core'; +import { I18nService,LocaleService } from '@eui/core'; @Component({ selector: 'app-root', @@ -25,12 +25,15 @@ export class AppComponent implements OnDestroy { { label: 'Title label 4', subLabel: 'Subtitle label' }, ]; - constructor(private store: Store,protected i18nService: I18nService,) { + constructor(private store: Store,protected i18nService: I18nService,locale: LocaleService, + ) { this.userState = this.store.select(getUserState); this.subs.push(this.userState.subscribe((user: UserState) => { this.userInfos = { ...user }; })); this.i18nService.init(); + locale.init().subscribe(status => { console.log(status,"loclestatus") } ); + } ngOnDestroy() { diff --git a/src/config/global.ts b/src/config/global.ts index 0f9eba4..46e9a71 100644 --- a/src/config/global.ts +++ b/src/config/global.ts @@ -1,5 +1,7 @@ import { GlobalConfig } from '@eui/core'; import { environment } from '../environments/environment'; +import { LocaleServiceConfig } from '@eui/core'; + export const GLOBAL: GlobalConfig = { appTitle: 'CSDR-app', @@ -9,8 +11,7 @@ export const GLOBAL: GlobalConfig = { languages: ['en', 'fr'], }, i18nLoader: { - i18nFolders: ['i18n'], - i18nServices: [`${environment.apiBaseUrl}translations?lang=`] + i18nFolders: ['i18n-eui', 'i18n', 'i18n-ecl'], }, }, user: { @@ -19,4 +20,10 @@ export const GLOBAL: GlobalConfig = { lang: 'en', }, }, + locale: { + available: ['el-GR'], + bindWithTranslate: false, + + }, + }; From 509f92227c8a8383cd82657da0012a695fc0bb55 Mon Sep 17 00:00:00 2001 From: "VENUGOPALAN Uma (DIGIT-EXT)" Date: Tue, 11 Oct 2022 12:51:58 +0200 Subject: [PATCH 2/2] locale --- src/config/global.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/config/global.ts b/src/config/global.ts index 46e9a71..c6f474e 100644 --- a/src/config/global.ts +++ b/src/config/global.ts @@ -19,11 +19,6 @@ export const GLOBAL: GlobalConfig = { dashboard: { }, lang: 'en', }, - }, - locale: { - available: ['el-GR'], - bindWithTranslate: false, - - }, + } };