@o3r/localization 10.0.0-next.22 → 10.0.0-next.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -371,8 +371,6 @@ constructor(private router: Router,
371
371
 
372
372
  ### How to add RTL support in my app
373
373
 
374
- - Note: **TextDirectionDirective** is deprecated. Please refer to **TextDirectionService**.
375
-
376
374
  The **TextDirectionService** has to be injected in `app.component.ts` as follows.
377
375
 
378
376
  ```typescript
@@ -399,7 +397,7 @@ import {
399
397
  LazyMessageFormatConfig,
400
398
  LocalizationModule,
401
399
  translateLoaderProvider,
402
- TranslateMessageFormatLazyCompiler
400
+ TranslateMessageFormatLazyCompiler
403
401
  } from "@o3r/localization";
404
402
  import { TranslateModule } from "@ngx-translate/core";
405
403
  import { MESSAGE_FORMAT_CONFIG } from 'ngx-translate-messageformat-compiler';
@@ -439,8 +437,8 @@ class AppModule {}
439
437
 
440
438
  ### How to localize plural expression
441
439
 
442
- For pluralizations we are using *TranslateMessageFormatCompiler*, comming from [ngx-translate-messageformat-compiler](https://www.npmjs.com/package/ngx-translate-messageformat-compiler) package, which is a compiler for *ngx-translate* that uses *messageformat.js* to compile translations using ICU syntax for handling pluralization and gender.
443
- [ICU Message Format](http://userguide.icu-project.org/formatparse/messages) is a standardized syntax for dealing with the translation of user-visible strings into various languages that may have different requirements for the correct declension of words (e.g. according to number, gender, case) - or to simplify: pluralization.
440
+ For pluralizations we are using *TranslateMessageFormatCompiler*, comming from [ngx-translate-messageformat-compiler](https://www.npmjs.com/package/ngx-translate-messageformat-compiler) package, which is a compiler for *ngx-translate* that uses *messageformat.js* to compile translations using ICU syntax for handling pluralization and gender.
441
+ [ICU Message Format](http://userguide.icu-project.org/formatparse/messages) is a standardized syntax for dealing with the translation of user-visible strings into various languages that may have different requirements for the correct declension of words (e.g. according to number, gender, case) - or to simplify: pluralization.
444
442
  Simple pluralization rules like *0, 1 or other* fits well for English but may not fit for many other languages (eastern Europe languages, asiatic languages) where pluralization rules are much more complex. If this does not fit your requirement we recommend to reformulate your text, so that you do not need to use pluralization. Example: instead of saying 'You have added 2 baggages' you may want to say 'Pieces of baggage: 2' which should be fine for most of languages no matter which number is considered to be plural.
445
443
 
446
444
  #### Integration with ngx-translate
@@ -504,7 +502,7 @@ Sometimes you may want to display a different resource based on some property va
504
502
  ```
505
503
 
506
504
  ```typescript
507
- // in component html
505
+ // in component html
508
506
  <ul>
509
507
  <li>{{ translations.people | translate: { gender: 'female', how: 'influential' } }}</li>
510
508
  <li>{{ translations.people | translate: { gender: 'male', how: 'funny' } }}</li>
@@ -517,22 +515,22 @@ Note again that *translations.people* matches *global.people* key
517
515
  **Output**
518
516
 
519
517
  ```
520
- - She is influential
521
- - He is funny
522
- - They are affectionate
518
+ - She is influential
519
+ - He is funny
520
+ - They are affectionate
523
521
  ```
524
522
 
525
523
  ## Debugging
526
524
 
527
525
  ### Runtime: toggle translation on and off
528
526
 
529
- In order to be able to more easily identify which key corresponds to a given text, the ``LocalizationService`` exposes a function ``toggleShowKeys()`` that can be called in order to deactivate or reactivate the translation mechanism at **runtime**.
527
+ In order to be able to more easily identify which key corresponds to a given text, the ``LocalizationService`` exposes a function ``toggleShowKeys()`` that can be called in order to deactivate or reactivate the translation mechanism at **runtime**.
530
528
  While deactivated, the ``translate`` **pipe** and **directive** will output the translation keys instead of their resolved values.
531
529
 
532
530
  > **Important**: this mechanism only applies to the pipe and directive exported by Otter's ``LocalizationModule``. The original ones from ``ngx-translate`` do not support it.
533
531
 
534
- First, this mechanism has to be activated via the ``LocalizationConfiguration`` that you can provide in your ``ApplicationModule``.
535
- This is mainly for performances reason: the way it works is it adds a new subscription to every ``translate`` pipe and directive in order to know when translations are turned on or off.
532
+ First, this mechanism has to be activated via the ``LocalizationConfiguration`` that you can provide in your ``ApplicationModule``.
533
+ This is mainly for performances reason: the way it works is it adds a new subscription to every ``translate`` pipe and directive in order to know when translations are turned on or off.
536
534
  Not enabling it allows to avoid all those subscriptions, and should be the baseline for a production environment.
537
535
 
538
536
  Example:
@@ -1,3 +1,2 @@
1
1
  export * from './localization';
2
- export * from './input-merge';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/annotations/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/annotations/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1,3 +1,2 @@
1
1
  export * from './localization';
2
- export * from './input-merge';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYW5ub3RhdGlvbnMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLGVBQWUsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbG9jYWxpemF0aW9uJztcbmV4cG9ydCAqIGZyb20gJy4vaW5wdXQtbWVyZ2UnO1xuIl19
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYW5ub3RhdGlvbnMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbG9jYWxpemF0aW9uJztcbiJdfQ==
@@ -45,34 +45,6 @@ function Localization(_url) {
45
45
  };
46
46
  }
47
47
 
48
- /**
49
- * Decorator for @Input property
50
- * It merges user input with default property value
51
- *
52
- * @param privateFieldName
53
- * @deprecated will be removed in v10
54
- */
55
- // eslint-disable-next-line @typescript-eslint/naming-convention
56
- function InputMerge(privateFieldName) {
57
- return (target, key) => {
58
- const privateField = privateFieldName || `_${key}`;
59
- const privateValue = target[key];
60
- if (delete target[key]) {
61
- Object.defineProperty(target, key, {
62
- get: function () {
63
- return this[privateField];
64
- },
65
- set: function (value) {
66
- const currentField = this[privateField] || privateValue;
67
- this[privateField] = typeof currentField === 'undefined' ? immutablePrimitive(value) : deepFill(currentField, value);
68
- },
69
- enumerable: true,
70
- configurable: true
71
- });
72
- }
73
- };
74
- }
75
-
76
48
  /**
77
49
  * Default configuration for LocalizationModule
78
50
  */
@@ -1066,5 +1038,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
1066
1038
  * Generated bundle index. Do not edit.
1067
1039
  */
1068
1040
 
1069
- export { CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN, DEFAULT_LOCALIZATION_CONFIGURATION, InputMerge, LOCALIZATION_CONFIGURATION_TOKEN, LOCALIZATION_OVERRIDE_REDUCER_TOKEN, LOCALIZATION_OVERRIDE_STORE_NAME, Localization, LocalizationDevtoolsConsoleService, LocalizationDevtoolsMessageService, LocalizationDevtoolsModule, LocalizationModule, LocalizationOverrideStoreModule, LocalizationService, LocalizationTranslateDirective, LocalizationTranslatePipe, LocalizedCurrencyPipe, LocalizedDatePipe, LocalizedDecimalPipe, MESSAGE_FORMAT_CONFIG, OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, OtterLocalizationDevtools, TextDirectionService, TextDirectionality, TranslateMessageFormatLazyCompiler, TranslationsLoader, createLocalizationConfiguration, createTranslateLoader, getDefaultLocalizationOverrideReducer, lazyMessageDefaultConfig, localeIdNgBridge, localizationOverrideInitialState, localizationOverrideReducer, localizationOverrideReducerFeatures, localizationOverrideStorageDeserializer, localizationOverrideStorageSync, selectLocalizationOverride, selectLocalizationOverrideState, setLocalizationOverride, translateLoaderProvider };
1041
+ export { CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN, DEFAULT_LOCALIZATION_CONFIGURATION, LOCALIZATION_CONFIGURATION_TOKEN, LOCALIZATION_OVERRIDE_REDUCER_TOKEN, LOCALIZATION_OVERRIDE_STORE_NAME, Localization, LocalizationDevtoolsConsoleService, LocalizationDevtoolsMessageService, LocalizationDevtoolsModule, LocalizationModule, LocalizationOverrideStoreModule, LocalizationService, LocalizationTranslateDirective, LocalizationTranslatePipe, LocalizedCurrencyPipe, LocalizedDatePipe, LocalizedDecimalPipe, MESSAGE_FORMAT_CONFIG, OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, OtterLocalizationDevtools, TextDirectionService, TextDirectionality, TranslateMessageFormatLazyCompiler, TranslationsLoader, createLocalizationConfiguration, createTranslateLoader, getDefaultLocalizationOverrideReducer, lazyMessageDefaultConfig, localeIdNgBridge, localizationOverrideInitialState, localizationOverrideReducer, localizationOverrideReducerFeatures, localizationOverrideStorageDeserializer, localizationOverrideStorageSync, selectLocalizationOverride, selectLocalizationOverrideState, setLocalizationOverride, translateLoaderProvider };
1070
1042
  //# sourceMappingURL=o3r-localization.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"o3r-localization.mjs","sources":["../../src/annotations/localization.ts","../../src/annotations/input-merge.ts","../../src/core/localization.configuration.ts","../../src/core/translate-messageformat-lazy.compiler.ts","../../src/stores/localization-override/localization-override.actions.ts","../../src/stores/localization-override/localization-override.reducer.ts","../../src/stores/localization-override/localization-override.state.ts","../../src/stores/localization-override/localization-override.module.ts","../../src/stores/localization-override/localization-override.selectors.ts","../../src/stores/localization-override/localization-override.sync.ts","../../src/tools/localization.token.ts","../../src/tools/localization.service.ts","../../src/tools/localization-translate.directive.ts","../../src/tools/localization-translate.pipe.ts","../../src/tools/localized-currency.pipe.ts","../../src/tools/localized-date.pipe.ts","../../src/tools/localized-decimal.pipe.ts","../../src/tools/text-direction.service.ts","../../src/tools/text-directionality.service.ts","../../src/tools/localization.module.ts","../../src/tools/translations-loader.ts","../../src/tools/localization.provider.ts","../../src/devkit/localization-devtools.service.ts","../../src/devkit/localization-devtools.token.ts","../../src/devkit/localization-devtools.console.service.ts","../../src/devkit/localization-devtools.message.service.ts","../../src/devkit/localization-devtools.module.ts","../../src/o3r-localization.ts"],"sourcesContent":["import { deepFill, immutablePrimitive, otterComponentInfoPropertyName } from '@o3r/core';\n\n/**\n * Decorator to pass localization url\n *\n * @param _url\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Localization(_url: string) {\n return (target: any, key: string) => {\n const privateField = _url || `_${key}`;\n const privateValue = target[key];\n\n if (delete target[key]) {\n Object.defineProperty(target, key, {\n get: function (this: any) {\n return this[privateField];\n },\n set: function (this: any, value: Record<string, unknown>) {\n const currentField = this[privateField] || privateValue;\n this[privateField] = typeof currentField === 'undefined' ? immutablePrimitive(value) : deepFill(currentField, value);\n if (this[otterComponentInfoPropertyName]) {\n this[otterComponentInfoPropertyName].translations = this[privateField];\n }\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n}\n","import { deepFill, immutablePrimitive } from '@o3r/core';\n\n/**\n * Decorator for @Input property\n * It merges user input with default property value\n *\n * @param privateFieldName\n * @deprecated will be removed in v10\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function InputMerge(privateFieldName?: string) {\n return (target: any, key: string) => {\n const privateField = privateFieldName || `_${key}`;\n const privateValue = target[key];\n\n if (delete target[key]) {\n Object.defineProperty(target, key, {\n get: function (this: any) {\n return this[privateField];\n },\n set: function (this: any, value: Record<string, unknown>) {\n const currentField = this[privateField] || privateValue;\n this[privateField] = typeof currentField === 'undefined' ? immutablePrimitive(value) : deepFill(currentField, value);\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n}\n","/**\n * Describes configuration for LocalizationModule\n */\nexport interface LocalizationConfiguration {\n /** List of available languages */\n supportedLocales: string[];\n /** Application display language */\n language?: string;\n /** Url to fetch translation bundles from */\n endPointUrl: string;\n /** Prefix endPoinrUrl with dynamicContentPath provided by DynamicContentPath */\n useDynamicContent: boolean;\n /** List of RTL language codes */\n rtlLanguages: string[];\n /**\n * Fallback language map of resource in case translation in language does not exist.\n * translate to unsupported language will try to map to supportedLocales from below property.\n *\n * @example\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR'], fallbackLocalesMap: {'en-CA': 'en-US', 'de': 'fr-FR'}\n * translate to en-CA -> fallback to en-US, translate to de-DE -> fallback to fr-FR,\n * translate to en-NZ -> fallback to en-GB, translate to en -> fallback to en-GB.\n */\n fallbackLocalesMap?: {\n [supportedLocale: string]: string;\n };\n /** Fallback language of resource in case translation in language does not exist */\n fallbackLanguage: string;\n /** Path relative to published folder where webpack will copy translation bundles */\n bundlesOutputPath: string;\n /** Debug mode switch */\n debugMode: boolean;\n /** Query parameters for fetching the localization resources */\n queryParams?: {[key: string]: string};\n /** Fetch options object as per https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters */\n fetchOptions?: RequestInit;\n /** Enable the ability to switch the translations on and off at runtime. */\n enableTranslationDeactivation: boolean;\n /**\n * Merge the translations from DynamicContentPath with the local translations\n * Warning: Enable this option will download two localization bundles and can delay the display of the text on application first page\n *\n * @default false\n */\n mergeWithLocalTranslations: boolean;\n}\n\n/**\n * Default configuration for LocalizationModule\n */\nexport const DEFAULT_LOCALIZATION_CONFIGURATION: LocalizationConfiguration = {\n supportedLocales: [],\n endPointUrl: '',\n useDynamicContent: false,\n rtlLanguages: ['ar', 'he'],\n fallbackLanguage: 'en',\n bundlesOutputPath: '',\n debugMode: false,\n enableTranslationDeactivation: false,\n mergeWithLocalTranslations: false\n};\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { TranslateCompiler } from '@ngx-translate/core';\nimport { IntlMessageFormat, Options } from 'intl-messageformat';\n\n/**\n * Options for Lazy Message Format compiler\n */\nexport interface LazyMessageFormatConfig extends Options {\n /**\n * Enables compiled translation caching\n *\n * @default true\n */\n enableCache?: boolean;\n\n /**\n * Enables HTML in translation\n *\n * @default true\n */\n ignoreTag?: boolean;\n}\n\n/**\n * Message format configuration default value\n */\nexport const lazyMessageDefaultConfig: LazyMessageFormatConfig = {\n enableCache: true,\n ignoreTag: true\n};\n\n/** Message Format configuration Token */\nexport const MESSAGE_FORMAT_CONFIG = new InjectionToken<LazyMessageFormatConfig>('Message Format configuration');\n\n/**\n * This compiler expects ICU syntax and compiles the expressions with messageformat.js\n * Compare to ngx-translate-messageformat-compiler package, the compilation of the translation is done only on demand\n */\n@Injectable()\nexport class TranslateMessageFormatLazyCompiler extends TranslateCompiler {\n\n /** Configuration */\n private config: LazyMessageFormatConfig;\n\n /** Cache of compiled translations */\n private cache: { [x: string]: IntlMessageFormat } = {};\n\n constructor(@Optional() @Inject(MESSAGE_FORMAT_CONFIG) config?: LazyMessageFormatConfig) {\n super();\n\n this.config = config ? { ...lazyMessageDefaultConfig, ...config } : lazyMessageDefaultConfig;\n }\n\n /**\n * Clear the cache of the compiled translations\n */\n public clearCache() {\n this.cache = {};\n }\n\n /** @inheritDoc */\n public compile(value: string, lang: string): (params: any) => string {\n return (params: any) => (new IntlMessageFormat(value, lang, undefined, this.config).format(params) as string);\n }\n\n /** @inheritDoc */\n public compileTranslations(translations: {[x: string]: any}, lang: string) {\n type CompiledTranslationMap = {[key in keyof typeof translations]: (params: any) => string};\n\n const compilingStrategy = this.config.enableCache ?\n (acc: CompiledTranslationMap, key: string) => {\n acc[key] = (params: any) => {\n const cached = this.cache[`${lang}_${key}`];\n if (cached) {\n return cached.format(params) as string;\n }\n\n const newCachedItem = new IntlMessageFormat(translations[key], lang, undefined, this.config);\n this.cache[`${lang}_${key}`] = newCachedItem;\n return newCachedItem.format(params) as string;\n };\n return acc;\n } :\n\n (acc: CompiledTranslationMap, key: string) => {\n acc[key] = (params: any) => new IntlMessageFormat(translations[key], lang, undefined, this.config).format(params) as string;\n return acc;\n };\n\n return Object.keys(translations)\n .reduce<CompiledTranslationMap>(compilingStrategy, {});\n }\n}\n","import { createAction, props } from '@ngrx/store';\nimport { SetStateActionPayload } from '@o3r/core';\nimport { LocalizationOverrideState } from './localization-override.state';\n\n/** Actions */\nconst ACTION_SET = '[LocalizationOverride] set';\n\n/**\n * Clear all overrides and fill the store with the payload\n */\nexport const setLocalizationOverride = createAction(ACTION_SET, props<SetStateActionPayload<LocalizationOverrideState>>());\n","import {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './localization-override.actions';\nimport { LocalizationOverrideState} from './localization-override.state';\n\n/**\n * LocalizationOverride Store initial value\n */\nexport const localizationOverrideInitialState: LocalizationOverrideState = {localizationOverrides: {}};\n\n/**\n * List of basic actions for LocalizationOverride Store\n */\nexport const localizationOverrideReducerFeatures: ReducerTypes<LocalizationOverrideState, ActionCreator[]>[] = [\n on(actions.setLocalizationOverride, (_state, payload) => ({...payload.state}))\n];\n\n/**\n * LocalizationOverride Store reducer\n */\nexport const localizationOverrideReducer = createReducer(\n localizationOverrideInitialState,\n ...localizationOverrideReducerFeatures\n);\n","/**\n * LocalizationOverride store state\n */\nexport interface LocalizationOverrideState {\n /** Mapping of initial localization keys to the one they are replaced with */\n localizationOverrides : Record<string,string>;\n}\n\n/**\n * Name of the LocalizationOverride Store\n */\nexport const LOCALIZATION_OVERRIDE_STORE_NAME = 'localizationOverride';\n\n/**\n * LocalizationOverride Store Interface\n */\nexport interface LocalizationOverrideStore {\n /** LocalizationOverride state */\n [LOCALIZATION_OVERRIDE_STORE_NAME]: LocalizationOverrideState;\n}\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\n\nimport { localizationOverrideReducer } from './localization-override.reducer';\nimport { LOCALIZATION_OVERRIDE_STORE_NAME, LocalizationOverrideState } from './localization-override.state';\n\n/** Token of the LocalizationOverride reducer */\nexport const LOCALIZATION_OVERRIDE_REDUCER_TOKEN = new InjectionToken<ActionReducer<LocalizationOverrideState, Action>>('Feature LocalizationOverride Reducer');\n\n/** Provide default reducer for LocalizationOverride store */\nexport function getDefaultLocalizationOverrideReducer() {\n return localizationOverrideReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(LOCALIZATION_OVERRIDE_STORE_NAME, LOCALIZATION_OVERRIDE_REDUCER_TOKEN)\n ],\n providers: [\n { provide: LOCALIZATION_OVERRIDE_REDUCER_TOKEN, useFactory: getDefaultLocalizationOverrideReducer }\n ]\n})\nexport class LocalizationOverrideStoreModule {\n public static forRoot<T extends LocalizationOverrideState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<LocalizationOverrideStoreModule> {\n return {\n ngModule: LocalizationOverrideStoreModule,\n providers: [\n { provide: LOCALIZATION_OVERRIDE_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { LOCALIZATION_OVERRIDE_STORE_NAME, LocalizationOverrideState } from './localization-override.state';\n\n/** Select LocalizationOverride State */\nexport const selectLocalizationOverrideState = createFeatureSelector<LocalizationOverrideState>(LOCALIZATION_OVERRIDE_STORE_NAME);\n\n/** Select all localization override map */\nexport const selectLocalizationOverride = createSelector(selectLocalizationOverrideState, (state) => state?.localizationOverrides || {});\n","import { Serializer } from '@o3r/core';\nimport { localizationOverrideInitialState } from './localization-override.reducer';\nimport { LocalizationOverrideState } from './localization-override.state';\n\nexport const localizationOverrideStorageDeserializer = (rawObject: any) => {\n if (!rawObject) {\n return localizationOverrideInitialState;\n }\n return rawObject;\n};\n\nexport const localizationOverrideStorageSync: Serializer<LocalizationOverrideState> = {\n deserialize: localizationOverrideStorageDeserializer\n};\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationConfiguration } from '../core';\n\n/** Localization Configuration Token */\nexport const LOCALIZATION_CONFIGURATION_TOKEN = new InjectionToken<LocalizationConfiguration>('Localization Configuration injection token');\n","/* eslint-disable @typescript-eslint/ban-types */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { TranslateService } from '@ngx-translate/core';\nimport { LoggerService } from '@o3r/logger';\nimport { BehaviorSubject, combineLatest, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs/operators';\nimport { LocalizationConfiguration } from '../core/localization.configuration';\nimport { LocalizationOverrideStore, selectLocalizationOverride } from '../stores/index';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\n/**\n * Service which is wrapping the configuration logic of TranslateService from ngx-translate\n * Any application willing to use localization just needs to inject LocalizationService\n * in the root component and call its configure() method.\n */\n@Injectable()\nexport class LocalizationService {\n\n private readonly localeSplitIdentifier: string = '-';\n\n /**\n * Internal subject that we use to track changes between keys only and translation mode\n */\n private _showKeys$ = new BehaviorSubject(false);\n\n /**\n * Map of localization keys to replace a key to another\n */\n private keyMapping$?: Observable<Record<string, any | undefined>>;\n\n /**\n * _showKeys$ exposed as an Observable\n */\n public showKeys$ = this._showKeys$.asObservable();\n\n constructor(\n private translateService: TranslateService,\n private logger: LoggerService,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private configuration: LocalizationConfiguration,\n @Optional() private store?: Store<LocalizationOverrideStore>) {\n this.configure();\n if (this.store) {\n this.keyMapping$ = this.store.pipe(\n select(selectLocalizationOverride)\n );\n }\n }\n\n /**\n * This will handle the fallback language hierarchy to find out fallback language.\n * supportedLocales language has highest priority, next priority goes to fallbackLocalesMap and default would be\n * fallbackLanguage.\n *\n * @param language Selected language.\n * @returns selected language if supported, fallback language otherwise.\n */\n private checkFallbackLocalesMap<T extends string | undefined>(language: T) {\n if (language && this.configuration.supportedLocales.indexOf(language) === -1) {\n const closestSupportedLanguageCode = this.getFirstClosestSupportedLanguageCode(language);\n const fallbackForLanguage = this.getFallbackMapLangCode(language);\n const fallbackStrategyDebug = fallbackForLanguage && ' associated fallback language ' ||\n closestSupportedLanguageCode && ' closest supported language ' ||\n this.configuration.fallbackLanguage && ' configured default language ';\n const fallbackLang = fallbackForLanguage || closestSupportedLanguageCode || this.configuration.fallbackLanguage || language;\n if (language !== fallbackLang) {\n this.logger.debug(`Non supported languages ${language} will fallback to ${fallbackStrategyDebug} ${fallbackLang}`);\n }\n return fallbackLang;\n } else if (!language) {\n this.logger.debug('Language is not defined');\n }\n return language;\n }\n\n /**\n * This function checks if fallback language can be provided from fallbackLocalesMap.\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR'], fallbackLocalesMap: {'en-CA': 'en-US', 'de': 'fr-FR'}\n * translate to en-CA -> fallback to en-US, translate to de-DE -> fallback to fr-FR\n * translate to en-NZ -> fallback to en-GB\n *\n * @param language Selected language.\n * @returns Fallback language if available, undefined otherwise.\n */\n private getFallbackMapLangCode(language: string): string | undefined {\n const fallbackLocalesMap = this.configuration.fallbackLocalesMap;\n const [locale] = language.split(this.localeSplitIdentifier);\n\n return fallbackLocalesMap && (fallbackLocalesMap[language] || fallbackLocalesMap[locale]);\n\n }\n\n /**\n * This function checks if closest supported language available incase of selected language is not\n * supported language.\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR']\n * translate to en-CA -> fallback to en-GB\n *\n * @param language Selected language.\n * @returns Closest supported language if available, undefined otherwise.\n */\n private getFirstClosestSupportedLanguageCode(language: string): string | undefined {\n\n const [locale] = language.split(this.localeSplitIdentifier);\n const firstClosestRegx = new RegExp(`^${locale}${this.localeSplitIdentifier}?`, 'i');\n\n return this.configuration.supportedLocales.find((supportedLang) => firstClosestRegx.test(supportedLang));\n }\n\n /**\n * Returns a stream of translated values of a key which updates whenever the language changes.\n *\n * @param translationKey Key to translate\n * @param interpolateParams Object to use in translation binding\n * @returns A stream of the translated key\n */\n private getTranslationStream(translationKey: string, interpolateParams?: object) {\n const translation$ = this.translateService.stream(translationKey, interpolateParams).pipe(\n map((value: string) => this.configuration.debugMode ? `${translationKey} - ${value}` : value)\n );\n\n if (!this.configuration.enableTranslationDeactivation) {\n return translation$;\n }\n\n return combineLatest([\n translation$,\n this.showKeys$\n ]).pipe(\n map(([value, showKeys]) => showKeys ? translationKey : value)\n );\n }\n\n /**\n * Configures TranslateService and registers locales. This method is called from the application level.\n */\n public configure() {\n const language = this.checkFallbackLocalesMap(this.configuration.language || this.configuration.fallbackLanguage);\n this.translateService.addLangs(this.configuration.supportedLocales);\n this.translateService.setDefaultLang(language);\n this.useLanguage(language);\n }\n\n /**\n * Wrapper to call the ngx-translate service TranslateService method getLangs().\n */\n public getLanguages() {\n return this.translateService.getLangs();\n }\n\n /**\n * Wrapper to call the ngx-translate service TranslateService method use(language).\n *\n * @param language\n */\n public useLanguage(language: string): Observable<any> {\n\n language = this.checkFallbackLocalesMap(language);\n return this.translateService.use(language);\n }\n\n /**\n * Wrapper to get the ngx-translate service TranslateService currentLang.\n */\n public getCurrentLanguage() {\n return this.translateService.currentLang;\n }\n\n /**\n * Get the instance of the ngx-translate TranslateService used by LocalizationService.\n */\n public getTranslateService() {\n return this.translateService;\n }\n\n /**\n * Toggle the ShowKeys mode between active and inactive.\n *\n * @param value if specified, set the ShowKeys mode to value. If not specified, toggle the ShowKeys mode.\n */\n public toggleShowKeys(value?: boolean) {\n if (!this.configuration.enableTranslationDeactivation) {\n throw new Error('Translation deactivation is not enabled. Please set the LocalizationConfiguration property \"enableTranslationDeactivation\" accordingly.');\n }\n const newValue = value !== undefined ? value : !this.showKeys;\n this._showKeys$.next(newValue);\n }\n\n /**\n * Return the current value of debug show/hide translation keys.\n */\n public get showKeys() {\n return this._showKeys$.value;\n }\n\n /**\n * Get an observable of translation key after global mapping\n *\n * @param requestedKey Original translation key\n */\n public getKey(requestedKey: string) {\n if (this.keyMapping$) {\n return this.keyMapping$.pipe(\n map((keyMapping) => keyMapping && keyMapping[requestedKey] || requestedKey),\n distinctUntilChanged()\n );\n } else {\n return of(requestedKey);\n }\n }\n\n /**\n * Returns a stream of translated values of a key which updates whenever the language changes.\n *\n * @param key Key to translate\n * @param interpolateParams Object to use in translation binding\n * @returns A stream of the translated key\n */\n public translate(key: string, interpolateParams?: object) {\n return this.getKey(key).pipe(\n switchMap((translationKey) => this.getTranslationStream(translationKey, interpolateParams)),\n shareReplay(1)\n );\n }\n}\n","import { ChangeDetectorRef, Directive, ElementRef, Inject, Input } from '@angular/core';\nimport { TranslateDirective, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n/**\n * TranslateDirective class adding debug functionality\n */\n@Directive({\n selector: '[translate],[ngx-translate]'\n})\nexport class LocalizationTranslateDirective extends TranslateDirective {\n /**\n * Internal subscription to the LocalizationService showKeys mode changes\n */\n private onShowKeysChange?: Subscription;\n\n /**\n * Should we display keys instead of translations\n */\n private showKeys = false;\n\n /**\n * Internal subscription to the LocalizationService key mapping\n */\n private onKeyChange?: Subscription;\n\n /** @inheritdoc */\n @Input()\n public set translate(key: string) {\n if (key && key !== this.key) {\n if (this.onKeyChange) {\n this.onKeyChange.unsubscribe();\n }\n this.onKeyChange = this.localizationService.getKey(key).subscribe((newKey) => {\n this.key = newKey;\n this.checkNodes();\n });\n }\n }\n\n constructor(private localizationService: LocalizationService, translateService: TranslateService, element: ElementRef, _ref: ChangeDetectorRef,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfig: LocalizationConfiguration) {\n super(translateService, element, _ref);\n\n if (localizationConfig.enableTranslationDeactivation) {\n this.onShowKeysChange = localizationService.showKeys$.subscribe((showKeys) => {\n this.showKeys = showKeys;\n this.checkNodes(true);\n });\n }\n }\n\n /**\n * Overriding parent's setContent to plug debugging feature\n *\n * @param node\n * @param content\n */\n public setContent(node: any, content: string): void {\n const key = node.originalContent;\n const newContent = this.showKeys ? key : this.localizationConfig.debugMode && key ? `${key as string} - ${content}` : content;\n if (typeof node.textContent !== 'undefined' && node.textContent !== null) {\n node.textContent = newContent;\n } else {\n node.data = newContent;\n }\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n if (this.onShowKeysChange) {\n this.onShowKeysChange.unsubscribe();\n }\n if (this.onKeyChange) {\n this.onKeyChange?.unsubscribe();\n }\n }\n}\n","import { ChangeDetectorRef, Inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n/**\n * TranslatePipe class adding debug functionality\n */\n@Pipe({name: 'translate', pure: false})\nexport class LocalizationTranslatePipe extends TranslatePipe implements PipeTransform {\n /**\n * Internal subscription to the LocalizationService showKeys mode changes\n */\n private onShowKeysChange?: Subscription;\n\n /**\n * Internal subscription to the LocalizationService key mapping\n */\n private onKeyChange?: Subscription;\n\n /**\n * Should we display keys instead of translations\n */\n private showKeys = false;\n\n /** last key queried */\n private lastQueryKey?: string;\n\n /** last key resolved */\n private lastResolvedKey?: string;\n\n constructor(private localizationService: LocalizationService, translateService: TranslateService, private changeDetector: ChangeDetectorRef,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfig: LocalizationConfiguration) {\n super(translateService, changeDetector);\n\n if (localizationConfig.enableTranslationDeactivation) {\n this.onShowKeysChange = this.localizationService.showKeys$.subscribe((showKeys) => {\n this.showKeys = showKeys;\n this.changeDetector.markForCheck();\n });\n }\n }\n\n /**\n * Calls original transform method and eventually outputs the key if debugMode (in LocalizationConfiguration) is enabled\n *\n * @inheritdoc\n */\n public transform(query: string, ...args: any[]): any {\n if (this.showKeys) {\n return query;\n }\n\n if (query !== this.lastQueryKey) {\n this.lastQueryKey = query;\n if (this.onKeyChange) {\n this.onKeyChange.unsubscribe();\n }\n this.onKeyChange = this.localizationService.getKey(query).subscribe((key) => {\n this.lastResolvedKey = key;\n this.changeDetector.markForCheck();\n });\n\n }\n\n if (this.lastResolvedKey) {\n const value = super.transform(this.lastResolvedKey, ...args);\n\n if (this.localizationConfig.debugMode) {\n return `${this.lastResolvedKey} - ${value as string}`;\n }\n\n return value;\n }\n\n return this.value;\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n if (this.onShowKeysChange) {\n this.onShowKeysChange.unsubscribe();\n }\n }\n}\n","import {CurrencyPipe} from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular CurrencyPipe taking the current lang into consideration\n */\n@Pipe({\n name: 'currency',\n pure: false\n})\nexport class LocalizedCurrencyPipe extends CurrencyPipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: number | string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;\n public transform(value: null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): null;\n public transform(\n // Expose same signatures as angular CurencyPipe\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;\n public transform(\n value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null {\n return super.transform(value, currencyCode, display, digitsInfo, locale || this.localizationService.getCurrentLanguage());\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import {DatePipe} from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular DatePipe taking the current lang into consideration\n */\n@Pipe({\n name: 'date',\n pure: false\n})\nexport class LocalizedDatePipe extends DatePipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string\n | null;\n public transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;\n public transform(\n value: Date | string | number | null | undefined, format?: string, timezone?: string,\n locale?: string): string | null;\n public transform(\n value: Date | string | number | null | undefined, format = 'mediumDate', timezone?: string,\n locale?: string): string | null {\n if (this.localizationService.showKeys) {\n return format;\n } else {\n return super.transform(value, format, timezone, locale || this.localizationService.getCurrentLanguage());\n }\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import { DecimalPipe } from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular DecimalPipe taking the current lang into consideration\n */\n@Pipe({\n name: 'decimal',\n pure: false\n})\nexport class LocalizedDecimalPipe extends DecimalPipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: number | string, digitsInfo?: string, locale?: string): string | null;\n public transform(value: null | undefined, digitsInfo?: string, locale?: string): null;\n public transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null {\n return super.transform(value, digitsInfo, locale || this.localizationService.getCurrentLanguage());\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import { Directionality } from '@angular/cdk/bidi';\nimport { Inject, Injectable, Renderer2, RendererFactory2 } from '@angular/core';\nimport { LangChangeEvent, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\n/**\n * Service for handling the text direction based on the LocalizationConfiguration\n */\n@Injectable()\nexport class TextDirectionService {\n private subscription?: Subscription;\n private renderer: Renderer2;\n\n constructor(\n private translateService: TranslateService,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private configuration: LocalizationConfiguration,\n private rendererFactory: RendererFactory2,\n private directionality: Directionality) {\n this.renderer = this.rendererFactory.createRenderer(null, null);\n }\n\n /**\n * Updates the dir attribute on body HTML tag.\n *\n * @returns a subscription that updates the dir attribute\n */\n public onLangChangeSubscription() {\n if (this.subscription && !this.subscription.closed) {\n return this.subscription;\n }\n this.subscription = this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {\n const direction = this.configuration.rtlLanguages.indexOf(event.lang.split('-')[0]) > -1 ? 'rtl' : 'ltr';\n this.renderer.setAttribute(document.body, 'dir', direction);\n this.directionality.change.emit(direction);\n });\n return this.subscription;\n }\n}\n","import { DIR_DOCUMENT, Direction, Directionality } from '@angular/cdk/bidi';\n\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { startWith } from 'rxjs/operators';\n\n@Injectable()\nexport class TextDirectionality extends Directionality {\n /**\n * The current 'ltr' or 'rtl' value.\n *\n * @override\n */\n public value!: Direction;\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n super(_document);\n this.change\n .pipe(startWith(this.value))\n .subscribe((value: Direction) => this.value = value);\n }\n\n public ngOnDestroy() {\n this.change.complete();\n }\n}\n","import { BidiModule, Directionality } from '@angular/cdk/bidi';\nimport { CommonModule, CurrencyPipe, DatePipe, DecimalPipe } from '@angular/common';\nimport { InjectionToken, LOCALE_ID, ModuleWithProviders, NgModule, Optional } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { DynamicContentModule } from '@o3r/dynamic-content';\nimport { DEFAULT_LOCALIZATION_CONFIGURATION, LocalizationConfiguration } from '../core';\nimport { LocalizationTranslateDirective } from './localization-translate.directive';\nimport { LocalizationTranslatePipe } from './localization-translate.pipe';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\nimport { LocalizedCurrencyPipe } from './localized-currency.pipe';\nimport { LocalizedDatePipe } from './localized-date.pipe';\nimport { LocalizedDecimalPipe } from './localized-decimal.pipe';\nimport { TextDirectionService } from './text-direction.service';\nimport { TextDirectionality } from './text-directionality.service';\n\n/**\n * creates LocalizationConfiguration, which is used if the application\n *\n * @param configuration Localization configuration\n */\nexport function createLocalizationConfiguration(configuration?: Partial<LocalizationConfiguration>): LocalizationConfiguration {\n return {\n ...DEFAULT_LOCALIZATION_CONFIGURATION,\n ...(configuration || {})\n };\n}\n\n/**\n * Factory to inject the LOCALE_ID token with the current language into Angular context\n *\n * @param localizationService Localization service\n */\nexport function localeIdNgBridge(localizationService: LocalizationService) {\n return localizationService.getCurrentLanguage();\n}\n\n/** Custom Localization Configuration Token to override default localization configuration */\nexport const CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN = new InjectionToken<Partial<LocalizationConfiguration>>('Partial Localization configuration');\n\n@NgModule({\n declarations: [LocalizationTranslatePipe, LocalizationTranslateDirective, LocalizedDatePipe, LocalizedDecimalPipe, LocalizedCurrencyPipe],\n imports: [TranslateModule, BidiModule, DynamicContentModule, CommonModule],\n exports: [TranslateModule, LocalizationTranslatePipe, LocalizationTranslateDirective, LocalizedDatePipe, LocalizedDecimalPipe, LocalizedCurrencyPipe],\n providers: [\n {provide: LOCALIZATION_CONFIGURATION_TOKEN, useFactory: createLocalizationConfiguration, deps: [[new Optional(), CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN]]},\n {provide: LOCALE_ID, useFactory: localeIdNgBridge, deps: [LocalizationService]},\n {provide: Directionality, useClass: TextDirectionality},\n {provide: DatePipe, useClass: LocalizedDatePipe},\n {provide: DecimalPipe, useClass: LocalizedDecimalPipe},\n {provide: CurrencyPipe, useClass: LocalizedCurrencyPipe},\n TextDirectionService\n ]\n})\nexport class LocalizationModule {\n /**\n * forRoot method should be called only once from the application index.ts\n * It will do several things:\n * - provide the configuration for the whole application\n * - register all locales specified in the LocalizationConfiguration\n * - configure TranslateService\n * - inject LOCALE_ID token\n *\n * @param configuration LocalizationConfiguration\n */\n public static forRoot(\n configuration?: () => Partial<LocalizationConfiguration>\n ): ModuleWithProviders<LocalizationModule> {\n return {\n ngModule: LocalizationModule,\n providers: [\n LocalizationService,\n ...(configuration ? [{\n provide: CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN,\n useFactory: configuration\n }] : [])\n ]\n };\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { TranslateLoader } from '@ngx-translate/core';\n\nimport { LocalizationConfiguration } from '../core';\n\nimport { combineLatest, from, Observable, of } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\n\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\nimport { DynamicContentService } from '@o3r/dynamic-content';\nimport { LoggerService } from '@o3r/logger';\n\nconst JSON_EXT = '.json';\n\n/**\n * This class is responsible for loading translation bundles from remote or local endpoints depending on the LocalizationConfiguration.\n * Fallback mechanism ensures that if a bundle in some language cannot be fetched remotely\n * we try to fetch the same language bundle locally (bundles stored inside the application)\n * and finally load the fallback language bundle (if all previous fetches failed)\n */\n@Injectable()\nexport class TranslationsLoader implements TranslateLoader {\n constructor(@Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfiguration: LocalizationConfiguration,\n @Optional() private readonly logger?: LoggerService,\n @Optional() private dynamicContentService?: DynamicContentService) {}\n\n /**\n * Download a language bundle file\n *\n * @param url Url to the bundle file\n */\n private downloadLanguageBundle$(url: string) {\n const queryParams = this.localizationConfiguration.queryParams;\n\n let queryString = '';\n if (queryParams) {\n queryString = '?' + Object.keys(queryParams).map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key])).join('&');\n }\n return from(fetch(url + queryString, this.localizationConfiguration.fetchOptions)).pipe(\n switchMap((response) => from(response.json()))\n );\n }\n\n /**\n * @inheritdoc\n */\n public getTranslation(lang: string): Observable<any> {\n const fallback = this.localizationConfiguration.fallbackLanguage;\n let localizationPath$ = of(this.localizationConfiguration.endPointUrl);\n\n if (this.localizationConfiguration.useDynamicContent) {\n if (!this.dynamicContentService) {\n throw Error('Dynamic Content is not available. Please verify you have imported the module DynamicContentModule in your application');\n }\n localizationPath$ = this.dynamicContentService.getContentPathStream(this.localizationConfiguration.endPointUrl);\n }\n\n return localizationPath$.pipe(\n switchMap((localizationPath: string) => {\n if (localizationPath) {\n\n const localizationBundle$ = this.downloadLanguageBundle$(localizationPath + lang + JSON_EXT);\n\n if (this.localizationConfiguration.mergeWithLocalTranslations) {\n return combineLatest([\n localizationBundle$.pipe(catchError(() => of({}))),\n this.getTranslationFromLocal(lang, fallback).pipe(\n map((translations) => {\n Object.keys(translations).forEach((key) => translations[key] = `[local] ${translations[key] as string}`);\n return translations;\n })\n )\n ]).pipe(map(([dynamicTranslations, localTranslations]) => ({...localTranslations, ...dynamicTranslations})));\n }\n\n /*\n * if endPointUrl is specified by the configuration then:\n * 1. try to load lang from endPointUrl\n * 2. if 1 fails then try to load from the app (local file)\n */\n return localizationBundle$.pipe(\n catchError(() => {\n this.logger?.warn(`Failed to load the localization resource from ${localizationPath + lang + JSON_EXT}, trying from the application resources`);\n return this.getTranslationFromLocal(lang, fallback);\n })\n );\n }\n /*\n * else if endPointUrl NOT specified by then configuration then:\n * 1. try to load from the app (local file)\n */\n this.logger?.warn('No localization endpoint specified, localization fetch from application resources');\n return this.getTranslationFromLocal(lang, fallback);\n })\n );\n }\n\n /**\n *\n * Fetches localization bundles from published folder (internal to application)\n *\n * 1. try to load lang from local\n * 2. if 1 fails try to load fallback lang but only if it's different from lang in 1\n *\n * @param lang - language of the bundle\n * @param fallbackLanguage - fallback language in case bundle in language not found\n */\n public getTranslationFromLocal(lang: string, fallbackLanguage: string): Observable<any> {\n const pathPrefix: string = this.localizationConfiguration.bundlesOutputPath;\n return this.downloadLanguageBundle$(pathPrefix + lang + JSON_EXT).pipe(\n catchError(() => {\n if (lang !== fallbackLanguage) {\n this.logger?.warn(`Failed to load ${lang} from ${pathPrefix + lang + JSON_EXT}. Application will fallback to ${fallbackLanguage}`);\n return this.downloadLanguageBundle$(pathPrefix + fallbackLanguage + JSON_EXT).pipe(\n catchError(() => of({}))\n );\n } else {\n this.logger?.warn(`Failed to load ${lang} from ${pathPrefix + lang + JSON_EXT}.`);\n return of({});\n }\n })\n );\n }\n}\n","import { FactoryProvider, Optional } from '@angular/core';\nimport { TranslateLoader } from '@ngx-translate/core';\nimport { DynamicContentService } from '@o3r/dynamic-content';\nimport { LoggerService } from '@o3r/logger';\nimport { LocalizationConfiguration } from '../core';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\nimport { TranslationsLoader } from './translations-loader';\n\n/**\n * Creates a loader of translations bundles based on the configuration\n * (endPointUrl and language determine which bundle we load and where do we fetch it from)\n *\n * @param localizationConfiguration\n * @param logger service to handle the log of warning and errors\n * @param dynamicContentService (optional)\n */\nexport function createTranslateLoader(localizationConfiguration: LocalizationConfiguration, logger?: LoggerService, dynamicContentService?: DynamicContentService) {\n return new TranslationsLoader(localizationConfiguration, logger, dynamicContentService);\n}\n\n/**\n * TranslateLoader provider, using framework's TranslationsLoader class\n */\nexport const translateLoaderProvider: FactoryProvider = {\n provide: TranslateLoader,\n useFactory: createTranslateLoader,\n deps: [LOCALIZATION_CONFIGURATION_TOKEN, [new Optional(), LoggerService], [new Optional(), DynamicContentService]]\n};\n","import { Injectable } from '@angular/core';\nimport { LocalizationService } from '../tools';\n\n@Injectable()\nexport class OtterLocalizationDevtools {\n\n constructor(private localizationService: LocalizationService) {\n }\n\n /**\n * Show localization keys\n *\n * @param value value enforced by the DevTools extension\n */\n public showLocalizationKeys(value?: boolean): void {\n this.localizationService.toggleShowKeys(value);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\n\nexport const OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS: LocalizationDevtoolsServiceOptions = {\n isActivatedOnBootstrap: false\n};\n\nexport const OTTER_LOCALIZATION_DEVTOOLS_OPTIONS: InjectionToken<LocalizationDevtoolsServiceOptions> = new InjectionToken<LocalizationDevtoolsServiceOptions>('Otter Localization Devtools options');\n","/* eslint-disable no-console */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport type { DevtoolsServiceInterface, WindowWithDevtools } from '@o3r/core';\nimport { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\n@Injectable()\nexport class LocalizationDevtoolsConsoleService implements DevtoolsServiceInterface {\n\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'localization';\n\n constructor(\n private readonly localizationDevtools: OtterLocalizationDevtools,\n @Optional() @Inject(OTTER_LOCALIZATION_DEVTOOLS_OPTIONS) private options: LocalizationDevtoolsServiceOptions = OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS\n ) {\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_[LocalizationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter localization Devtools is now accessible via the _OTTER_DEVTOOLS_.${LocalizationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /**\n * Show localization keys\n *\n * @param value value enforced by the DevTools extension\n */\n public showLocalizationKeys(value?: boolean): void {\n this.localizationDevtools.showLocalizationKeys(value);\n }\n}\n","import { Inject, Injectable, OnDestroy, Optional } from '@angular/core';\nimport { filterMessageContent } from '@o3r/core';\nimport { LoggerService } from '@o3r/logger';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { AvailableLocalizationMessageContents, LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\nconst isLocalizationMessage = (message: any): message is AvailableLocalizationMessageContents => {\n return message && message.dataType === 'displayLocalizationKeys';\n};\n\n@Injectable()\nexport class LocalizationDevtoolsMessageService implements OnDestroy {\n\n private subscriptions = new Subscription();\n\n constructor(\n private logger: LoggerService,\n private localizationDevTools: OtterLocalizationDevtools,\n @Optional() @Inject(OTTER_LOCALIZATION_DEVTOOLS_OPTIONS) private options: LocalizationDevtoolsServiceOptions = OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS) {\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n *\n * @param event Event coming from the Otter Chrome DevTools extension\n * @param message\n */\n private handleEvents(message: AvailableLocalizationMessageContents) {\n this.logger.debug('Message handling by the localization service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'displayLocalizationKeys': {\n this.localizationDevTools.showLocalizationKeys(message.toggle);\n break;\n }\n default: {\n this.logger.warn('Message ignored by the localization service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter Chrome DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to localization service of the application');\n }\n\n /** @inheritDoc */\n public activate() {\n this.subscriptions.add(\n fromEvent(window, 'message').pipe(filterMessageContent(isLocalizationMessage)).subscribe((e) => this.handleEvents(e))\n );\n }\n\n /** @inheritDoc */\n public ngOnDestroy() {\n this.subscriptions.unsubscribe();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { LocalizationModule } from '../tools/index';\nimport type { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { LocalizationDevtoolsConsoleService } from './localization-devtools.console.service';\nimport { LocalizationDevtoolsMessageService } from './localization-devtools.message.service';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\n@NgModule({\n imports: [\n LocalizationModule\n ],\n providers: [\n { provide: OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, useValue: OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS },\n LocalizationDevtoolsMessageService,\n LocalizationDevtoolsConsoleService,\n OtterLocalizationDevtools\n ]\n})\nexport class LocalizationDevtoolsModule {\n\n /**\n * Initialize Otter Devtools\n *\n * @param options\n */\n public static instrument(options: Partial<LocalizationDevtoolsServiceOptions>): ModuleWithProviders<LocalizationDevtoolsModule> {\n return {\n ngModule: LocalizationDevtoolsModule,\n providers: [\n { provide: OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n LocalizationDevtoolsMessageService,\n LocalizationDevtoolsConsoleService,\n OtterLocalizationDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["actions.setLocalizationOverride","i1","i1.LocalizationService","i2"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;;;;AAIG;AACH;AACM,SAAU,YAAY,CAAC,IAAY,EAAA;AACvC,IAAA,OAAO,CAAC,MAAW,EAAE,GAAW,KAAI;AAClC,QAAA,MAAM,YAAY,GAAG,IAAI,IAAI,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AACvC,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEjC,QAAA,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;AACjC,gBAAA,GAAG,EAAE,YAAA;AACH,oBAAA,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;iBAC3B;gBACD,GAAG,EAAE,UAAqB,KAA8B,EAAA;oBACtD,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC;oBACxD,IAAI,CAAC,YAAY,CAAC,GAAG,OAAO,YAAY,KAAK,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACrH,oBAAA,IAAI,IAAI,CAAC,8BAA8B,CAAC,EAAE;wBACxC,IAAI,CAAC,8BAA8B,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;AACxE,qBAAA;iBACF;AACD,gBAAA,UAAU,EAAE,IAAI;AAChB,gBAAA,YAAY,EAAE,IAAI;AACnB,aAAA,CAAC,CAAC;AACJ,SAAA;AACH,KAAC,CAAC;AACJ;;AC5BA;;;;;;AAMG;AACH;AACM,SAAU,UAAU,CAAC,gBAAyB,EAAA;AAClD,IAAA,OAAO,CAAC,MAAW,EAAE,GAAW,KAAI;AAClC,QAAA,MAAM,YAAY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AAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YATnC,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;AAST,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,EAP1B,SAAA,EAAA;AACT,YAAA,EAAE,OAAO,EAAE,mCAAmC,EAAE,QAAQ,EAAE,2CAA2C,EAAE;YACvG,kCAAkC;YAClC,kCAAkC;YAClC,yBAAyB;AAC1B,SAAA,EAAA,OAAA,EAAA,CAPC,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAST,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAXtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,mCAAmC,EAAE,QAAQ,EAAE,2CAA2C,EAAE;wBACvG,kCAAkC;wBAClC,kCAAkC;wBAClC,yBAAyB;AAC1B,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"o3r-localization.mjs","sources":["../../src/annotations/localization.ts","../../src/core/localization.configuration.ts","../../src/core/translate-messageformat-lazy.compiler.ts","../../src/stores/localization-override/localization-override.actions.ts","../../src/stores/localization-override/localization-override.reducer.ts","../../src/stores/localization-override/localization-override.state.ts","../../src/stores/localization-override/localization-override.module.ts","../../src/stores/localization-override/localization-override.selectors.ts","../../src/stores/localization-override/localization-override.sync.ts","../../src/tools/localization.token.ts","../../src/tools/localization.service.ts","../../src/tools/localization-translate.directive.ts","../../src/tools/localization-translate.pipe.ts","../../src/tools/localized-currency.pipe.ts","../../src/tools/localized-date.pipe.ts","../../src/tools/localized-decimal.pipe.ts","../../src/tools/text-direction.service.ts","../../src/tools/text-directionality.service.ts","../../src/tools/localization.module.ts","../../src/tools/translations-loader.ts","../../src/tools/localization.provider.ts","../../src/devkit/localization-devtools.service.ts","../../src/devkit/localization-devtools.token.ts","../../src/devkit/localization-devtools.console.service.ts","../../src/devkit/localization-devtools.message.service.ts","../../src/devkit/localization-devtools.module.ts","../../src/o3r-localization.ts"],"sourcesContent":["import { deepFill, immutablePrimitive, otterComponentInfoPropertyName } from '@o3r/core';\n\n/**\n * Decorator to pass localization url\n *\n * @param _url\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function Localization(_url: string) {\n return (target: any, key: string) => {\n const privateField = _url || `_${key}`;\n const privateValue = target[key];\n\n if (delete target[key]) {\n Object.defineProperty(target, key, {\n get: function (this: any) {\n return this[privateField];\n },\n set: function (this: any, value: Record<string, unknown>) {\n const currentField = this[privateField] || privateValue;\n this[privateField] = typeof currentField === 'undefined' ? immutablePrimitive(value) : deepFill(currentField, value);\n if (this[otterComponentInfoPropertyName]) {\n this[otterComponentInfoPropertyName].translations = this[privateField];\n }\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n}\n","/**\n * Describes configuration for LocalizationModule\n */\nexport interface LocalizationConfiguration {\n /** List of available languages */\n supportedLocales: string[];\n /** Application display language */\n language?: string;\n /** Url to fetch translation bundles from */\n endPointUrl: string;\n /** Prefix endPoinrUrl with dynamicContentPath provided by DynamicContentPath */\n useDynamicContent: boolean;\n /** List of RTL language codes */\n rtlLanguages: string[];\n /**\n * Fallback language map of resource in case translation in language does not exist.\n * translate to unsupported language will try to map to supportedLocales from below property.\n *\n * @example\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR'], fallbackLocalesMap: {'en-CA': 'en-US', 'de': 'fr-FR'}\n * translate to en-CA -> fallback to en-US, translate to de-DE -> fallback to fr-FR,\n * translate to en-NZ -> fallback to en-GB, translate to en -> fallback to en-GB.\n */\n fallbackLocalesMap?: {\n [supportedLocale: string]: string;\n };\n /** Fallback language of resource in case translation in language does not exist */\n fallbackLanguage: string;\n /** Path relative to published folder where webpack will copy translation bundles */\n bundlesOutputPath: string;\n /** Debug mode switch */\n debugMode: boolean;\n /** Query parameters for fetching the localization resources */\n queryParams?: {[key: string]: string};\n /** Fetch options object as per https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters */\n fetchOptions?: RequestInit;\n /** Enable the ability to switch the translations on and off at runtime. */\n enableTranslationDeactivation: boolean;\n /**\n * Merge the translations from DynamicContentPath with the local translations\n * Warning: Enable this option will download two localization bundles and can delay the display of the text on application first page\n *\n * @default false\n */\n mergeWithLocalTranslations: boolean;\n}\n\n/**\n * Default configuration for LocalizationModule\n */\nexport const DEFAULT_LOCALIZATION_CONFIGURATION: LocalizationConfiguration = {\n supportedLocales: [],\n endPointUrl: '',\n useDynamicContent: false,\n rtlLanguages: ['ar', 'he'],\n fallbackLanguage: 'en',\n bundlesOutputPath: '',\n debugMode: false,\n enableTranslationDeactivation: false,\n mergeWithLocalTranslations: false\n};\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { TranslateCompiler } from '@ngx-translate/core';\nimport { IntlMessageFormat, Options } from 'intl-messageformat';\n\n/**\n * Options for Lazy Message Format compiler\n */\nexport interface LazyMessageFormatConfig extends Options {\n /**\n * Enables compiled translation caching\n *\n * @default true\n */\n enableCache?: boolean;\n\n /**\n * Enables HTML in translation\n *\n * @default true\n */\n ignoreTag?: boolean;\n}\n\n/**\n * Message format configuration default value\n */\nexport const lazyMessageDefaultConfig: LazyMessageFormatConfig = {\n enableCache: true,\n ignoreTag: true\n};\n\n/** Message Format configuration Token */\nexport const MESSAGE_FORMAT_CONFIG = new InjectionToken<LazyMessageFormatConfig>('Message Format configuration');\n\n/**\n * This compiler expects ICU syntax and compiles the expressions with messageformat.js\n * Compare to ngx-translate-messageformat-compiler package, the compilation of the translation is done only on demand\n */\n@Injectable()\nexport class TranslateMessageFormatLazyCompiler extends TranslateCompiler {\n\n /** Configuration */\n private config: LazyMessageFormatConfig;\n\n /** Cache of compiled translations */\n private cache: { [x: string]: IntlMessageFormat } = {};\n\n constructor(@Optional() @Inject(MESSAGE_FORMAT_CONFIG) config?: LazyMessageFormatConfig) {\n super();\n\n this.config = config ? { ...lazyMessageDefaultConfig, ...config } : lazyMessageDefaultConfig;\n }\n\n /**\n * Clear the cache of the compiled translations\n */\n public clearCache() {\n this.cache = {};\n }\n\n /** @inheritDoc */\n public compile(value: string, lang: string): (params: any) => string {\n return (params: any) => (new IntlMessageFormat(value, lang, undefined, this.config).format(params) as string);\n }\n\n /** @inheritDoc */\n public compileTranslations(translations: {[x: string]: any}, lang: string) {\n type CompiledTranslationMap = {[key in keyof typeof translations]: (params: any) => string};\n\n const compilingStrategy = this.config.enableCache ?\n (acc: CompiledTranslationMap, key: string) => {\n acc[key] = (params: any) => {\n const cached = this.cache[`${lang}_${key}`];\n if (cached) {\n return cached.format(params) as string;\n }\n\n const newCachedItem = new IntlMessageFormat(translations[key], lang, undefined, this.config);\n this.cache[`${lang}_${key}`] = newCachedItem;\n return newCachedItem.format(params) as string;\n };\n return acc;\n } :\n\n (acc: CompiledTranslationMap, key: string) => {\n acc[key] = (params: any) => new IntlMessageFormat(translations[key], lang, undefined, this.config).format(params) as string;\n return acc;\n };\n\n return Object.keys(translations)\n .reduce<CompiledTranslationMap>(compilingStrategy, {});\n }\n}\n","import { createAction, props } from '@ngrx/store';\nimport { SetStateActionPayload } from '@o3r/core';\nimport { LocalizationOverrideState } from './localization-override.state';\n\n/** Actions */\nconst ACTION_SET = '[LocalizationOverride] set';\n\n/**\n * Clear all overrides and fill the store with the payload\n */\nexport const setLocalizationOverride = createAction(ACTION_SET, props<SetStateActionPayload<LocalizationOverrideState>>());\n","import {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './localization-override.actions';\nimport { LocalizationOverrideState} from './localization-override.state';\n\n/**\n * LocalizationOverride Store initial value\n */\nexport const localizationOverrideInitialState: LocalizationOverrideState = {localizationOverrides: {}};\n\n/**\n * List of basic actions for LocalizationOverride Store\n */\nexport const localizationOverrideReducerFeatures: ReducerTypes<LocalizationOverrideState, ActionCreator[]>[] = [\n on(actions.setLocalizationOverride, (_state, payload) => ({...payload.state}))\n];\n\n/**\n * LocalizationOverride Store reducer\n */\nexport const localizationOverrideReducer = createReducer(\n localizationOverrideInitialState,\n ...localizationOverrideReducerFeatures\n);\n","/**\n * LocalizationOverride store state\n */\nexport interface LocalizationOverrideState {\n /** Mapping of initial localization keys to the one they are replaced with */\n localizationOverrides : Record<string,string>;\n}\n\n/**\n * Name of the LocalizationOverride Store\n */\nexport const LOCALIZATION_OVERRIDE_STORE_NAME = 'localizationOverride';\n\n/**\n * LocalizationOverride Store Interface\n */\nexport interface LocalizationOverrideStore {\n /** LocalizationOverride state */\n [LOCALIZATION_OVERRIDE_STORE_NAME]: LocalizationOverrideState;\n}\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\n\nimport { localizationOverrideReducer } from './localization-override.reducer';\nimport { LOCALIZATION_OVERRIDE_STORE_NAME, LocalizationOverrideState } from './localization-override.state';\n\n/** Token of the LocalizationOverride reducer */\nexport const LOCALIZATION_OVERRIDE_REDUCER_TOKEN = new InjectionToken<ActionReducer<LocalizationOverrideState, Action>>('Feature LocalizationOverride Reducer');\n\n/** Provide default reducer for LocalizationOverride store */\nexport function getDefaultLocalizationOverrideReducer() {\n return localizationOverrideReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(LOCALIZATION_OVERRIDE_STORE_NAME, LOCALIZATION_OVERRIDE_REDUCER_TOKEN)\n ],\n providers: [\n { provide: LOCALIZATION_OVERRIDE_REDUCER_TOKEN, useFactory: getDefaultLocalizationOverrideReducer }\n ]\n})\nexport class LocalizationOverrideStoreModule {\n public static forRoot<T extends LocalizationOverrideState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<LocalizationOverrideStoreModule> {\n return {\n ngModule: LocalizationOverrideStoreModule,\n providers: [\n { provide: LOCALIZATION_OVERRIDE_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { LOCALIZATION_OVERRIDE_STORE_NAME, LocalizationOverrideState } from './localization-override.state';\n\n/** Select LocalizationOverride State */\nexport const selectLocalizationOverrideState = createFeatureSelector<LocalizationOverrideState>(LOCALIZATION_OVERRIDE_STORE_NAME);\n\n/** Select all localization override map */\nexport const selectLocalizationOverride = createSelector(selectLocalizationOverrideState, (state) => state?.localizationOverrides || {});\n","import { Serializer } from '@o3r/core';\nimport { localizationOverrideInitialState } from './localization-override.reducer';\nimport { LocalizationOverrideState } from './localization-override.state';\n\nexport const localizationOverrideStorageDeserializer = (rawObject: any) => {\n if (!rawObject) {\n return localizationOverrideInitialState;\n }\n return rawObject;\n};\n\nexport const localizationOverrideStorageSync: Serializer<LocalizationOverrideState> = {\n deserialize: localizationOverrideStorageDeserializer\n};\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationConfiguration } from '../core';\n\n/** Localization Configuration Token */\nexport const LOCALIZATION_CONFIGURATION_TOKEN = new InjectionToken<LocalizationConfiguration>('Localization Configuration injection token');\n","/* eslint-disable @typescript-eslint/ban-types */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { TranslateService } from '@ngx-translate/core';\nimport { LoggerService } from '@o3r/logger';\nimport { BehaviorSubject, combineLatest, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay, switchMap } from 'rxjs/operators';\nimport { LocalizationConfiguration } from '../core/localization.configuration';\nimport { LocalizationOverrideStore, selectLocalizationOverride } from '../stores/index';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\n/**\n * Service which is wrapping the configuration logic of TranslateService from ngx-translate\n * Any application willing to use localization just needs to inject LocalizationService\n * in the root component and call its configure() method.\n */\n@Injectable()\nexport class LocalizationService {\n\n private readonly localeSplitIdentifier: string = '-';\n\n /**\n * Internal subject that we use to track changes between keys only and translation mode\n */\n private _showKeys$ = new BehaviorSubject(false);\n\n /**\n * Map of localization keys to replace a key to another\n */\n private keyMapping$?: Observable<Record<string, any | undefined>>;\n\n /**\n * _showKeys$ exposed as an Observable\n */\n public showKeys$ = this._showKeys$.asObservable();\n\n constructor(\n private translateService: TranslateService,\n private logger: LoggerService,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private configuration: LocalizationConfiguration,\n @Optional() private store?: Store<LocalizationOverrideStore>) {\n this.configure();\n if (this.store) {\n this.keyMapping$ = this.store.pipe(\n select(selectLocalizationOverride)\n );\n }\n }\n\n /**\n * This will handle the fallback language hierarchy to find out fallback language.\n * supportedLocales language has highest priority, next priority goes to fallbackLocalesMap and default would be\n * fallbackLanguage.\n *\n * @param language Selected language.\n * @returns selected language if supported, fallback language otherwise.\n */\n private checkFallbackLocalesMap<T extends string | undefined>(language: T) {\n if (language && this.configuration.supportedLocales.indexOf(language) === -1) {\n const closestSupportedLanguageCode = this.getFirstClosestSupportedLanguageCode(language);\n const fallbackForLanguage = this.getFallbackMapLangCode(language);\n const fallbackStrategyDebug = fallbackForLanguage && ' associated fallback language ' ||\n closestSupportedLanguageCode && ' closest supported language ' ||\n this.configuration.fallbackLanguage && ' configured default language ';\n const fallbackLang = fallbackForLanguage || closestSupportedLanguageCode || this.configuration.fallbackLanguage || language;\n if (language !== fallbackLang) {\n this.logger.debug(`Non supported languages ${language} will fallback to ${fallbackStrategyDebug} ${fallbackLang}`);\n }\n return fallbackLang;\n } else if (!language) {\n this.logger.debug('Language is not defined');\n }\n return language;\n }\n\n /**\n * This function checks if fallback language can be provided from fallbackLocalesMap.\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR'], fallbackLocalesMap: {'en-CA': 'en-US', 'de': 'fr-FR'}\n * translate to en-CA -> fallback to en-US, translate to de-DE -> fallback to fr-FR\n * translate to en-NZ -> fallback to en-GB\n *\n * @param language Selected language.\n * @returns Fallback language if available, undefined otherwise.\n */\n private getFallbackMapLangCode(language: string): string | undefined {\n const fallbackLocalesMap = this.configuration.fallbackLocalesMap;\n const [locale] = language.split(this.localeSplitIdentifier);\n\n return fallbackLocalesMap && (fallbackLocalesMap[language] || fallbackLocalesMap[locale]);\n\n }\n\n /**\n * This function checks if closest supported language available incase of selected language is not\n * supported language.\n * supportedLocales: ['en-GB', 'en-US', 'fr-FR']\n * translate to en-CA -> fallback to en-GB\n *\n * @param language Selected language.\n * @returns Closest supported language if available, undefined otherwise.\n */\n private getFirstClosestSupportedLanguageCode(language: string): string | undefined {\n\n const [locale] = language.split(this.localeSplitIdentifier);\n const firstClosestRegx = new RegExp(`^${locale}${this.localeSplitIdentifier}?`, 'i');\n\n return this.configuration.supportedLocales.find((supportedLang) => firstClosestRegx.test(supportedLang));\n }\n\n /**\n * Returns a stream of translated values of a key which updates whenever the language changes.\n *\n * @param translationKey Key to translate\n * @param interpolateParams Object to use in translation binding\n * @returns A stream of the translated key\n */\n private getTranslationStream(translationKey: string, interpolateParams?: object) {\n const translation$ = this.translateService.stream(translationKey, interpolateParams).pipe(\n map((value: string) => this.configuration.debugMode ? `${translationKey} - ${value}` : value)\n );\n\n if (!this.configuration.enableTranslationDeactivation) {\n return translation$;\n }\n\n return combineLatest([\n translation$,\n this.showKeys$\n ]).pipe(\n map(([value, showKeys]) => showKeys ? translationKey : value)\n );\n }\n\n /**\n * Configures TranslateService and registers locales. This method is called from the application level.\n */\n public configure() {\n const language = this.checkFallbackLocalesMap(this.configuration.language || this.configuration.fallbackLanguage);\n this.translateService.addLangs(this.configuration.supportedLocales);\n this.translateService.setDefaultLang(language);\n this.useLanguage(language);\n }\n\n /**\n * Wrapper to call the ngx-translate service TranslateService method getLangs().\n */\n public getLanguages() {\n return this.translateService.getLangs();\n }\n\n /**\n * Wrapper to call the ngx-translate service TranslateService method use(language).\n *\n * @param language\n */\n public useLanguage(language: string): Observable<any> {\n\n language = this.checkFallbackLocalesMap(language);\n return this.translateService.use(language);\n }\n\n /**\n * Wrapper to get the ngx-translate service TranslateService currentLang.\n */\n public getCurrentLanguage() {\n return this.translateService.currentLang;\n }\n\n /**\n * Get the instance of the ngx-translate TranslateService used by LocalizationService.\n */\n public getTranslateService() {\n return this.translateService;\n }\n\n /**\n * Toggle the ShowKeys mode between active and inactive.\n *\n * @param value if specified, set the ShowKeys mode to value. If not specified, toggle the ShowKeys mode.\n */\n public toggleShowKeys(value?: boolean) {\n if (!this.configuration.enableTranslationDeactivation) {\n throw new Error('Translation deactivation is not enabled. Please set the LocalizationConfiguration property \"enableTranslationDeactivation\" accordingly.');\n }\n const newValue = value !== undefined ? value : !this.showKeys;\n this._showKeys$.next(newValue);\n }\n\n /**\n * Return the current value of debug show/hide translation keys.\n */\n public get showKeys() {\n return this._showKeys$.value;\n }\n\n /**\n * Get an observable of translation key after global mapping\n *\n * @param requestedKey Original translation key\n */\n public getKey(requestedKey: string) {\n if (this.keyMapping$) {\n return this.keyMapping$.pipe(\n map((keyMapping) => keyMapping && keyMapping[requestedKey] || requestedKey),\n distinctUntilChanged()\n );\n } else {\n return of(requestedKey);\n }\n }\n\n /**\n * Returns a stream of translated values of a key which updates whenever the language changes.\n *\n * @param key Key to translate\n * @param interpolateParams Object to use in translation binding\n * @returns A stream of the translated key\n */\n public translate(key: string, interpolateParams?: object) {\n return this.getKey(key).pipe(\n switchMap((translationKey) => this.getTranslationStream(translationKey, interpolateParams)),\n shareReplay(1)\n );\n }\n}\n","import { ChangeDetectorRef, Directive, ElementRef, Inject, Input } from '@angular/core';\nimport { TranslateDirective, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n/**\n * TranslateDirective class adding debug functionality\n */\n@Directive({\n selector: '[translate],[ngx-translate]'\n})\nexport class LocalizationTranslateDirective extends TranslateDirective {\n /**\n * Internal subscription to the LocalizationService showKeys mode changes\n */\n private onShowKeysChange?: Subscription;\n\n /**\n * Should we display keys instead of translations\n */\n private showKeys = false;\n\n /**\n * Internal subscription to the LocalizationService key mapping\n */\n private onKeyChange?: Subscription;\n\n /** @inheritdoc */\n @Input()\n public set translate(key: string) {\n if (key && key !== this.key) {\n if (this.onKeyChange) {\n this.onKeyChange.unsubscribe();\n }\n this.onKeyChange = this.localizationService.getKey(key).subscribe((newKey) => {\n this.key = newKey;\n this.checkNodes();\n });\n }\n }\n\n constructor(private localizationService: LocalizationService, translateService: TranslateService, element: ElementRef, _ref: ChangeDetectorRef,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfig: LocalizationConfiguration) {\n super(translateService, element, _ref);\n\n if (localizationConfig.enableTranslationDeactivation) {\n this.onShowKeysChange = localizationService.showKeys$.subscribe((showKeys) => {\n this.showKeys = showKeys;\n this.checkNodes(true);\n });\n }\n }\n\n /**\n * Overriding parent's setContent to plug debugging feature\n *\n * @param node\n * @param content\n */\n public setContent(node: any, content: string): void {\n const key = node.originalContent;\n const newContent = this.showKeys ? key : this.localizationConfig.debugMode && key ? `${key as string} - ${content}` : content;\n if (typeof node.textContent !== 'undefined' && node.textContent !== null) {\n node.textContent = newContent;\n } else {\n node.data = newContent;\n }\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n if (this.onShowKeysChange) {\n this.onShowKeysChange.unsubscribe();\n }\n if (this.onKeyChange) {\n this.onKeyChange?.unsubscribe();\n }\n }\n}\n","import { ChangeDetectorRef, Inject, Pipe, PipeTransform } from '@angular/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n/**\n * TranslatePipe class adding debug functionality\n */\n@Pipe({name: 'translate', pure: false})\nexport class LocalizationTranslatePipe extends TranslatePipe implements PipeTransform {\n /**\n * Internal subscription to the LocalizationService showKeys mode changes\n */\n private onShowKeysChange?: Subscription;\n\n /**\n * Internal subscription to the LocalizationService key mapping\n */\n private onKeyChange?: Subscription;\n\n /**\n * Should we display keys instead of translations\n */\n private showKeys = false;\n\n /** last key queried */\n private lastQueryKey?: string;\n\n /** last key resolved */\n private lastResolvedKey?: string;\n\n constructor(private localizationService: LocalizationService, translateService: TranslateService, private changeDetector: ChangeDetectorRef,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfig: LocalizationConfiguration) {\n super(translateService, changeDetector);\n\n if (localizationConfig.enableTranslationDeactivation) {\n this.onShowKeysChange = this.localizationService.showKeys$.subscribe((showKeys) => {\n this.showKeys = showKeys;\n this.changeDetector.markForCheck();\n });\n }\n }\n\n /**\n * Calls original transform method and eventually outputs the key if debugMode (in LocalizationConfiguration) is enabled\n *\n * @inheritdoc\n */\n public transform(query: string, ...args: any[]): any {\n if (this.showKeys) {\n return query;\n }\n\n if (query !== this.lastQueryKey) {\n this.lastQueryKey = query;\n if (this.onKeyChange) {\n this.onKeyChange.unsubscribe();\n }\n this.onKeyChange = this.localizationService.getKey(query).subscribe((key) => {\n this.lastResolvedKey = key;\n this.changeDetector.markForCheck();\n });\n\n }\n\n if (this.lastResolvedKey) {\n const value = super.transform(this.lastResolvedKey, ...args);\n\n if (this.localizationConfig.debugMode) {\n return `${this.lastResolvedKey} - ${value as string}`;\n }\n\n return value;\n }\n\n return this.value;\n }\n\n public ngOnDestroy() {\n super.ngOnDestroy();\n if (this.onShowKeysChange) {\n this.onShowKeysChange.unsubscribe();\n }\n }\n}\n","import {CurrencyPipe} from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular CurrencyPipe taking the current lang into consideration\n */\n@Pipe({\n name: 'currency',\n pure: false\n})\nexport class LocalizedCurrencyPipe extends CurrencyPipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: number | string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;\n public transform(value: null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): null;\n public transform(\n // Expose same signatures as angular CurencyPipe\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;\n public transform(\n value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null {\n return super.transform(value, currencyCode, display, digitsInfo, locale || this.localizationService.getCurrentLanguage());\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import {DatePipe} from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular DatePipe taking the current lang into consideration\n */\n@Pipe({\n name: 'date',\n pure: false\n})\nexport class LocalizedDatePipe extends DatePipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string\n | null;\n public transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;\n public transform(\n value: Date | string | number | null | undefined, format?: string, timezone?: string,\n locale?: string): string | null;\n public transform(\n value: Date | string | number | null | undefined, format = 'mediumDate', timezone?: string,\n locale?: string): string | null {\n if (this.localizationService.showKeys) {\n return format;\n } else {\n return super.transform(value, format, timezone, locale || this.localizationService.getCurrentLanguage());\n }\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import { DecimalPipe } from '@angular/common';\nimport {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform} from '@angular/core';\nimport {Subscription} from 'rxjs';\nimport {LocalizationService} from './localization.service';\n\n/**\n * Native angular DecimalPipe taking the current lang into consideration\n */\n@Pipe({\n name: 'decimal',\n pure: false\n})\nexport class LocalizedDecimalPipe extends DecimalPipe implements OnDestroy, PipeTransform {\n private onLangChange: Subscription;\n\n constructor(private localizationService: LocalizationService, private changeDetectorRef: ChangeDetectorRef) {\n super(localizationService.getCurrentLanguage());\n this.onLangChange = this.localizationService.getTranslateService().onLangChange.subscribe(() =>\n this.changeDetectorRef.markForCheck()\n );\n }\n\n /**\n * @inheritdoc\n */\n public transform(value: number | string, digitsInfo?: string, locale?: string): string | null;\n public transform(value: null | undefined, digitsInfo?: string, locale?: string): null;\n public transform(value: number | string | null | undefined, digitsInfo?: string, locale?: string): string | null {\n return super.transform(value, digitsInfo, locale || this.localizationService.getCurrentLanguage());\n }\n\n public ngOnDestroy(): void {\n this.onLangChange.unsubscribe();\n }\n}\n","import { Directionality } from '@angular/cdk/bidi';\nimport { Inject, Injectable, Renderer2, RendererFactory2 } from '@angular/core';\nimport { LangChangeEvent, TranslateService } from '@ngx-translate/core';\nimport { Subscription } from 'rxjs';\nimport { LocalizationConfiguration } from '../core';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\n/**\n * Service for handling the text direction based on the LocalizationConfiguration\n */\n@Injectable()\nexport class TextDirectionService {\n private subscription?: Subscription;\n private renderer: Renderer2;\n\n constructor(\n private translateService: TranslateService,\n @Inject(LOCALIZATION_CONFIGURATION_TOKEN) private configuration: LocalizationConfiguration,\n private rendererFactory: RendererFactory2,\n private directionality: Directionality) {\n this.renderer = this.rendererFactory.createRenderer(null, null);\n }\n\n /**\n * Updates the dir attribute on body HTML tag.\n *\n * @returns a subscription that updates the dir attribute\n */\n public onLangChangeSubscription() {\n if (this.subscription && !this.subscription.closed) {\n return this.subscription;\n }\n this.subscription = this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {\n const direction = this.configuration.rtlLanguages.indexOf(event.lang.split('-')[0]) > -1 ? 'rtl' : 'ltr';\n this.renderer.setAttribute(document.body, 'dir', direction);\n this.directionality.change.emit(direction);\n });\n return this.subscription;\n }\n}\n","import { DIR_DOCUMENT, Direction, Directionality } from '@angular/cdk/bidi';\n\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport { startWith } from 'rxjs/operators';\n\n@Injectable()\nexport class TextDirectionality extends Directionality {\n /**\n * The current 'ltr' or 'rtl' value.\n *\n * @override\n */\n public value!: Direction;\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n super(_document);\n this.change\n .pipe(startWith(this.value))\n .subscribe((value: Direction) => this.value = value);\n }\n\n public ngOnDestroy() {\n this.change.complete();\n }\n}\n","import { BidiModule, Directionality } from '@angular/cdk/bidi';\nimport { CommonModule, CurrencyPipe, DatePipe, DecimalPipe } from '@angular/common';\nimport { InjectionToken, LOCALE_ID, ModuleWithProviders, NgModule, Optional } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { DynamicContentModule } from '@o3r/dynamic-content';\nimport { DEFAULT_LOCALIZATION_CONFIGURATION, LocalizationConfiguration } from '../core';\nimport { LocalizationTranslateDirective } from './localization-translate.directive';\nimport { LocalizationTranslatePipe } from './localization-translate.pipe';\nimport { LocalizationService } from './localization.service';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\nimport { LocalizedCurrencyPipe } from './localized-currency.pipe';\nimport { LocalizedDatePipe } from './localized-date.pipe';\nimport { LocalizedDecimalPipe } from './localized-decimal.pipe';\nimport { TextDirectionService } from './text-direction.service';\nimport { TextDirectionality } from './text-directionality.service';\n\n/**\n * creates LocalizationConfiguration, which is used if the application\n *\n * @param configuration Localization configuration\n */\nexport function createLocalizationConfiguration(configuration?: Partial<LocalizationConfiguration>): LocalizationConfiguration {\n return {\n ...DEFAULT_LOCALIZATION_CONFIGURATION,\n ...(configuration || {})\n };\n}\n\n/**\n * Factory to inject the LOCALE_ID token with the current language into Angular context\n *\n * @param localizationService Localization service\n */\nexport function localeIdNgBridge(localizationService: LocalizationService) {\n return localizationService.getCurrentLanguage();\n}\n\n/** Custom Localization Configuration Token to override default localization configuration */\nexport const CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN = new InjectionToken<Partial<LocalizationConfiguration>>('Partial Localization configuration');\n\n@NgModule({\n declarations: [LocalizationTranslatePipe, LocalizationTranslateDirective, LocalizedDatePipe, LocalizedDecimalPipe, LocalizedCurrencyPipe],\n imports: [TranslateModule, BidiModule, DynamicContentModule, CommonModule],\n exports: [TranslateModule, LocalizationTranslatePipe, LocalizationTranslateDirective, LocalizedDatePipe, LocalizedDecimalPipe, LocalizedCurrencyPipe],\n providers: [\n {provide: LOCALIZATION_CONFIGURATION_TOKEN, useFactory: createLocalizationConfiguration, deps: [[new Optional(), CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN]]},\n {provide: LOCALE_ID, useFactory: localeIdNgBridge, deps: [LocalizationService]},\n {provide: Directionality, useClass: TextDirectionality},\n {provide: DatePipe, useClass: LocalizedDatePipe},\n {provide: DecimalPipe, useClass: LocalizedDecimalPipe},\n {provide: CurrencyPipe, useClass: LocalizedCurrencyPipe},\n TextDirectionService\n ]\n})\nexport class LocalizationModule {\n /**\n * forRoot method should be called only once from the application index.ts\n * It will do several things:\n * - provide the configuration for the whole application\n * - register all locales specified in the LocalizationConfiguration\n * - configure TranslateService\n * - inject LOCALE_ID token\n *\n * @param configuration LocalizationConfiguration\n */\n public static forRoot(\n configuration?: () => Partial<LocalizationConfiguration>\n ): ModuleWithProviders<LocalizationModule> {\n return {\n ngModule: LocalizationModule,\n providers: [\n LocalizationService,\n ...(configuration ? [{\n provide: CUSTOM_LOCALIZATION_CONFIGURATION_TOKEN,\n useFactory: configuration\n }] : [])\n ]\n };\n }\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { TranslateLoader } from '@ngx-translate/core';\n\nimport { LocalizationConfiguration } from '../core';\n\nimport { combineLatest, from, Observable, of } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\n\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\n\nimport { DynamicContentService } from '@o3r/dynamic-content';\nimport { LoggerService } from '@o3r/logger';\n\nconst JSON_EXT = '.json';\n\n/**\n * This class is responsible for loading translation bundles from remote or local endpoints depending on the LocalizationConfiguration.\n * Fallback mechanism ensures that if a bundle in some language cannot be fetched remotely\n * we try to fetch the same language bundle locally (bundles stored inside the application)\n * and finally load the fallback language bundle (if all previous fetches failed)\n */\n@Injectable()\nexport class TranslationsLoader implements TranslateLoader {\n constructor(@Inject(LOCALIZATION_CONFIGURATION_TOKEN) private localizationConfiguration: LocalizationConfiguration,\n @Optional() private readonly logger?: LoggerService,\n @Optional() private dynamicContentService?: DynamicContentService) {}\n\n /**\n * Download a language bundle file\n *\n * @param url Url to the bundle file\n */\n private downloadLanguageBundle$(url: string) {\n const queryParams = this.localizationConfiguration.queryParams;\n\n let queryString = '';\n if (queryParams) {\n queryString = '?' + Object.keys(queryParams).map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key])).join('&');\n }\n return from(fetch(url + queryString, this.localizationConfiguration.fetchOptions)).pipe(\n switchMap((response) => from(response.json()))\n );\n }\n\n /**\n * @inheritdoc\n */\n public getTranslation(lang: string): Observable<any> {\n const fallback = this.localizationConfiguration.fallbackLanguage;\n let localizationPath$ = of(this.localizationConfiguration.endPointUrl);\n\n if (this.localizationConfiguration.useDynamicContent) {\n if (!this.dynamicContentService) {\n throw Error('Dynamic Content is not available. Please verify you have imported the module DynamicContentModule in your application');\n }\n localizationPath$ = this.dynamicContentService.getContentPathStream(this.localizationConfiguration.endPointUrl);\n }\n\n return localizationPath$.pipe(\n switchMap((localizationPath: string) => {\n if (localizationPath) {\n\n const localizationBundle$ = this.downloadLanguageBundle$(localizationPath + lang + JSON_EXT);\n\n if (this.localizationConfiguration.mergeWithLocalTranslations) {\n return combineLatest([\n localizationBundle$.pipe(catchError(() => of({}))),\n this.getTranslationFromLocal(lang, fallback).pipe(\n map((translations) => {\n Object.keys(translations).forEach((key) => translations[key] = `[local] ${translations[key] as string}`);\n return translations;\n })\n )\n ]).pipe(map(([dynamicTranslations, localTranslations]) => ({...localTranslations, ...dynamicTranslations})));\n }\n\n /*\n * if endPointUrl is specified by the configuration then:\n * 1. try to load lang from endPointUrl\n * 2. if 1 fails then try to load from the app (local file)\n */\n return localizationBundle$.pipe(\n catchError(() => {\n this.logger?.warn(`Failed to load the localization resource from ${localizationPath + lang + JSON_EXT}, trying from the application resources`);\n return this.getTranslationFromLocal(lang, fallback);\n })\n );\n }\n /*\n * else if endPointUrl NOT specified by then configuration then:\n * 1. try to load from the app (local file)\n */\n this.logger?.warn('No localization endpoint specified, localization fetch from application resources');\n return this.getTranslationFromLocal(lang, fallback);\n })\n );\n }\n\n /**\n *\n * Fetches localization bundles from published folder (internal to application)\n *\n * 1. try to load lang from local\n * 2. if 1 fails try to load fallback lang but only if it's different from lang in 1\n *\n * @param lang - language of the bundle\n * @param fallbackLanguage - fallback language in case bundle in language not found\n */\n public getTranslationFromLocal(lang: string, fallbackLanguage: string): Observable<any> {\n const pathPrefix: string = this.localizationConfiguration.bundlesOutputPath;\n return this.downloadLanguageBundle$(pathPrefix + lang + JSON_EXT).pipe(\n catchError(() => {\n if (lang !== fallbackLanguage) {\n this.logger?.warn(`Failed to load ${lang} from ${pathPrefix + lang + JSON_EXT}. Application will fallback to ${fallbackLanguage}`);\n return this.downloadLanguageBundle$(pathPrefix + fallbackLanguage + JSON_EXT).pipe(\n catchError(() => of({}))\n );\n } else {\n this.logger?.warn(`Failed to load ${lang} from ${pathPrefix + lang + JSON_EXT}.`);\n return of({});\n }\n })\n );\n }\n}\n","import { FactoryProvider, Optional } from '@angular/core';\nimport { TranslateLoader } from '@ngx-translate/core';\nimport { DynamicContentService } from '@o3r/dynamic-content';\nimport { LoggerService } from '@o3r/logger';\nimport { LocalizationConfiguration } from '../core';\nimport { LOCALIZATION_CONFIGURATION_TOKEN } from './localization.token';\nimport { TranslationsLoader } from './translations-loader';\n\n/**\n * Creates a loader of translations bundles based on the configuration\n * (endPointUrl and language determine which bundle we load and where do we fetch it from)\n *\n * @param localizationConfiguration\n * @param logger service to handle the log of warning and errors\n * @param dynamicContentService (optional)\n */\nexport function createTranslateLoader(localizationConfiguration: LocalizationConfiguration, logger?: LoggerService, dynamicContentService?: DynamicContentService) {\n return new TranslationsLoader(localizationConfiguration, logger, dynamicContentService);\n}\n\n/**\n * TranslateLoader provider, using framework's TranslationsLoader class\n */\nexport const translateLoaderProvider: FactoryProvider = {\n provide: TranslateLoader,\n useFactory: createTranslateLoader,\n deps: [LOCALIZATION_CONFIGURATION_TOKEN, [new Optional(), LoggerService], [new Optional(), DynamicContentService]]\n};\n","import { Injectable } from '@angular/core';\nimport { LocalizationService } from '../tools';\n\n@Injectable()\nexport class OtterLocalizationDevtools {\n\n constructor(private localizationService: LocalizationService) {\n }\n\n /**\n * Show localization keys\n *\n * @param value value enforced by the DevTools extension\n */\n public showLocalizationKeys(value?: boolean): void {\n this.localizationService.toggleShowKeys(value);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\n\nexport const OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS: LocalizationDevtoolsServiceOptions = {\n isActivatedOnBootstrap: false\n};\n\nexport const OTTER_LOCALIZATION_DEVTOOLS_OPTIONS: InjectionToken<LocalizationDevtoolsServiceOptions> = new InjectionToken<LocalizationDevtoolsServiceOptions>('Otter Localization Devtools options');\n","/* eslint-disable no-console */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport type { DevtoolsServiceInterface, WindowWithDevtools } from '@o3r/core';\nimport { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\n@Injectable()\nexport class LocalizationDevtoolsConsoleService implements DevtoolsServiceInterface {\n\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'localization';\n\n constructor(\n private readonly localizationDevtools: OtterLocalizationDevtools,\n @Optional() @Inject(OTTER_LOCALIZATION_DEVTOOLS_OPTIONS) private options: LocalizationDevtoolsServiceOptions = OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS\n ) {\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_[LocalizationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter localization Devtools is now accessible via the _OTTER_DEVTOOLS_.${LocalizationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /**\n * Show localization keys\n *\n * @param value value enforced by the DevTools extension\n */\n public showLocalizationKeys(value?: boolean): void {\n this.localizationDevtools.showLocalizationKeys(value);\n }\n}\n","import { Inject, Injectable, OnDestroy, Optional } from '@angular/core';\nimport { filterMessageContent } from '@o3r/core';\nimport { LoggerService } from '@o3r/logger';\nimport { fromEvent, Subscription } from 'rxjs';\nimport { AvailableLocalizationMessageContents, LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\nconst isLocalizationMessage = (message: any): message is AvailableLocalizationMessageContents => {\n return message && message.dataType === 'displayLocalizationKeys';\n};\n\n@Injectable()\nexport class LocalizationDevtoolsMessageService implements OnDestroy {\n\n private subscriptions = new Subscription();\n\n constructor(\n private logger: LoggerService,\n private localizationDevTools: OtterLocalizationDevtools,\n @Optional() @Inject(OTTER_LOCALIZATION_DEVTOOLS_OPTIONS) private options: LocalizationDevtoolsServiceOptions = OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS) {\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n *\n * @param event Event coming from the Otter Chrome DevTools extension\n * @param message\n */\n private handleEvents(message: AvailableLocalizationMessageContents) {\n this.logger.debug('Message handling by the localization service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'displayLocalizationKeys': {\n this.localizationDevTools.showLocalizationKeys(message.toggle);\n break;\n }\n default: {\n this.logger.warn('Message ignored by the localization service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter Chrome DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to localization service of the application');\n }\n\n /** @inheritDoc */\n public activate() {\n this.subscriptions.add(\n fromEvent(window, 'message').pipe(filterMessageContent(isLocalizationMessage)).subscribe((e) => this.handleEvents(e))\n );\n }\n\n /** @inheritDoc */\n public ngOnDestroy() {\n this.subscriptions.unsubscribe();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { LocalizationModule } from '../tools/index';\nimport type { LocalizationDevtoolsServiceOptions } from './localization-devkit.interface';\nimport { LocalizationDevtoolsConsoleService } from './localization-devtools.console.service';\nimport { LocalizationDevtoolsMessageService } from './localization-devtools.message.service';\nimport { OtterLocalizationDevtools } from './localization-devtools.service';\nimport { OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_LOCALIZATION_DEVTOOLS_OPTIONS } from './localization-devtools.token';\n\n@NgModule({\n imports: [\n LocalizationModule\n ],\n providers: [\n { provide: OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, useValue: OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS },\n LocalizationDevtoolsMessageService,\n LocalizationDevtoolsConsoleService,\n OtterLocalizationDevtools\n ]\n})\nexport class LocalizationDevtoolsModule {\n\n /**\n * Initialize Otter Devtools\n *\n * @param options\n */\n public static instrument(options: Partial<LocalizationDevtoolsServiceOptions>): ModuleWithProviders<LocalizationDevtoolsModule> {\n return {\n ngModule: LocalizationDevtoolsModule,\n providers: [\n { provide: OTTER_LOCALIZATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_LOCALIZATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n LocalizationDevtoolsMessageService,\n LocalizationDevtoolsConsoleService,\n OtterLocalizationDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["actions.setLocalizationOverride","i1","i1.LocalizationService","i2"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;;;;AAIG;AACH;AACM,SAAU,YAAY,CAAC,IAAY,EAAA;AACvC,IAAA,OAAO,CAAC,MAAW,EAAE,GAAW,KAAI;AAClC,QAAA,MAAM,YAAY,GAAG,IAAI,IAAI,CAAI,CAAA,EAAA,GAAG,EAAE,CAAC;AACvC,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEjC,QAAA,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE;AACtB,YAAA,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;AACjC,gBAAA,GAAG,E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AA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,EAP1B,SAAA,EAAA;AACT,YAAA,EAAE,OAAO,EAAE,mCAAmC,EAAE,QAAQ,EAAE,2CAA2C,EAAE;YACvG,kCAAkC;YAClC,kCAAkC;YAClC,yBAAyB;AAC1B,SAAA,EAAA,OAAA,EAAA,CAPC,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAST,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAXtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,kBAAkB;AACnB,qBAAA;AACD,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,mCAAmC,EAAE,QAAQ,EAAE,2CAA2C,EAAE;wBACvG,kCAAkC;wBAClC,kCAAkC;wBAClC,yBAAyB;AAC1B,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/localization",
3
- "version": "10.0.0-next.22",
3
+ "version": "10.0.0-next.23",
4
4
  "description": "This module provides a runtime dynamic language/translation support and debug tools.",
5
5
  "keywords": [
6
6
  "localization",
@@ -20,11 +20,11 @@
20
20
  "@formatjs/intl-numberformat": "^8.0.2",
21
21
  "@ngrx/store": "~16.2.0",
22
22
  "@ngx-translate/core": "~15.0.0",
23
- "@o3r/core": "^10.0.0-next.22",
24
- "@o3r/dynamic-content": "^10.0.0-next.22",
25
- "@o3r/extractors": "^10.0.0-next.22",
26
- "@o3r/logger": "^10.0.0-next.22",
27
- "@o3r/schematics": "^10.0.0-next.22",
23
+ "@o3r/core": "^10.0.0-next.23",
24
+ "@o3r/dynamic-content": "^10.0.0-next.23",
25
+ "@o3r/extractors": "^10.0.0-next.23",
26
+ "@o3r/logger": "^10.0.0-next.23",
27
+ "@o3r/schematics": "^10.0.0-next.23",
28
28
  "@schematics/angular": "~16.2.0",
29
29
  "chokidar": "^3.5.2",
30
30
  "intl-messageformat": "~10.5.0",
@@ -1,9 +0,0 @@
1
- /**
2
- * Decorator for @Input property
3
- * It merges user input with default property value
4
- *
5
- * @param privateFieldName
6
- * @deprecated will be removed in v10
7
- */
8
- export declare function InputMerge(privateFieldName?: string): (target: any, key: string) => void;
9
- //# sourceMappingURL=input-merge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-merge.d.ts","sourceRoot":"","sources":["../../src/annotations/input-merge.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,wBAAgB,UAAU,CAAC,gBAAgB,CAAC,EAAE,MAAM,YAClC,GAAG,OAAO,MAAM,UAkBjC"}
@@ -1,29 +0,0 @@
1
- import { deepFill, immutablePrimitive } from '@o3r/core';
2
- /**
3
- * Decorator for @Input property
4
- * It merges user input with default property value
5
- *
6
- * @param privateFieldName
7
- * @deprecated will be removed in v10
8
- */
9
- // eslint-disable-next-line @typescript-eslint/naming-convention
10
- export function InputMerge(privateFieldName) {
11
- return (target, key) => {
12
- const privateField = privateFieldName || `_${key}`;
13
- const privateValue = target[key];
14
- if (delete target[key]) {
15
- Object.defineProperty(target, key, {
16
- get: function () {
17
- return this[privateField];
18
- },
19
- set: function (value) {
20
- const currentField = this[privateField] || privateValue;
21
- this[privateField] = typeof currentField === 'undefined' ? immutablePrimitive(value) : deepFill(currentField, value);
22
- },
23
- enumerable: true,
24
- configurable: true
25
- });
26
- }
27
- };
28
- }
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5wdXQtbWVyZ2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYW5ub3RhdGlvbnMvaW5wdXQtbWVyZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkF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