@o3r/localization 10.0.0-prerelease.5 → 10.0.0-prerelease.50
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 +7 -7
- package/builders/i18n/index.d.ts.map +1 -1
- package/builders/i18n/index.js +3 -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 -2
- package/esm2022/core/translate-messageformat-lazy.compiler.mjs +3 -3
- package/esm2022/devkit/localization-devtools.console.service.mjs +3 -3
- package/esm2022/devkit/localization-devtools.message.service.mjs +3 -3
- package/esm2022/devkit/localization-devtools.module.mjs +4 -4
- package/esm2022/devkit/localization-devtools.service.mjs +3 -3
- package/esm2022/rules-engine/localization.handler-action.mjs +3 -3
- package/esm2022/rules-engine/localization.rules-engine.module.mjs +4 -4
- package/esm2022/stores/localization-override/localization-override.module.mjs +4 -4
- package/esm2022/tools/localization-translate.directive.mjs +3 -3
- package/esm2022/tools/localization-translate.pipe.mjs +18 -6
- package/esm2022/tools/localization.module.mjs +8 -8
- package/esm2022/tools/localization.service.mjs +3 -3
- package/esm2022/tools/localized-currency.pipe.mjs +3 -3
- package/esm2022/tools/localized-date.pipe.mjs +3 -3
- package/esm2022/tools/localized-decimal.pipe.mjs +3 -3
- package/esm2022/tools/text-direction.service.mjs +3 -3
- package/esm2022/tools/text-directionality.service.mjs +3 -3
- package/esm2022/tools/translations-loader.mjs +3 -3
- package/fesm2022/o3r-localization-rules-engine.mjs +7 -7
- package/fesm2022/o3r-localization.mjs +69 -57
- package/fesm2022/o3r-localization.mjs.map +1 -1
- package/migration.json +10 -0
- package/package.json +7 -7
- package/schematics/add-localization-key/index.d.ts +6 -2
- package/schematics/add-localization-key/index.d.ts.map +1 -1
- package/schematics/add-localization-key/index.js +12 -8
- package/schematics/cms-adapter/index.d.ts +2 -3
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +7 -3
- package/schematics/localization-base/index.d.ts +2 -7
- package/schematics/localization-base/index.d.ts.map +1 -1
- package/schematics/localization-base/index.js +2 -2
- package/schematics/localization-to-component/index.d.ts +6 -2
- package/schematics/localization-to-component/index.d.ts.map +1 -1
- package/schematics/localization-to-component/index.js +10 -6
- package/schematics/ng-add/index.d.ts +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +6 -2
- package/schematics/ng-update/v10-0/index.d.ts +6 -0
- package/schematics/ng-update/v10-0/index.d.ts.map +1 -0
- package/schematics/ng-update/v10-0/index.js +30 -0
- package/tools/localization-translate.pipe.d.ts +18 -9
- package/tools/localization-translate.pipe.d.ts.map +1 -1
- package/tools/localization.module.d.ts +1 -1
|
@@ -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,CAgb/G;AAiDD,eAAO,MAAM,UAAU;kBA1CuB,MAAM,GAAG,SAAS;UA0Ca,CAAC"}
|
|
@@ -367,7 +367,7 @@ exports.updateLocalization = updateLocalization;
|
|
|
367
367
|
* @param options
|
|
368
368
|
* @param options.projectName
|
|
369
369
|
*/
|
|
370
|
-
function
|
|
370
|
+
function updateI18nFn(options) {
|
|
371
371
|
if (!options.projectName) {
|
|
372
372
|
return schematics_1.noop;
|
|
373
373
|
}
|
|
@@ -403,5 +403,5 @@ function updateI18n(options) {
|
|
|
403
403
|
updateAngularJson
|
|
404
404
|
]);
|
|
405
405
|
}
|
|
406
|
-
exports.updateI18n =
|
|
406
|
+
exports.updateI18n = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateI18nFn);
|
|
407
407
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,8 +2,12 @@ import { Rule } from '@angular-devkit/schematics';
|
|
|
2
2
|
import type { NgAddLocalizationSchematicsSchema } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Add localization architecture to an existing component
|
|
5
|
-
*
|
|
6
5
|
* @param options
|
|
7
6
|
*/
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function ngAddLocalizationFn(options: NgAddLocalizationSchematicsSchema): Rule;
|
|
8
|
+
/**
|
|
9
|
+
* Add localization architecture to an existing component
|
|
10
|
+
* @param options
|
|
11
|
+
*/
|
|
12
|
+
export declare const ngAddLocalization: (options: NgAddLocalizationSchematicsSchema) => Rule;
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAsBpC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAkClE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iCAAiC,GAAG,IAAI,CA6SpF;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,sDAA6D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ngAddLocalization = void 0;
|
|
3
|
+
exports.ngAddLocalization = exports.ngAddLocalizationFn = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
5
|
const schematics_2 = require("@o3r/schematics");
|
|
6
6
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
@@ -29,10 +29,9 @@ const checkLocalization = (componentPath, tree, baseFileName) => {
|
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Add localization architecture to an existing component
|
|
32
|
-
*
|
|
33
32
|
* @param options
|
|
34
33
|
*/
|
|
35
|
-
function
|
|
34
|
+
function ngAddLocalizationFn(options) {
|
|
36
35
|
return async (tree, context) => {
|
|
37
36
|
try {
|
|
38
37
|
const baseFileName = (0, node_path_1.basename)(options.path, '.component.ts');
|
|
@@ -131,7 +130,7 @@ function ngAddLocalization(options) {
|
|
|
131
130
|
if (templatePath && tree.exists(templatePath)) {
|
|
132
131
|
tree.commitUpdate(tree
|
|
133
132
|
.beginUpdate(templatePath)
|
|
134
|
-
.insertLeft(0, '<div>Localization: {{ translations.dummyLoc1 |
|
|
133
|
+
.insertLeft(0, '<div>Localization: {{ translations.dummyLoc1 | o3rTranslate }}</div>\n'));
|
|
135
134
|
}
|
|
136
135
|
return tree;
|
|
137
136
|
};
|
|
@@ -231,7 +230,7 @@ const mockTranslationsCompilerProvider: Provider = {
|
|
|
231
230
|
(0, schematics_1.externalSchematic)('@o3r/core', 'convert-component', {
|
|
232
231
|
path: options.path
|
|
233
232
|
}),
|
|
234
|
-
|
|
233
|
+
ngAddLocalizationFn(options)
|
|
235
234
|
]);
|
|
236
235
|
}
|
|
237
236
|
}
|
|
@@ -239,5 +238,10 @@ const mockTranslationsCompilerProvider: Provider = {
|
|
|
239
238
|
}
|
|
240
239
|
};
|
|
241
240
|
}
|
|
242
|
-
exports.
|
|
241
|
+
exports.ngAddLocalizationFn = ngAddLocalizationFn;
|
|
242
|
+
/**
|
|
243
|
+
* Add localization architecture to an existing component
|
|
244
|
+
* @param options
|
|
245
|
+
*/
|
|
246
|
+
exports.ngAddLocalization = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddLocalizationFn);
|
|
243
247
|
//# sourceMappingURL=index.js.map
|
|
@@ -4,5 +4,5 @@ import type { NgAddSchematicsSchema } from './schema';
|
|
|
4
4
|
* Add Otter localization to an Angular Project
|
|
5
5
|
* @param options for the dependencies installations
|
|
6
6
|
*/
|
|
7
|
-
export declare
|
|
7
|
+
export declare const ngAdd: (options: NgAddSchematicsSchema) => Rule;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AA+DtD;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
|
|
@@ -11,7 +11,7 @@ const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
|
11
11
|
* Add Otter localization to an Angular Project
|
|
12
12
|
* @param options for the dependencies installations
|
|
13
13
|
*/
|
|
14
|
-
function
|
|
14
|
+
function ngAddFn(options) {
|
|
15
15
|
return async (tree, context) => {
|
|
16
16
|
try {
|
|
17
17
|
const { applyEsLintFix, install, getProjectNewDependenciesType, getWorkspaceConfig, ngAddPackages, ngAddPeerDependencyPackages, getO3rPeerDeps } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
|
@@ -66,5 +66,9 @@ function ngAdd(options) {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Add Otter localization to an Angular Project
|
|
71
|
+
* @param options for the dependencies installations
|
|
72
|
+
*/
|
|
73
|
+
exports.ngAdd = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddFn);
|
|
70
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10-0/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AA0BjF;;GAEG;AACH,eAAO,MAAM,WAAW,4BAAuD,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateV10_0 = void 0;
|
|
4
|
+
/* eslint-disable camelcase, @typescript-eslint/naming-convention */
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const schematics_2 = require("@o3r/schematics");
|
|
7
|
+
const pipeReplacementInfo = {
|
|
8
|
+
translate: {
|
|
9
|
+
new: {
|
|
10
|
+
name: 'o3rTranslate'
|
|
11
|
+
},
|
|
12
|
+
import: 'LocalizationModule'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Update of Otter library V10.0
|
|
17
|
+
*/
|
|
18
|
+
function updateV10_0Fn() {
|
|
19
|
+
return (tree, context) => {
|
|
20
|
+
const updateRules = [
|
|
21
|
+
(0, schematics_2.updatePipes)(pipeReplacementInfo)
|
|
22
|
+
];
|
|
23
|
+
return (0, schematics_1.chain)(updateRules)(tree, context);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Update of Otter library V10.0
|
|
28
|
+
*/
|
|
29
|
+
exports.updateV10_0 = (0, schematics_2.createSchematicWithMetricsIfInstalled)(updateV10_0Fn);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { ChangeDetectorRef, PipeTransform } from '@angular/core';
|
|
2
2
|
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
|
3
|
+
import { Subscription } from 'rxjs';
|
|
3
4
|
import { LocalizationConfiguration } from '../core';
|
|
4
5
|
import { LocalizationService } from './localization.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
/**
|
|
7
8
|
* TranslatePipe class adding debug functionality
|
|
8
9
|
*/
|
|
9
|
-
export declare class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export declare class O3rLocalizationTranslatePipe extends TranslatePipe implements PipeTransform {
|
|
11
|
+
protected readonly localizationService: LocalizationService;
|
|
12
|
+
protected readonly changeDetector: ChangeDetectorRef;
|
|
13
|
+
protected readonly localizationConfig: LocalizationConfiguration;
|
|
13
14
|
/**
|
|
14
15
|
* Internal subscription to the LocalizationService showKeys mode changes
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
protected readonly onShowKeysChange?: Subscription;
|
|
17
18
|
/**
|
|
18
19
|
* Internal subscription to the LocalizationService key mapping
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
protected onKeyChange?: Subscription;
|
|
21
22
|
/**
|
|
22
23
|
* Should we display keys instead of translations
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
+
protected showKeys: boolean;
|
|
25
26
|
/** last key queried */
|
|
26
|
-
|
|
27
|
+
protected lastQueryKey?: string;
|
|
27
28
|
/** last key resolved */
|
|
28
|
-
|
|
29
|
+
protected lastResolvedKey?: string;
|
|
29
30
|
constructor(localizationService: LocalizationService, translateService: TranslateService, changeDetector: ChangeDetectorRef, localizationConfig: LocalizationConfiguration);
|
|
30
31
|
/**
|
|
31
32
|
* Calls original transform method and eventually outputs the key if debugMode (in LocalizationConfiguration) is enabled
|
|
@@ -33,6 +34,14 @@ export declare class LocalizationTranslatePipe extends TranslatePipe implements
|
|
|
33
34
|
*/
|
|
34
35
|
transform(query: string, ...args: any[]): any;
|
|
35
36
|
ngOnDestroy(): void;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<O3rLocalizationTranslatePipe, never>;
|
|
38
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<O3rLocalizationTranslatePipe, "o3rTranslate", false>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* TranslatePipe class adding debug functionality
|
|
42
|
+
* @deprecated please use O3rLocalizationTranslatePipe, will be removed in v12.
|
|
43
|
+
*/
|
|
44
|
+
export declare class LocalizationTranslatePipe extends O3rLocalizationTranslatePipe implements PipeTransform {
|
|
36
45
|
static ɵfac: i0.ɵɵFactoryDeclaration<LocalizationTranslatePipe, never>;
|
|
37
46
|
static ɵpipe: i0.ɵɵPipeDeclaration<LocalizationTranslatePipe, "translate", false>;
|
|
38
47
|
}
|
|
@@ -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;
|
|
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;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;;AAG7D;;GAEG;AACH,qBACa,4BAA6B,SAAQ,aAAc,YAAW,aAAa;IAsB1E,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB;IAAsC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,iBAAiB;IAC3G,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,yBAAyB;IAtBtH;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAEnD;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;IAErC;;OAEG;IACH,SAAS,CAAC,QAAQ,UAAS;IAE3B,uBAAuB;IACvB,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEhC,wBAAwB;IACxB,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;gBAEJ,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAqB,cAAc,EAAE,iBAAiB,EACxF,kBAAkB,EAAE,yBAAyB;IAWtH;;;OAGG;IACI,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG;IA8B7C,WAAW;yCApEP,4BAA4B;uCAA5B,4BAA4B;CA0ExC;AAED;;;GAGG;AACH,qBACa,yBAA0B,SAAQ,4BAA6B,YAAW,aAAa;yCAAvF,yBAAyB;uCAAzB,yBAAyB;CAAiE"}
|
|
@@ -35,7 +35,7 @@ export declare class LocalizationModule {
|
|
|
35
35
|
*/
|
|
36
36
|
static forRoot(configuration?: () => Partial<LocalizationConfiguration>): ModuleWithProviders<LocalizationModule>;
|
|
37
37
|
static ɵfac: i0.ɵɵFactoryDeclaration<LocalizationModule, never>;
|
|
38
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<LocalizationModule, [typeof i1.LocalizationTranslatePipe, typeof i2.LocalizationTranslateDirective, typeof i3.LocalizedDatePipe, typeof i4.LocalizedDecimalPipe, typeof i5.LocalizedCurrencyPipe], [typeof i6.TranslateModule, typeof i7.BidiModule, typeof i8.DynamicContentModule, typeof i9.CommonModule], [typeof i6.TranslateModule, typeof i1.LocalizationTranslatePipe, typeof i2.LocalizationTranslateDirective, typeof i3.LocalizedDatePipe, typeof i4.LocalizedDecimalPipe, typeof i5.LocalizedCurrencyPipe]>;
|
|
38
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LocalizationModule, [typeof i1.O3rLocalizationTranslatePipe, typeof i1.LocalizationTranslatePipe, typeof i2.LocalizationTranslateDirective, typeof i3.LocalizedDatePipe, typeof i4.LocalizedDecimalPipe, typeof i5.LocalizedCurrencyPipe], [typeof i6.TranslateModule, typeof i7.BidiModule, typeof i8.DynamicContentModule, typeof i9.CommonModule], [typeof i6.TranslateModule, typeof i1.O3rLocalizationTranslatePipe, typeof i1.LocalizationTranslatePipe, typeof i2.LocalizationTranslateDirective, typeof i3.LocalizedDatePipe, typeof i4.LocalizedDecimalPipe, typeof i5.LocalizedCurrencyPipe]>;
|
|
39
39
|
static ɵinj: i0.ɵɵInjectorDeclaration<LocalizationModule>;
|
|
40
40
|
}
|
|
41
41
|
//# sourceMappingURL=localization.module.d.ts.map
|