@o3r/localization 10.0.0-next.9 → 10.0.0-prerelease.2
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 +12 -14
- package/annotations/index.d.ts +0 -1
- package/annotations/index.d.ts.map +1 -1
- package/annotations/localization.d.ts +0 -1
- package/annotations/localization.d.ts.map +1 -1
- package/builders/helpers/localization.generator.d.ts +6 -22
- package/builders/helpers/localization.generator.d.ts.map +1 -1
- package/builders/helpers/localization.generator.js +56 -57
- package/builders/i18n/schema.json +1 -1
- package/builders/localization/index.d.ts.map +1 -1
- package/builders/localization/index.js +5 -4
- package/builders/localization/schema.json +1 -1
- package/builders/localization-extractor/index.d.ts.map +1 -1
- package/builders/localization-extractor/index.js +5 -3
- package/builders/localization-extractor/schema.d.ts +2 -0
- package/builders/localization-extractor/schema.d.ts.map +1 -1
- package/builders/localization-extractor/schema.json +6 -1
- package/core/localization.configuration.d.ts +8 -5
- package/core/localization.configuration.d.ts.map +1 -1
- package/core/translate-messageformat-lazy.compiler.d.ts +1 -3
- package/core/translate-messageformat-lazy.compiler.d.ts.map +1 -1
- package/devkit/localization-devkit.interface.d.ts +45 -2
- package/devkit/localization-devkit.interface.d.ts.map +1 -1
- package/devkit/localization-devtools.console.service.d.ts +38 -9
- package/devkit/localization-devtools.console.service.d.ts.map +1 -1
- package/devkit/localization-devtools.message.service.d.ts +4 -5
- package/devkit/localization-devtools.message.service.d.ts.map +1 -1
- package/devkit/localization-devtools.module.d.ts +0 -1
- package/devkit/localization-devtools.module.d.ts.map +1 -1
- package/devkit/localization-devtools.service.d.ts +11 -2
- package/devkit/localization-devtools.service.d.ts.map +1 -1
- package/devkit/localization-devtools.token.d.ts.map +1 -1
- package/esm2022/annotations/index.mjs +1 -2
- package/esm2022/annotations/localization.mjs +1 -2
- package/esm2022/core/localization.configuration.mjs +1 -1
- package/esm2022/core/translate-messageformat-lazy.compiler.mjs +6 -6
- package/esm2022/devkit/localization-devkit.interface.mjs +1 -1
- package/esm2022/devkit/localization-devtools.console.service.mjs +66 -12
- package/esm2022/devkit/localization-devtools.message.service.mjs +6 -7
- package/esm2022/devkit/localization-devtools.module.mjs +5 -6
- package/esm2022/devkit/localization-devtools.service.mjs +23 -6
- package/esm2022/devkit/localization-devtools.token.mjs +3 -2
- package/esm2022/rules-engine/localization.handler-action.mjs +30 -0
- package/esm2022/rules-engine/localization.interfaces.mjs +3 -0
- package/esm2022/rules-engine/localization.rules-engine.module.mjs +23 -0
- package/esm2022/rules-engine/o3r-localization-rules-engine.mjs +5 -0
- package/esm2022/rules-engine/public_api.mjs +4 -0
- package/esm2022/stores/localization-override/localization-override.module.mjs +4 -4
- package/esm2022/tools/localization-translate.directive.mjs +6 -7
- package/esm2022/tools/localization-translate.pipe.mjs +6 -7
- package/esm2022/tools/localization.module.mjs +9 -12
- package/esm2022/tools/localization.provider.mjs +1 -2
- package/esm2022/tools/localization.service.mjs +7 -14
- package/esm2022/tools/localized-currency.pipe.mjs +5 -5
- package/esm2022/tools/localized-date.pipe.mjs +5 -5
- package/esm2022/tools/localized-decimal.pipe.mjs +5 -5
- package/esm2022/tools/text-direction.service.mjs +6 -7
- package/esm2022/tools/text-directionality.service.mjs +6 -6
- package/esm2022/tools/translations-loader.mjs +9 -11
- package/fesm2022/o3r-localization-rules-engine.mjs +57 -0
- package/fesm2022/o3r-localization-rules-engine.mjs.map +1 -0
- package/fesm2022/o3r-localization.mjs +160 -139
- package/fesm2022/o3r-localization.mjs.map +1 -1
- package/package.json +40 -30
- package/rules-engine/index.d.ts +6 -0
- package/rules-engine/localization.handler-action.d.ts +19 -0
- package/rules-engine/localization.handler-action.d.ts.map +1 -0
- package/rules-engine/localization.interfaces.d.ts +12 -0
- package/rules-engine/localization.interfaces.d.ts.map +1 -0
- package/rules-engine/localization.rules-engine.module.d.ts +8 -0
- package/rules-engine/localization.rules-engine.module.d.ts.map +1 -0
- package/rules-engine/o3r-localization-rules-engine.d.ts.map +1 -0
- package/rules-engine/public_api.d.ts +4 -0
- package/rules-engine/public_api.d.ts.map +1 -0
- package/schemas/localization.metadata.schema.json +18 -3
- package/schemas/rules-engine.localisation-action.schema.json +26 -0
- package/schematics/add-localization-key/index.d.ts.map +1 -1
- package/schematics/add-localization-key/index.js +2 -2
- package/schematics/add-localization-key/schema.json +1 -1
- 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 +28 -34
- package/schematics/localization-to-component/index.d.ts.map +1 -1
- package/schematics/localization-to-component/index.js +2 -2
- package/schematics/localization-to-component/schema.json +1 -1
- 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 +35 -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 +9 -5
- package/schematics/ng-add/schema.json +1 -1
- package/tools/localization-translate.directive.d.ts +3 -4
- package/tools/localization-translate.directive.d.ts.map +1 -1
- package/tools/localization-translate.pipe.d.ts +4 -5
- package/tools/localization-translate.pipe.d.ts.map +1 -1
- package/tools/localization.module.d.ts +4 -7
- package/tools/localization.module.d.ts.map +1 -1
- package/tools/localization.provider.d.ts +0 -1
- package/tools/localization.provider.d.ts.map +1 -1
- package/tools/localization.service.d.ts +6 -14
- package/tools/localization.service.d.ts.map +1 -1
- package/tools/localized-currency.pipe.d.ts +6 -5
- package/tools/localized-currency.pipe.d.ts.map +1 -1
- package/tools/localized-date.pipe.d.ts +3 -3
- package/tools/localized-date.pipe.d.ts.map +1 -1
- package/tools/localized-decimal.pipe.d.ts +3 -3
- package/tools/localized-decimal.pipe.d.ts.map +1 -1
- package/tools/text-direction.service.d.ts +5 -6
- package/tools/text-direction.service.d.ts.map +1 -1
- package/tools/text-directionality.service.d.ts +0 -1
- package/tools/text-directionality.service.d.ts.map +1 -1
- package/tools/translations-loader.d.ts +5 -7
- package/tools/translations-loader.d.ts.map +1 -1
- package/annotations/input-merge.d.ts +0 -9
- package/annotations/input-merge.d.ts.map +0 -1
- package/builders/helpers/localization.generator.js.map +0 -1
- package/builders/i18n/index.js.map +0 -1
- package/builders/i18n/schema.js.map +0 -1
- package/builders/localization/index.js.map +0 -1
- package/builders/localization/schema.js.map +0 -1
- package/builders/localization-extractor/index.js.map +0 -1
- package/builders/localization-extractor/schema.js.map +0 -1
- package/builders/localization-extractor/validations.js.map +0 -1
- package/builders/package.json +0 -3
- package/esm2022/annotations/input-merge.mjs +0 -29
- package/schematics/add-localization-key/index.js.map +0 -1
- package/schematics/add-localization-key/schema.js.map +0 -1
- package/schematics/cms-adapter/index.js.map +0 -1
- package/schematics/localization-base/index.js.map +0 -1
- package/schematics/localization-to-component/index.js.map +0 -1
- package/schematics/localization-to-component/schema.js.map +0 -1
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/package.json +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
3
|
"$id": "LocalizationMetadataSchema",
|
|
4
4
|
"description": "Schema of Localizations",
|
|
5
5
|
"type": "array",
|
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
"description": {
|
|
27
27
|
"type": "string",
|
|
28
28
|
"description": "Description of the key. Used to give some context to the translators"
|
|
29
|
+
},
|
|
30
|
+
"referenceData": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "Determine if the value has to be overriden"
|
|
33
|
+
},
|
|
34
|
+
"tags": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "tags used to filter, categorize",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
}
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
42
|
},
|
|
@@ -37,8 +48,8 @@
|
|
|
37
48
|
"dictionary"
|
|
38
49
|
],
|
|
39
50
|
"if": { "properties": { "dictionary": { "const": false } } },
|
|
40
|
-
"then": { "required": ["key", "description", "dictionary"] },
|
|
41
|
-
"else": { "required": ["key", "description", "dictionary"
|
|
51
|
+
"then": { "required": ["key", "description", "dictionary", "value"] },
|
|
52
|
+
"else": { "required": ["key", "description", "dictionary"] },
|
|
42
53
|
"properties": {
|
|
43
54
|
"key": {
|
|
44
55
|
"type": "string",
|
|
@@ -62,6 +73,10 @@
|
|
|
62
73
|
"items": {
|
|
63
74
|
"type": "string"
|
|
64
75
|
}
|
|
76
|
+
},
|
|
77
|
+
"referenceData": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"description": "Determine if the value has to be overriden"
|
|
65
80
|
}
|
|
66
81
|
}
|
|
67
82
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "RulesActionUpdateLocalisationBlock",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"description": "Content of action that updates the localizations",
|
|
6
|
+
"properties": {
|
|
7
|
+
"actionType": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Action Type",
|
|
10
|
+
"const": "UPDATE_LOCALISATION"
|
|
11
|
+
},
|
|
12
|
+
"key": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "key of the location to update"
|
|
15
|
+
},
|
|
16
|
+
"value": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"additionalItems": false,
|
|
21
|
+
"required": [
|
|
22
|
+
"actionType",
|
|
23
|
+
"key",
|
|
24
|
+
"value"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
3
|
"$id": "NgAddLocalizationKeySchematicsSchema",
|
|
4
4
|
"title": "Add Otter Localization key to an existing component",
|
|
5
5
|
"description": "Add Otter Localization key to an existing component",
|
|
@@ -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;AA+B7I;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAgb/G;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,GAAG,IAAI,CAwC5E"}
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateI18n = exports.updateLocalization = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
5
|
const schematics_2 = require("@o3r/schematics");
|
|
6
|
-
const ts = require("typescript");
|
|
7
6
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
7
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
8
8
|
const change_1 = require("@schematics/angular/utility/change");
|
|
9
9
|
const path = require("node:path");
|
|
10
|
+
const ts = require("typescript");
|
|
10
11
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
11
12
|
const ngxTranslateCoreDep = '@ngx-translate/core';
|
|
12
13
|
const intlMessageFormatDep = 'intl-messageformat';
|
|
@@ -14,7 +15,6 @@ const formatjsIntlNumberformatDep = '@formatjs/intl-numberformat';
|
|
|
14
15
|
const angularCdkDep = '@angular/cdk';
|
|
15
16
|
/**
|
|
16
17
|
* Add Otter localization support
|
|
17
|
-
*
|
|
18
18
|
* @param options @see RuleFactory.options
|
|
19
19
|
* @param options.projectName
|
|
20
20
|
* @param rootPath @see RuleFactory.rootPath
|
|
@@ -27,12 +27,11 @@ function updateLocalization(options, rootPath) {
|
|
|
27
27
|
const devResourcesFolder = 'dev-resources';
|
|
28
28
|
/**
|
|
29
29
|
* Generate locales folder
|
|
30
|
-
*
|
|
31
30
|
* @param tree
|
|
32
31
|
* @param context
|
|
33
32
|
*/
|
|
34
33
|
const generateLocalesFolder = (tree, context) => {
|
|
35
|
-
const workingDirectory = (0, schematics_2.
|
|
34
|
+
const workingDirectory = (options.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root) || '.';
|
|
36
35
|
let gitIgnoreContent = '';
|
|
37
36
|
const gitIgnorePath = path.posix.join(workingDirectory, '.gitignore');
|
|
38
37
|
if (tree.exists(gitIgnorePath)) {
|
|
@@ -56,14 +55,13 @@ function updateLocalization(options, rootPath) {
|
|
|
56
55
|
};
|
|
57
56
|
/**
|
|
58
57
|
* Add translation generation builders into angular.json
|
|
59
|
-
*
|
|
60
58
|
* @param tree
|
|
61
59
|
* @param context
|
|
62
60
|
*/
|
|
63
61
|
const updateAngularJson = (tree, context) => {
|
|
64
|
-
const workspace = (0, schematics_2.
|
|
65
|
-
const projectName = options.projectName
|
|
66
|
-
const workspaceProject =
|
|
62
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
63
|
+
const projectName = options.projectName;
|
|
64
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
67
65
|
const projectRoot = path.posix.join(workspaceProject?.root || '');
|
|
68
66
|
const distFolder = (workspaceProject &&
|
|
69
67
|
workspaceProject.architect &&
|
|
@@ -72,7 +70,7 @@ function updateLocalization(options, rootPath) {
|
|
|
72
70
|
(workspaceProject.architect.build.configurations && workspaceProject.architect.build.configurations.production && workspaceProject.architect.build.configurations.production.outputPath ||
|
|
73
71
|
workspaceProject.architect.build.options.outputPath)) || './dist';
|
|
74
72
|
// exit if not an application
|
|
75
|
-
if (!workspaceProject) {
|
|
73
|
+
if (!workspace || !projectName || !workspaceProject) {
|
|
76
74
|
context.logger.debug('No application project found to add translation extraction');
|
|
77
75
|
return tree;
|
|
78
76
|
}
|
|
@@ -167,16 +165,15 @@ function updateLocalization(options, rootPath) {
|
|
|
167
165
|
};
|
|
168
166
|
/**
|
|
169
167
|
* Changed package.json start script to run localization generation
|
|
170
|
-
*
|
|
171
168
|
* @param tree
|
|
172
169
|
* @param context
|
|
173
170
|
*/
|
|
174
171
|
const updatePackageJson = (tree, context) => {
|
|
175
|
-
const workspace = (0, schematics_2.
|
|
176
|
-
const projectName = options.projectName
|
|
177
|
-
const workspaceProject =
|
|
172
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
173
|
+
const projectName = options.projectName;
|
|
174
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
178
175
|
const packageManagerRunner = (0, schematics_2.getPackageManagerRunner)((0, schematics_2.getWorkspaceConfig)(tree));
|
|
179
|
-
if (!workspaceProject) {
|
|
176
|
+
if (!projectName || !workspace || !workspaceProject) {
|
|
180
177
|
context.logger.debug('No application project found to add translation extraction');
|
|
181
178
|
return tree;
|
|
182
179
|
}
|
|
@@ -198,11 +195,11 @@ function updateLocalization(options, rootPath) {
|
|
|
198
195
|
};
|
|
199
196
|
/**
|
|
200
197
|
* Edit main module with the translation required configuration
|
|
201
|
-
*
|
|
202
198
|
* @param tree
|
|
203
199
|
* @param context
|
|
204
200
|
*/
|
|
205
201
|
const registerModules = (tree, context) => {
|
|
202
|
+
const additionalRules = [];
|
|
206
203
|
const moduleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
|
|
207
204
|
if (!moduleFilePath) {
|
|
208
205
|
return tree;
|
|
@@ -213,12 +210,11 @@ function updateLocalization(options, rootPath) {
|
|
|
213
210
|
return tree;
|
|
214
211
|
}
|
|
215
212
|
const recorder = tree.beginUpdate(moduleFilePath);
|
|
216
|
-
const ngModulesMetadata = (0, ast_utils_1.getDecoratorMetadata)(sourceFile, 'NgModule', '@angular/core');
|
|
217
213
|
const appModuleFile = tree.read(moduleFilePath).toString();
|
|
218
|
-
const moduleIndex =
|
|
219
|
-
const addImportToModuleFile = (name, file, moduleFunction) => (0,
|
|
214
|
+
const { moduleIndex } = (0, schematics_2.getModuleIndex)(sourceFile, appModuleFile);
|
|
215
|
+
const addImportToModuleFile = (name, file, moduleFunction) => additionalRules.push((0, utility_1.addRootImport)(options.projectName, ({ code, external }) => code `${external(name, file)}${moduleFunction}`));
|
|
220
216
|
const insertImportToModuleFile = (name, file, isDefault) => (0, schematics_2.insertImportToModuleFile)(name, file, sourceFile, recorder, moduleFilePath, isDefault);
|
|
221
|
-
const addProviderToModuleFile = (name, file, customProvider) => (0,
|
|
217
|
+
const addProviderToModuleFile = (name, file, customProvider) => additionalRules.push((0, utility_1.addRootProvider)(options.projectName, ({ code, external }) => code `{provide: ${external(name, file)}, ${customProvider}}`));
|
|
222
218
|
const insertBeforeModule = (line) => (0, schematics_2.insertBeforeModule)(line, appModuleFile, recorder, moduleIndex);
|
|
223
219
|
addImportToModuleFile('TranslateModule', '@ngx-translate/core', `.forRoot({
|
|
224
220
|
loader: translateLoaderProvider,
|
|
@@ -243,22 +239,21 @@ function updateLocalization(options, rootPath) {
|
|
|
243
239
|
useDynamicContent: environment.production
|
|
244
240
|
};
|
|
245
241
|
}`);
|
|
246
|
-
addProviderToModuleFile('MESSAGE_FORMAT_CONFIG', '@o3r/localization', '
|
|
242
|
+
addProviderToModuleFile('MESSAGE_FORMAT_CONFIG', '@o3r/localization', 'useValue: {}');
|
|
247
243
|
tree.commitUpdate(recorder);
|
|
248
244
|
if (!(0, ast_utils_1.isImported)(sourceFile, 'environment', '../environments/environment')) {
|
|
249
245
|
insertImportToModuleFile('environment', '../environments/environment');
|
|
250
246
|
}
|
|
251
|
-
return tree;
|
|
247
|
+
return (0, schematics_1.chain)(additionalRules)(tree, context);
|
|
252
248
|
};
|
|
253
249
|
/**
|
|
254
250
|
* Set language as default on application bootstrap
|
|
255
|
-
*
|
|
256
251
|
* @param tree
|
|
257
252
|
* @param context
|
|
258
253
|
*/
|
|
259
254
|
const setDefaultLanguage = (tree, context) => {
|
|
260
255
|
const moduleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
|
|
261
|
-
const componentFilePath = moduleFilePath && moduleFilePath.replace(/\.module\.ts$/i, '.component.ts');
|
|
256
|
+
const componentFilePath = moduleFilePath && moduleFilePath.replace(/\.(?:module|config)\.ts$/i, '.component.ts');
|
|
262
257
|
if (!(componentFilePath && tree.exists(componentFilePath))) {
|
|
263
258
|
context.logger.warn(`File ${componentFilePath} not found, the default language won't be set`);
|
|
264
259
|
return tree;
|
|
@@ -302,13 +297,12 @@ function updateLocalization(options, rootPath) {
|
|
|
302
297
|
};
|
|
303
298
|
/**
|
|
304
299
|
* Add mockTranslationModule to application tests.
|
|
305
|
-
*
|
|
306
300
|
* @param tree
|
|
307
301
|
* @param context
|
|
308
302
|
*/
|
|
309
303
|
const addMockTranslationModule = (tree, context) => {
|
|
310
304
|
const moduleFilePath = (0, schematics_2.getAppModuleFilePath)(tree, context, options.projectName);
|
|
311
|
-
const componentSpecFilePath = moduleFilePath && moduleFilePath.replace(/\.module\.ts$/i, '.component.spec.ts');
|
|
305
|
+
const componentSpecFilePath = moduleFilePath && moduleFilePath.replace(/\.(?:module|config)\.ts$/i, '.component.spec.ts');
|
|
312
306
|
if (!(componentSpecFilePath && tree.exists(componentSpecFilePath))) {
|
|
313
307
|
return tree;
|
|
314
308
|
}
|
|
@@ -335,15 +329,15 @@ function updateLocalization(options, rootPath) {
|
|
|
335
329
|
};
|
|
336
330
|
/**
|
|
337
331
|
* Add location required dependencies
|
|
338
|
-
*
|
|
339
332
|
* @param tree
|
|
340
333
|
* @param _context
|
|
341
334
|
* @param context
|
|
342
335
|
*/
|
|
343
336
|
const addDependencies = (tree, context) => {
|
|
344
|
-
const
|
|
337
|
+
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
338
|
+
const workingDirectory = workspaceProject?.root || '.';
|
|
339
|
+
const type = (0, schematics_2.getProjectNewDependenciesType)(workspaceProject);
|
|
345
340
|
const generatorDependencies = [ngxTranslateCoreDep, intlMessageFormatDep, formatjsIntlNumberformatDep, angularCdkDep];
|
|
346
|
-
const workingDirectory = (0, schematics_2.getProjectRootDir)(tree, options.projectName);
|
|
347
341
|
try {
|
|
348
342
|
return (0, schematics_2.ngAddPeerDependencyPackages)(generatorDependencies, packageJsonPath, type, { ...options, workingDirectory, skipNgAddSchematicRun: true })(tree, context);
|
|
349
343
|
}
|
|
@@ -370,6 +364,8 @@ function updateLocalization(options, rootPath) {
|
|
|
370
364
|
exports.updateLocalization = updateLocalization;
|
|
371
365
|
/**
|
|
372
366
|
*
|
|
367
|
+
* @param options
|
|
368
|
+
* @param options.projectName
|
|
373
369
|
*/
|
|
374
370
|
function updateI18n(options) {
|
|
375
371
|
if (!options.projectName) {
|
|
@@ -377,13 +373,12 @@ function updateI18n(options) {
|
|
|
377
373
|
}
|
|
378
374
|
/**
|
|
379
375
|
* Add i18n generation builders into angular.json
|
|
380
|
-
*
|
|
381
376
|
* @param tree
|
|
382
377
|
*/
|
|
383
378
|
const updateAngularJson = (tree) => {
|
|
384
|
-
const workspace = (0, schematics_2.
|
|
385
|
-
const workspaceProject =
|
|
386
|
-
if (!workspaceProject) {
|
|
379
|
+
const workspace = (0, schematics_2.getWorkspaceConfig)(tree);
|
|
380
|
+
const workspaceProject = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
|
381
|
+
if (!workspace || !workspaceProject) {
|
|
387
382
|
return tree;
|
|
388
383
|
}
|
|
389
384
|
if (!workspaceProject.architect) {
|
|
@@ -401,8 +396,7 @@ function updateI18n(options) {
|
|
|
401
396
|
}
|
|
402
397
|
};
|
|
403
398
|
}
|
|
404
|
-
|
|
405
|
-
workspace.projects[name] = newProject;
|
|
399
|
+
workspace.projects[options.projectName] = workspaceProject;
|
|
406
400
|
return (0, schematics_2.writeAngularJson)(tree, workspace);
|
|
407
401
|
};
|
|
408
402
|
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
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
3
|
"$id": "NgAddLocalizationSchematicsSchema",
|
|
4
4
|
"title": "Add Otter Localization to an existing component",
|
|
5
5
|
"description": "Add Otter Localization to an existing component",
|
|
@@ -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,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAOvD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,YAAmB,qBAAqB,KAAG,QAAQ,IAAI,CAgBnF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDevtools = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const DEVTOOL_MODULE_NAME = 'LocalizationDevtoolsModule';
|
|
7
|
+
const MESSAGE_DEVTOOL_SERVICE_NAME = 'LocalizationDevtoolsMessageService';
|
|
8
|
+
const CONSOLE_DEVTOOL_SERVICE_NAME = 'LocalizationDevtoolsConsoleService';
|
|
9
|
+
const PACKAGE_NAME = require(path.resolve(__dirname, '..', '..', '..', 'package.json')).name;
|
|
10
|
+
/**
|
|
11
|
+
* Register Devtools to the application
|
|
12
|
+
* @param tree
|
|
13
|
+
* @param context
|
|
14
|
+
* @param options
|
|
15
|
+
* @param options.projectName
|
|
16
|
+
*/
|
|
17
|
+
const registerDevtools = async (options) => {
|
|
18
|
+
const { registerDevtoolsToApplication } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
19
|
+
return (0, schematics_1.chain)([
|
|
20
|
+
registerDevtoolsToApplication({
|
|
21
|
+
moduleName: DEVTOOL_MODULE_NAME,
|
|
22
|
+
packageName: PACKAGE_NAME,
|
|
23
|
+
serviceName: MESSAGE_DEVTOOL_SERVICE_NAME,
|
|
24
|
+
projectName: options.projectName
|
|
25
|
+
}),
|
|
26
|
+
registerDevtoolsToApplication({
|
|
27
|
+
moduleName: DEVTOOL_MODULE_NAME,
|
|
28
|
+
packageName: PACKAGE_NAME,
|
|
29
|
+
serviceName: CONSOLE_DEVTOOL_SERVICE_NAME,
|
|
30
|
+
projectName: options.projectName
|
|
31
|
+
})
|
|
32
|
+
]);
|
|
33
|
+
};
|
|
34
|
+
exports.registerDevtools = registerDevtools;
|
|
35
|
+
//# 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),
|
|
@@ -35,7 +38,7 @@ function ngAdd(options) {
|
|
|
35
38
|
version: depsInfo.packageVersion,
|
|
36
39
|
parentPackageInfo: `${depsInfo.packageName} - setup`,
|
|
37
40
|
projectName: options.projectName,
|
|
38
|
-
dependencyType
|
|
41
|
+
dependencyType,
|
|
39
42
|
workingDirectory
|
|
40
43
|
})(t, c),
|
|
41
44
|
ngAddPeerDependencyPackages(['chokidar'], packageJsonPath, NodeDependencyType.Dev, { ...options, workingDirectory, skipNgAddSchematicRun: true }, '@o3r/localization - install builder dependency'),
|
|
@@ -50,7 +53,8 @@ function ngAdd(options) {
|
|
|
50
53
|
'@o3r/core:component-presenter': {
|
|
51
54
|
useLocalization: undefined
|
|
52
55
|
}
|
|
53
|
-
})
|
|
56
|
+
}),
|
|
57
|
+
registerDevtoolRule
|
|
54
58
|
])(tree, context);
|
|
55
59
|
}
|
|
56
60
|
catch (e) {
|
|
@@ -7,12 +7,12 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* TranslateDirective class adding debug functionality
|
|
8
8
|
*/
|
|
9
9
|
export declare class LocalizationTranslateDirective extends TranslateDirective {
|
|
10
|
-
private localizationService;
|
|
11
|
-
private localizationConfig;
|
|
10
|
+
private readonly localizationService;
|
|
11
|
+
private readonly localizationConfig;
|
|
12
12
|
/**
|
|
13
13
|
* Internal subscription to the LocalizationService showKeys mode changes
|
|
14
14
|
*/
|
|
15
|
-
private onShowKeysChange?;
|
|
15
|
+
private readonly onShowKeysChange?;
|
|
16
16
|
/**
|
|
17
17
|
* Should we display keys instead of translations
|
|
18
18
|
*/
|
|
@@ -26,7 +26,6 @@ export declare class LocalizationTranslateDirective extends TranslateDirective {
|
|
|
26
26
|
constructor(localizationService: LocalizationService, translateService: TranslateService, element: ElementRef, _ref: ChangeDetectorRef, localizationConfig: LocalizationConfiguration);
|
|
27
27
|
/**
|
|
28
28
|
* Overriding parent's setContent to plug debugging feature
|
|
29
|
-
*
|
|
30
29
|
* @param node
|
|
31
30
|
* @param content
|
|
32
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization-translate.directive.d.ts","sourceRoot":"","sources":["../../src/tools/localization-translate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,UAAU,EAAiB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;GAEG;AACH,qBAGa,8BAA+B,SAAQ,kBAAkB;IA8BxD,OAAO,CAAC,mBAAmB;
|
|
1
|
+
{"version":3,"file":"localization-translate.directive.d.ts","sourceRoot":"","sources":["../../src/tools/localization-translate.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,UAAU,EAAiB,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;GAEG;AACH,qBAGa,8BAA+B,SAAQ,kBAAkB;IA8BxD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACM,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IA9BzF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAe;IAEjD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACH,OAAO,CAAC,WAAW,CAAC,CAAe;IAEnC,kBAAkB;IAClB,IACW,SAAS,CAAC,GAAG,EAAE,MAAM,EAU/B;gBAE4B,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAChF,kBAAkB,EAAE,yBAAyB;IAWpH;;;;OAIG;IACI,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAU5C,WAAW;yCAzDP,8BAA8B;2CAA9B,8BAA8B;CAkE1C"}
|
|
@@ -7,13 +7,13 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* TranslatePipe class adding debug functionality
|
|
8
8
|
*/
|
|
9
9
|
export declare class LocalizationTranslatePipe extends TranslatePipe implements PipeTransform {
|
|
10
|
-
private localizationService;
|
|
11
|
-
private changeDetector;
|
|
12
|
-
private localizationConfig;
|
|
10
|
+
private readonly localizationService;
|
|
11
|
+
private readonly changeDetector;
|
|
12
|
+
private readonly localizationConfig;
|
|
13
13
|
/**
|
|
14
14
|
* Internal subscription to the LocalizationService showKeys mode changes
|
|
15
15
|
*/
|
|
16
|
-
private onShowKeysChange?;
|
|
16
|
+
private readonly onShowKeysChange?;
|
|
17
17
|
/**
|
|
18
18
|
* Internal subscription to the LocalizationService key mapping
|
|
19
19
|
*/
|
|
@@ -29,7 +29,6 @@ export declare class LocalizationTranslatePipe extends TranslatePipe implements
|
|
|
29
29
|
constructor(localizationService: LocalizationService, translateService: TranslateService, changeDetector: ChangeDetectorRef, localizationConfig: LocalizationConfiguration);
|
|
30
30
|
/**
|
|
31
31
|
* Calls original transform method and eventually outputs the key if debugMode (in LocalizationConfiguration) is enabled
|
|
32
|
-
*
|
|
33
32
|
* @inheritdoc
|
|
34
33
|
*/
|
|
35
34
|
transform(query: string, ...args: any[]): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localization-translate.pipe.d.ts","sourceRoot":"","sources":["../../src/tools/localization-translate.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;GAEG;AACH,qBACa,yBAA0B,SAAQ,aAAc,YAAW,aAAa;IAsBvE,OAAO,CAAC,mBAAmB;IAA2D,OAAO,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"localization-translate.pipe.d.ts","sourceRoot":"","sources":["../../src/tools/localization-translate.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAgB,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAE7D;;GAEG;AACH,qBACa,yBAA0B,SAAQ,aAAc,YAAW,aAAa;IAsBvE,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAA2D,OAAO,CAAC,QAAQ,CAAC,cAAc;IACpF,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAtBzF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAe;IAEjD;;OAEG;IACH,OAAO,CAAC,WAAW,CAAC,CAAe;IAEnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAS;IAEzB,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAAC,CAAS;IAE9B,wBAAwB;IACxB,OAAO,CAAC,eAAe,CAAC,CAAS;gBAEJ,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAmB,cAAc,EAAE,iBAAiB,EACtF,kBAAkB,EAAE,yBAAyB;IAWpH;;;OAGG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG;IA8B7C,WAAW;yCApEP,yBAAyB;uCAAzB,yBAAyB;CA0ErC"}
|