From d7e554653a7e593f8cdaf7e2fe926eb04fb5d5c5 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 29 Apr 2022 17:28:38 +1000 Subject: [PATCH] [EC-154] [BEEEP] Add token for localesDirectory (#783) * Add token for localesDirectory * Add token for SYSTEM_LANGUAGE --- angular/src/services/jslib-services.module.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/angular/src/services/jslib-services.module.ts b/angular/src/services/jslib-services.module.ts index a230f980a5..e0bc046830 100644 --- a/angular/src/services/jslib-services.module.ts +++ b/angular/src/services/jslib-services.module.ts @@ -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("CLIENT_TYPE"); +export const LOCALES_DIRECTORY = new InjectionToken("LOCALES_DIRECTORY"); +export const SYSTEM_LANGUAGE = new InjectionToken("SYSTEM_LANGUAGE"); @NgModule({ declarations: [], @@ -106,6 +108,15 @@ export const CLIENT_TYPE = new InjectionToken("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),