Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
[EC-154] [BEEEP] Add token for localesDirectory (#783)
Browse files Browse the repository at this point in the history
* Add token for localesDirectory

* Add token for SYSTEM_LANGUAGE
  • Loading branch information
eliykat committed Apr 29, 2022
1 parent e4687b4 commit d7e5546
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions angular/src/services/jslib-services.module.ts
Expand Up @@ -91,6 +91,8 @@ export const LOGOUT_CALLBACK = new InjectionToken<(expired: boolean, userId?: st
);
export const LOCKED_CALLBACK = new InjectionToken<() => void>("LOCKED_CALLBACK");
export const CLIENT_TYPE = new InjectionToken<boolean>("CLIENT_TYPE");
export const LOCALES_DIRECTORY = new InjectionToken<string>("LOCALES_DIRECTORY");
export const SYSTEM_LANGUAGE = new InjectionToken<string>("SYSTEM_LANGUAGE");

@NgModule({
declarations: [],
Expand All @@ -106,6 +108,15 @@ export const CLIENT_TYPE = new InjectionToken<boolean>("CLIENT_TYPE");
useFactory: (i18nService: I18nServiceAbstraction) => i18nService.translationLocale,
deps: [I18nServiceAbstraction],
},
{
provide: LOCALES_DIRECTORY,
useValue: "./locales",
},
{
provide: SYSTEM_LANGUAGE,
useFactory: (window: Window) => window.navigator.language,
deps: [WINDOW],
},
{
provide: STATE_FACTORY,
useValue: new StateFactory(GlobalState, Account),
Expand Down

0 comments on commit d7e5546

Please sign in to comment.