@o3r/localization 9.3.0-alpha.7 → 9.3.0-alpha.70
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 +2 -2
- package/builders/helpers/localization.generator.d.ts.map +1 -1
- package/builders/helpers/localization.generator.js +6 -5
- package/builders/i18n/index.js +2 -2
- package/builders/localization/index.d.ts.map +1 -1
- package/builders/localization/index.js +3 -2
- package/builders/localization-extractor/index.d.ts.map +1 -1
- package/builders/localization-extractor/index.js +2 -1
- package/esm2022/tools/localized-currency.pipe.mjs +1 -1
- package/fesm2022/o3r-localization.mjs.map +1 -1
- package/package.json +7 -7
- package/schematics/add-localization-key/index.d.ts.map +1 -1
- package/schematics/add-localization-key/index.js +2 -2
- package/schematics/cms-adapter/index.d.ts +0 -1
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +5 -9
- package/schematics/localization-base/index.d.ts +2 -1
- package/schematics/localization-base/index.d.ts.map +1 -1
- package/schematics/localization-base/index.js +18 -25
- package/schematics/localization-to-component/index.d.ts.map +1 -1
- package/schematics/localization-to-component/index.js +2 -2
- package/schematics/ng-add/helpers/devtools-registration.d.ts +11 -0
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -0
- package/schematics/ng-add/helpers/devtools-registration.js +25 -0
- package/schematics/ng-add/index.d.ts +0 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +10 -5
- package/tools/localized-currency.pipe.d.ts +1 -0
- package/tools/localized-currency.pipe.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -717,5 +717,5 @@ Otter framework provides a set of code generators based on [angular schematics](
|
|
|
717
717
|
| Schematics | Description | How to use |
|
|
718
718
|
| ------------------------------ | -------------------------------------------------------------- | ------------------------------------ |
|
|
719
719
|
| add | Include Otter localization module in a library / application. | `ng add @o3r/localization` |
|
|
720
|
-
| localization-to-component | Add localization architecture to an Otter component
|
|
721
|
-
| localization-key-to-component | Add localization key to an Otter component
|
|
720
|
+
| localization-to-component | Add localization architecture to an Otter component | `ng g localization-to-component` |
|
|
721
|
+
| localization-key-to-component | Add a localization key to an Otter component | `ng g localization-key-to-component` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization.generator.d.ts","sourceRoot":"","sources":["../../../builders/helpers/localization.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"localization.generator.d.ts","sourceRoot":"","sources":["../../../builders/helpers/localization.generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAUhF,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;CACjC;AAED,6BAA6B;AAC7B,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,kCAAkC;AAClC,MAAM,WAAW,oBAAoB;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACtC;AAED,gCAAgC;AAChC,MAAM,WAAW,mBAAmB;IAClC,CAAC,IAAI,EAAE,MAAM,GAAG;QACd,IAAI,EAAE,oB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,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,OAAO,CAAC;KACnB,GAAG,oBAAoB;CAkCzB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LocalizationExtractor = void 0;
|
|
4
4
|
const extractors_1 = require("@o3r/extractors");
|
|
5
|
+
const schematics_1 = require("@o3r/schematics");
|
|
5
6
|
const fs = require("node:fs");
|
|
6
7
|
const glob = require("globby");
|
|
7
8
|
const path = require("node:path");
|
|
@@ -19,7 +20,7 @@ class LocalizationExtractor {
|
|
|
19
20
|
/** Get the list of file from tsconfig.json */
|
|
20
21
|
getFilesFromTsConfig() {
|
|
21
22
|
const { include, exclude, cwd } = this.getPatternsFromTsConfig();
|
|
22
|
-
return glob(include, { ignore: exclude, cwd });
|
|
23
|
+
return glob.sync(include, { ignore: exclude, cwd });
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Return the class node if the class is an angular element
|
|
@@ -147,7 +148,7 @@ class LocalizationExtractor {
|
|
|
147
148
|
}
|
|
148
149
|
if (typeof loc.defaultValue === 'undefined' && typeof loc.$ref === 'undefined' && !loc.dictionary) {
|
|
149
150
|
this.logger.error(`${key} has no default value or $ref defined`);
|
|
150
|
-
throw new
|
|
151
|
+
throw new schematics_1.O3rCliError(`${key} has no default value or $ref defined`);
|
|
151
152
|
}
|
|
152
153
|
return res;
|
|
153
154
|
}
|
|
@@ -173,7 +174,7 @@ class LocalizationExtractor {
|
|
|
173
174
|
const tsconfigResult = ts.readConfigFile(this.tsconfigPath, ts.sys.readFile);
|
|
174
175
|
if (tsconfigResult.error) {
|
|
175
176
|
this.logger.error(tsconfigResult.error.messageText.toString());
|
|
176
|
-
throw new
|
|
177
|
+
throw new schematics_1.O3rCliError(tsconfigResult.error.messageText.toString());
|
|
177
178
|
}
|
|
178
179
|
const include = [...(tsconfigResult.config.files || []), ...(tsconfigResult.config.include || [])];
|
|
179
180
|
const exclude = tsconfigResult.config.exclude || [];
|
|
@@ -216,7 +217,7 @@ class LocalizationExtractor {
|
|
|
216
217
|
* @param extraLocalizationFiles Additional translations to add
|
|
217
218
|
*/
|
|
218
219
|
async extractLocalizationFromTsConfig(extraLocalizationFiles = []) {
|
|
219
|
-
const files =
|
|
220
|
+
const files = this.getFilesFromTsConfig();
|
|
220
221
|
const tsFiles = files
|
|
221
222
|
.filter((file) => /\.ts$/.test(file))
|
|
222
223
|
.map((file) => path.join(path.dirname(this.tsconfigPath), file));
|
|
@@ -282,7 +283,7 @@ class LocalizationExtractor {
|
|
|
282
283
|
}
|
|
283
284
|
else {
|
|
284
285
|
this.logger.error(`The key ${data.key} from ${origin} try to override the previous value (${metadata[data.key].value || 'ref ' + metadata[data.key].ref} -> ${data.value || 'ref ' + data.ref})`);
|
|
285
|
-
throw new
|
|
286
|
+
throw new schematics_1.O3rCliError('Duplicate key');
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
metadata[data.key] = data;
|
package/builders/i18n/index.js
CHANGED
|
@@ -24,8 +24,8 @@ exports.default = (0, architect_1.createBuilder)((options, context) => {
|
|
|
24
24
|
recursive: true
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
fs.writeFileSync(
|
|
27
|
+
const defaultLanguageFile = path.join(i18nPath, options.defaultLanguageFile);
|
|
28
|
+
fs.writeFileSync(defaultLanguageFile, newContent + '\n');
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/localization/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/localization/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAgFrD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG;IAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,CAGvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAC1C,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC9C,cAAc,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BjE;;AAgLD,wBA0MG"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTranslationsForLanguage = exports.loadTranslations = void 0;
|
|
4
4
|
const architect_1 = require("@angular-devkit/architect");
|
|
5
|
+
const schematics_1 = require("@o3r/schematics");
|
|
5
6
|
const fs = require("node:fs");
|
|
6
7
|
const globby_1 = require("globby");
|
|
7
8
|
const path = require("node:path");
|
|
@@ -54,7 +55,7 @@ function checkUnusedTranslation(language, defaultBundle, customTranslations, con
|
|
|
54
55
|
.filter((key) => !dictionaryKeysPatterns.some((dictionaryKeyPattern) => key.startsWith(dictionaryKeyPattern)));
|
|
55
56
|
missingMetadata.forEach((key) => context.logger[failIfMissingMetadata ? 'error' : 'warn'](`The key "${key}" from "${language}" is not part of the MetaData`));
|
|
56
57
|
if (missingMetadata.length && failIfMissingMetadata) {
|
|
57
|
-
throw new
|
|
58
|
+
throw new schematics_1.O3rCliError(`There is missing metadata for ${language}`);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
@@ -98,7 +99,7 @@ function getTranslationsForLanguage(language, filesPerLanguage, defaultLanguageM
|
|
|
98
99
|
if (defaultLanguage) {
|
|
99
100
|
// Throw an error if we find a circular dependency
|
|
100
101
|
if (dependencyPath.has(defaultLanguage)) {
|
|
101
|
-
throw new
|
|
102
|
+
throw new schematics_1.O3rCliError(`Circular dependency found: ${[...Array.from(dependencyPath), defaultLanguage].join('->')}`);
|
|
102
103
|
}
|
|
103
104
|
else {
|
|
104
105
|
// Else, recursively resolve its bundle and use it as a base for the current language
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/localization-extractor/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../builders/localization-extractor/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAI9D,cAAc,UAAU,CAAC;;AAEzB,wBA4LG"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const architect_1 = require("@angular-devkit/architect");
|
|
5
|
+
const schematics_1 = require("@o3r/schematics");
|
|
5
6
|
const chokidar = require("chokidar");
|
|
6
7
|
const fs = require("node:fs");
|
|
7
8
|
const globby_1 = require("globby");
|
|
@@ -61,7 +62,7 @@ exports.default = (0, architect_1.createBuilder)(async (options, context) => {
|
|
|
61
62
|
.filter((metadataItem) => !!metadataItem.value &&
|
|
62
63
|
validations_1.validators.reduce((isInvalid, validator) => isInvalid || !validator(metadataItem.value), false));
|
|
63
64
|
if (translationsWithIssue.length) {
|
|
64
|
-
throw new
|
|
65
|
+
throw new schematics_1.O3rCliError(`The following translations are invalid: ${translationsWithIssue.map((translation) => translation.key).join(', ')}`);
|
|
65
66
|
}
|
|
66
67
|
context.reportProgress(STEP_NUMBER, STEP_NUMBER, 'Generating metadata');
|
|
67
68
|
// Create output folder if does not exist
|
|
@@ -29,4 +29,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImpor
|
|
|
29
29
|
pure: false
|
|
30
30
|
}]
|
|
31
31
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }]; } });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxpemVkLWN1cnJlbmN5LnBpcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdG9vbHMvbG9jYWxpemVkLWN1cnJlbmN5LnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGlCQUFpQixDQUFDO0FBQzdDLE9BQU8sRUFBQyxpQkFBaUIsRUFBYSxJQUFJLEVBQWdCLE1BQU0sZUFBZSxDQUFDO0FBRWhGLE9BQU8sRUFBQyxtQkFBbUIsRUFBQyxNQUFNLHdCQUF3QixDQUFDOzs7QUFFM0Q7O0dBRUc7QUFLSCxNQUFNLE9BQU8scUJBQXNCLFNBQVEsWUFBWTtJQUdyRCxZQUFvQixtQkFBd0MsRUFBVSxpQkFBb0M7UUFDeEcsS0FBSyxDQUFDLG1CQUFtQixDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FBQztRQUQ5Qix3QkFBbUIsR0FBbkIsbUJBQW1CLENBQXFCO1FBQVUsc0JBQWlCLEdBQWpCLGlCQUFpQixDQUFtQjtRQUV4RyxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxtQkFBbUIsRUFBRSxDQUFDLFlBQVksQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQzdGLElBQUksQ0FBQyxpQkFBaUIsQ0FBQyxZQUFZLEVBQUUsQ0FDdEMsQ0FBQztJQUNKLENBQUM7SUFXTSxTQUFTLENBQ2QsS0FBeUMsRUFBRSxZQUFxQixFQUFFLE9BQWdFL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/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 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,aAA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AA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAA1B,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,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/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;;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;AAA1B,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,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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/localization",
|
|
3
|
-
"version": "9.3.0-alpha.
|
|
3
|
+
"version": "9.3.0-alpha.70",
|
|
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": "^9.3.0-alpha.
|
|
24
|
-
"@o3r/dynamic-content": "^9.3.0-alpha.
|
|
25
|
-
"@o3r/extractors": "^9.3.0-alpha.
|
|
26
|
-
"@o3r/logger": "^9.3.0-alpha.
|
|
27
|
-
"@o3r/schematics": "^9.3.0-alpha.
|
|
23
|
+
"@o3r/core": "^9.3.0-alpha.70",
|
|
24
|
+
"@o3r/dynamic-content": "^9.3.0-alpha.70",
|
|
25
|
+
"@o3r/extractors": "^9.3.0-alpha.70",
|
|
26
|
+
"@o3r/logger": "^9.3.0-alpha.70",
|
|
27
|
+
"@o3r/schematics": "^9.3.0-alpha.70",
|
|
28
28
|
"@schematics/angular": "~16.2.0",
|
|
29
29
|
"chokidar": "^3.5.2",
|
|
30
30
|
"intl-messageformat": "~10.5.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"tslib": "^2.5.3"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
|
-
"node": ">=
|
|
64
|
+
"node": ">=18.0.0"
|
|
65
65
|
},
|
|
66
66
|
"builders": "./builders.json",
|
|
67
67
|
"schematics": "./collection.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/add-localization-key/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/add-localization-key/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIL,MAAM,4BAA4B,CAAC;AAapC,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AA8FrE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,oCAAoC,GAAG,IAAI,CAyJxF"}
|
|
@@ -58,7 +58,7 @@ const getLocalizationInformation = (componentPath, tree) => {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
if (!defaultTranslationVariableName) {
|
|
61
|
-
throw new
|
|
61
|
+
throw new schematics_2.O3rCliError(`Unable to find initialization of ${translationsVariableName} in ${componentPath}.`);
|
|
62
62
|
}
|
|
63
63
|
const importDeclaration = componentSourceFile.statements.find((statement) => ts.isImportDeclaration(statement)
|
|
64
64
|
&& ts.isStringLiteral(statement.moduleSpecifier)
|
|
@@ -67,7 +67,7 @@ const getLocalizationInformation = (componentPath, tree) => {
|
|
|
67
67
|
&& ts.isNamedImports(statement.importClause.namedBindings)
|
|
68
68
|
&& !!statement.importClause.namedBindings.elements.find((element) => ts.isIdentifier(element.name) && element.name.escapedText.toString() === defaultTranslationVariableName));
|
|
69
69
|
if (!importDeclaration) {
|
|
70
|
-
throw new
|
|
70
|
+
throw new schematics_2.O3rCliError(`Unable to find import declaration of ${defaultTranslationVariableName} in ${componentPath}`);
|
|
71
71
|
}
|
|
72
72
|
const translationsPath = node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${importDeclaration.moduleSpecifier.text}.ts`);
|
|
73
73
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/cms-adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKvF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/cms-adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKvF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAoEpF"}
|
|
@@ -6,7 +6,6 @@ const schematics_2 = require("@o3r/schematics");
|
|
|
6
6
|
const path = require("node:path");
|
|
7
7
|
/**
|
|
8
8
|
* Update CMS adapter tools
|
|
9
|
-
*
|
|
10
9
|
* @param options @see RuleFactory.options
|
|
11
10
|
* @param options.projectName
|
|
12
11
|
* @param rootPath @see RuleFactory.rootPath
|
|
@@ -17,15 +16,14 @@ function updateCmsAdapter(options) {
|
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* Add cms extractors builder into the angular.json
|
|
20
|
-
*
|
|
21
19
|
* @param tree
|
|
22
20
|
* @param _context
|
|
23
21
|
* @param context
|
|
24
22
|
*/
|
|
25
23
|
const editAngularJson = (tree, context) => {
|
|
26
|
-
const workspace = (0, schematics_2.
|
|
27
|
-
const workspaceProject =
|
|
28
|
-
if (!workspaceProject) {
|
|
24
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
25
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
26
|
+
if (!workspace || !workspaceProject) {
|
|
29
27
|
context.logger.error('No project detected, the extractors will not be added');
|
|
30
28
|
return tree;
|
|
31
29
|
}
|
|
@@ -39,20 +37,18 @@ function updateCmsAdapter(options) {
|
|
|
39
37
|
libraries: []
|
|
40
38
|
}
|
|
41
39
|
};
|
|
42
|
-
|
|
43
|
-
workspace.projects[name] = newProject;
|
|
40
|
+
workspace.projects[options.projectName] = workspaceProject;
|
|
44
41
|
tree.overwrite('/angular.json', JSON.stringify(workspace, null, 2));
|
|
45
42
|
return tree;
|
|
46
43
|
};
|
|
47
44
|
/**
|
|
48
45
|
* Add cms extractors scripts into the package.json
|
|
49
|
-
*
|
|
50
46
|
* @param tree
|
|
51
47
|
* @param _context
|
|
52
48
|
* @param context
|
|
53
49
|
*/
|
|
54
50
|
const addExtractorsScripts = (tree, context) => {
|
|
55
|
-
const workspaceProject = (0, schematics_2.
|
|
51
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
56
52
|
if (!workspaceProject) {
|
|
57
53
|
context.logger.error('No package detected, the extractor scripts will not be added');
|
|
58
54
|
return tree;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
2
|
/**
|
|
3
3
|
* Add Otter localization support
|
|
4
|
-
*
|
|
5
4
|
* @param options @see RuleFactory.options
|
|
6
5
|
* @param options.projectName
|
|
7
6
|
* @param rootPath @see RuleFactory.rootPath
|
|
@@ -11,6 +10,8 @@ export declare function updateLocalization(options: {
|
|
|
11
10
|
}, rootPath: string): Rule;
|
|
12
11
|
/**
|
|
13
12
|
*
|
|
13
|
+
* @param options
|
|
14
|
+
* @param options.projectName
|
|
14
15
|
*/
|
|
15
16
|
export declare function updateI18n(options: {
|
|
16
17
|
projectName?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,IAAI,EAAyC,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,IAAI,EAAyC,MAAM,4BAA4B,CAAC;AAgC7I;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CA6a/G;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,GAAG,IAAI,CAwC5E"}
|
|
@@ -14,7 +14,6 @@ const formatjsIntlNumberformatDep = '@formatjs/intl-numberformat';
|
|
|
14
14
|
const angularCdkDep = '@angular/cdk';
|
|
15
15
|
/**
|
|
16
16
|
* Add Otter localization support
|
|
17
|
-
*
|
|
18
17
|
* @param options @see RuleFactory.options
|
|
19
18
|
* @param options.projectName
|
|
20
19
|
* @param rootPath @see RuleFactory.rootPath
|
|
@@ -27,12 +26,11 @@ function updateLocalization(options, rootPath) {
|
|
|
27
26
|
const devResourcesFolder = 'dev-resources';
|
|
28
27
|
/**
|
|
29
28
|
* Generate locales folder
|
|
30
|
-
*
|
|
31
29
|
* @param tree
|
|
32
30
|
* @param context
|
|
33
31
|
*/
|
|
34
32
|
const generateLocalesFolder = (tree, context) => {
|
|
35
|
-
const workingDirectory = (0, schematics_2.
|
|
33
|
+
const workingDirectory = (options.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
|
|
36
34
|
let gitIgnoreContent = '';
|
|
37
35
|
const gitIgnorePath = path.posix.join(workingDirectory, '.gitignore');
|
|
38
36
|
if (tree.exists(gitIgnorePath)) {
|
|
@@ -56,14 +54,13 @@ function updateLocalization(options, rootPath) {
|
|
|
56
54
|
};
|
|
57
55
|
/**
|
|
58
56
|
* Add translation generation builders into angular.json
|
|
59
|
-
*
|
|
60
57
|
* @param tree
|
|
61
58
|
* @param context
|
|
62
59
|
*/
|
|
63
60
|
const updateAngularJson = (tree, context) => {
|
|
64
|
-
const workspace = (0, schematics_2.
|
|
65
|
-
const projectName = options.projectName
|
|
66
|
-
const workspaceProject =
|
|
61
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
62
|
+
const projectName = options.projectName;
|
|
63
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
67
64
|
const projectRoot = path.posix.join(workspaceProject?.root || '');
|
|
68
65
|
const distFolder = (workspaceProject &&
|
|
69
66
|
workspaceProject.architect &&
|
|
@@ -72,7 +69,7 @@ function updateLocalization(options, rootPath) {
|
|
|
72
69
|
(workspaceProject.architect.build.configurations && workspaceProject.architect.build.configurations.production && workspaceProject.architect.build.configurations.production.outputPath ||
|
|
73
70
|
workspaceProject.architect.build.options.outputPath)) || './dist';
|
|
74
71
|
// exit if not an application
|
|
75
|
-
if (!workspaceProject) {
|
|
72
|
+
if (!workspace || !projectName || !workspaceProject) {
|
|
76
73
|
context.logger.debug('No application project found to add translation extraction');
|
|
77
74
|
return tree;
|
|
78
75
|
}
|
|
@@ -167,16 +164,15 @@ function updateLocalization(options, rootPath) {
|
|
|
167
164
|
};
|
|
168
165
|
/**
|
|
169
166
|
* Changed package.json start script to run localization generation
|
|
170
|
-
*
|
|
171
167
|
* @param tree
|
|
172
168
|
* @param context
|
|
173
169
|
*/
|
|
174
170
|
const updatePackageJson = (tree, context) => {
|
|
175
|
-
const workspace = (0, schematics_2.
|
|
176
|
-
const projectName = options.projectName
|
|
177
|
-
const workspaceProject =
|
|
171
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
172
|
+
const projectName = options.projectName;
|
|
173
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
178
174
|
const packageManagerRunner = (0, schematics_2.getPackageManagerRunner)((0, schematics_2.getWorkspaceConfig)(tree));
|
|
179
|
-
if (!workspaceProject) {
|
|
175
|
+
if (!projectName || !workspace || !workspaceProject) {
|
|
180
176
|
context.logger.debug('No application project found to add translation extraction');
|
|
181
177
|
return tree;
|
|
182
178
|
}
|
|
@@ -198,7 +194,6 @@ function updateLocalization(options, rootPath) {
|
|
|
198
194
|
};
|
|
199
195
|
/**
|
|
200
196
|
* Edit main module with the translation required configuration
|
|
201
|
-
*
|
|
202
197
|
* @param tree
|
|
203
198
|
* @param context
|
|
204
199
|
*/
|
|
@@ -252,7 +247,6 @@ function updateLocalization(options, rootPath) {
|
|
|
252
247
|
};
|
|
253
248
|
/**
|
|
254
249
|
* Set language as default on application bootstrap
|
|
255
|
-
*
|
|
256
250
|
* @param tree
|
|
257
251
|
* @param context
|
|
258
252
|
*/
|
|
@@ -302,7 +296,6 @@ function updateLocalization(options, rootPath) {
|
|
|
302
296
|
};
|
|
303
297
|
/**
|
|
304
298
|
* Add mockTranslationModule to application tests.
|
|
305
|
-
*
|
|
306
299
|
* @param tree
|
|
307
300
|
* @param context
|
|
308
301
|
*/
|
|
@@ -335,15 +328,15 @@ function updateLocalization(options, rootPath) {
|
|
|
335
328
|
};
|
|
336
329
|
/**
|
|
337
330
|
* Add location required dependencies
|
|
338
|
-
*
|
|
339
331
|
* @param tree
|
|
340
332
|
* @param _context
|
|
341
333
|
* @param context
|
|
342
334
|
*/
|
|
343
335
|
const addDependencies = (tree, context) => {
|
|
344
|
-
const
|
|
336
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
337
|
+
const workingDirectory = workspaceProject?.root || '.';
|
|
338
|
+
const type = (0, schematics_2.getProjectNewDependenciesType)(workspaceProject);
|
|
345
339
|
const generatorDependencies = [ngxTranslateCoreDep, intlMessageFormatDep, formatjsIntlNumberformatDep, angularCdkDep];
|
|
346
|
-
const workingDirectory = (0, schematics_2.getProjectRootDir)(tree, options.projectName);
|
|
347
340
|
try {
|
|
348
341
|
return (0, schematics_2.ngAddPeerDependencyPackages)(generatorDependencies, packageJsonPath, type, { ...options, workingDirectory, skipNgAddSchematicRun: true })(tree, context);
|
|
349
342
|
}
|
|
@@ -370,6 +363,8 @@ function updateLocalization(options, rootPath) {
|
|
|
370
363
|
exports.updateLocalization = updateLocalization;
|
|
371
364
|
/**
|
|
372
365
|
*
|
|
366
|
+
* @param options
|
|
367
|
+
* @param options.projectName
|
|
373
368
|
*/
|
|
374
369
|
function updateI18n(options) {
|
|
375
370
|
if (!options.projectName) {
|
|
@@ -377,13 +372,12 @@ function updateI18n(options) {
|
|
|
377
372
|
}
|
|
378
373
|
/**
|
|
379
374
|
* Add i18n generation builders into angular.json
|
|
380
|
-
*
|
|
381
375
|
* @param tree
|
|
382
376
|
*/
|
|
383
377
|
const updateAngularJson = (tree) => {
|
|
384
|
-
const workspace = (0, schematics_2.
|
|
385
|
-
const workspaceProject =
|
|
386
|
-
if (!workspaceProject) {
|
|
378
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
379
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
380
|
+
if (!workspace || !workspaceProject) {
|
|
387
381
|
return tree;
|
|
388
382
|
}
|
|
389
383
|
if (!workspaceProject.architect) {
|
|
@@ -401,8 +395,7 @@ function updateI18n(options) {
|
|
|
401
395
|
}
|
|
402
396
|
};
|
|
403
397
|
}
|
|
404
|
-
|
|
405
|
-
workspace.projects[name] = newProject;
|
|
398
|
+
workspace.projects[options.projectName] = workspaceProject;
|
|
406
399
|
return (0, schematics_2.writeAngularJson)(tree, workspace);
|
|
407
400
|
};
|
|
408
401
|
return (0, schematics_1.chain)([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/localization-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAqBpC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAkClE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iCAAiC,GAAG,IAAI,CA6SlF"}
|
|
@@ -16,7 +16,7 @@ const checkLocalization = (componentPath, tree, baseFileName) => {
|
|
|
16
16
|
node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${baseFileName}.translation.ts`)
|
|
17
17
|
];
|
|
18
18
|
if (files.some((file) => tree.exists(file))) {
|
|
19
|
-
throw new
|
|
19
|
+
throw new schematics_2.O3rCliError(`Unable to add localization to this component because it already has at least one of these files: ${files.join(', ')}.`);
|
|
20
20
|
}
|
|
21
21
|
const componentSourceFile = ts.createSourceFile(componentPath, tree.readText(componentPath), ts.ScriptTarget.ES2020, true);
|
|
22
22
|
const o3rClassDeclaration = componentSourceFile.statements.find((statement) => ts.isClassDeclaration(statement)
|
|
@@ -24,7 +24,7 @@ const checkLocalization = (componentPath, tree, baseFileName) => {
|
|
|
24
24
|
if (o3rClassDeclaration.members.find((classElement) => ts.isPropertyDeclaration(classElement)
|
|
25
25
|
&& ts.isIdentifier(classElement.name)
|
|
26
26
|
&& localizationProperties.includes(classElement.name.escapedText.toString()))) {
|
|
27
|
-
throw new
|
|
27
|
+
throw new schematics_2.O3rCliError(`Unable to add localization to this component because it already has at least one of these properties: ${localizationProperties.join(', ')}.`);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import type { NgAddSchematicsSchema } from '../schema';
|
|
3
|
+
/**
|
|
4
|
+
* Register Devtools to the application
|
|
5
|
+
* @param tree
|
|
6
|
+
* @param context
|
|
7
|
+
* @param options
|
|
8
|
+
* @param options.projectName
|
|
9
|
+
*/
|
|
10
|
+
export declare const registerDevtools: (options: NgAddSchematicsSchema) => Promise<Rule>;
|
|
11
|
+
//# sourceMappingURL=devtools-registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAMvD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAAmB,qBAAqB,KAAG,QAAQ,IAAI,CAQnF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDevtools = void 0;
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const DEVTOOL_MODULE_NAME = 'LocalizationDevtoolsModule';
|
|
6
|
+
const DEVTOOL_SERVICE_NAME = 'LocalizationDevtoolsService';
|
|
7
|
+
const PACKAGE_NAME = require(path.resolve(__dirname, '..', '..', '..', 'package.json')).name;
|
|
8
|
+
/**
|
|
9
|
+
* Register Devtools to the application
|
|
10
|
+
* @param tree
|
|
11
|
+
* @param context
|
|
12
|
+
* @param options
|
|
13
|
+
* @param options.projectName
|
|
14
|
+
*/
|
|
15
|
+
const registerDevtools = async (options) => {
|
|
16
|
+
const { registerDevtoolsToApplication } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
17
|
+
return registerDevtoolsToApplication({
|
|
18
|
+
moduleName: DEVTOOL_MODULE_NAME,
|
|
19
|
+
packageName: PACKAGE_NAME,
|
|
20
|
+
serviceName: DEVTOOL_SERVICE_NAME,
|
|
21
|
+
projectName: options.projectName
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
exports.registerDevtools = registerDevtools;
|
|
25
|
+
//# sourceMappingURL=devtools-registration.js.map
|
|
@@ -2,7 +2,6 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import type { NgAddSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Add Otter localization to an Angular Project
|
|
5
|
-
*
|
|
6
5
|
* @param options for the dependencies installations
|
|
7
6
|
*/
|
|
8
7
|
export declare function ngAdd(options: NgAddSchematicsSchema): Rule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAKvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGtD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAsD1D"}
|
|
@@ -6,15 +6,15 @@ const fs = require("node:fs");
|
|
|
6
6
|
const path = require("node:path");
|
|
7
7
|
const schematics_2 = require("@o3r/schematics");
|
|
8
8
|
const cms_adapter_1 = require("../cms-adapter");
|
|
9
|
+
const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
9
10
|
/**
|
|
10
11
|
* Add Otter localization to an Angular Project
|
|
11
|
-
*
|
|
12
12
|
* @param options for the dependencies installations
|
|
13
13
|
*/
|
|
14
14
|
function ngAdd(options) {
|
|
15
15
|
return async (tree, context) => {
|
|
16
16
|
try {
|
|
17
|
-
const { applyEsLintFix, install,
|
|
17
|
+
const { applyEsLintFix, install, getProjectNewDependenciesType, getWorkspaceConfig, ngAddPackages, ngAddPeerDependencyPackages, getO3rPeerDeps } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
18
18
|
const { updateI18n, updateLocalization } = await Promise.resolve().then(() => require('../localization-base'));
|
|
19
19
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
20
20
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
|
|
@@ -23,7 +23,10 @@ function ngAdd(options) {
|
|
|
23
23
|
context.logger.info('Get information on https://github.com/AmadeusITGroup/otter/tree/main/docs/localization/LOCALIZATION.md#Debugging');
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
25
|
const { NodeDependencyType } = await Promise.resolve().then(() => require('@schematics/angular/utility/dependencies'));
|
|
26
|
-
const
|
|
26
|
+
const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
|
|
27
|
+
const workingDirectory = workspaceProject?.root || '.';
|
|
28
|
+
const dependencyType = getProjectNewDependenciesType(workspaceProject);
|
|
29
|
+
const registerDevtoolRule = await (0, devtools_registration_1.registerDevtools)(options);
|
|
27
30
|
return () => (0, schematics_1.chain)([
|
|
28
31
|
updateLocalization(options, __dirname),
|
|
29
32
|
updateI18n(options),
|
|
@@ -34,7 +37,8 @@ function ngAdd(options) {
|
|
|
34
37
|
skipConfirmation: true,
|
|
35
38
|
version: depsInfo.packageVersion,
|
|
36
39
|
parentPackageInfo: `${depsInfo.packageName} - setup`,
|
|
37
|
-
|
|
40
|
+
projectName: options.projectName,
|
|
41
|
+
dependencyType,
|
|
38
42
|
workingDirectory
|
|
39
43
|
})(t, c),
|
|
40
44
|
ngAddPeerDependencyPackages(['chokidar'], packageJsonPath, NodeDependencyType.Dev, { ...options, workingDirectory, skipNgAddSchematicRun: true }, '@o3r/localization - install builder dependency'),
|
|
@@ -49,7 +53,8 @@ function ngAdd(options) {
|
|
|
49
53
|
'@o3r/core:component-presenter': {
|
|
50
54
|
useLocalization: undefined
|
|
51
55
|
}
|
|
52
|
-
})
|
|
56
|
+
}),
|
|
57
|
+
registerDevtoolRule
|
|
53
58
|
])(tree, context);
|
|
54
59
|
}
|
|
55
60
|
catch (e) {
|
|
@@ -15,6 +15,7 @@ export declare class LocalizedCurrencyPipe extends CurrencyPipe implements OnDes
|
|
|
15
15
|
*/
|
|
16
16
|
transform(value: number | string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
|
|
17
17
|
transform(value: null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): null;
|
|
18
|
+
transform(value: number | string | null | undefined, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null;
|
|
18
19
|
ngOnDestroy(): void;
|
|
19
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<LocalizedCurrencyPipe, never>;
|
|
20
21
|
static ɵpipe: i0.ɵɵPipeDeclaration<LocalizedCurrencyPipe, "currency", false>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localized-currency.pipe.d.ts","sourceRoot":"","sources":["../../src/tools/localized-currency.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAQ,aAAa,EAAC,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;;AAE3D;;GAEG;AACH,qBAIa,qBAAsB,SAAQ,YAAa,YAAW,SAAS,EAAE,aAAa;IAG7E,OAAO,CAAC,mBAAmB;IAAuB,OAAO,CAAC,iBAAiB;IAFvF,OAAO,CAAC,YAAY,CAAe;gBAEf,mBAAmB,EAAE,mBAAmB,EAAU,iBAAiB,EAAE,iBAAiB;IAO1G;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAC/K,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,eAAe,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"localized-currency.pipe.d.ts","sourceRoot":"","sources":["../../src/tools/localized-currency.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC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