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..c6f474e 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: { @@ -18,5 +19,6 @@ export const GLOBAL: GlobalConfig = { dashboard: { }, lang: 'en', }, - }, + } + };