@c8y/devkit 1020.14.7 → 1020.14.10
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/dist/src/webpack/EnvironmentOptions.js +1 -14
- package/dist/src/webpack/EnvironmentOptions.js.map +1 -1
- package/dist/src/webpack/config/translation.d.ts +19 -0
- package/dist/src/webpack/config/translation.js +28 -1
- package/dist/src/webpack/config/translation.js.map +1 -1
- package/package.json +3 -3
|
@@ -8,18 +8,5 @@ exports.WebpackOptions = WebpackOptions;
|
|
|
8
8
|
/**
|
|
9
9
|
* The default locales that are used when no different language is defined.
|
|
10
10
|
*/
|
|
11
|
-
exports.DEFAULT_LOCALES = [
|
|
12
|
-
'en-GB',
|
|
13
|
-
'en',
|
|
14
|
-
'ja',
|
|
15
|
-
'es',
|
|
16
|
-
'zh',
|
|
17
|
-
'pt',
|
|
18
|
-
'pl',
|
|
19
|
-
'de',
|
|
20
|
-
'fr',
|
|
21
|
-
'ko',
|
|
22
|
-
'nl',
|
|
23
|
-
'ru'
|
|
24
|
-
];
|
|
11
|
+
exports.DEFAULT_LOCALES = ['en', 'ja', 'es', 'zh', 'pt', 'pl', 'de', 'fr', 'ko', 'nl', 'ru'];
|
|
25
12
|
//# sourceMappingURL=EnvironmentOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentOptions.js","sourceRoot":"","sources":["../../../src/webpack/EnvironmentOptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,iBAAiB,GAAG,CAAC,eAAe,CAA2C,CAAC;AA2C7F,MAAa,cAAc;CAiE1B;AAjED,wCAiEC;AAED;;GAEG;AACU,QAAA,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"EnvironmentOptions.js","sourceRoot":"","sources":["../../../src/webpack/EnvironmentOptions.ts"],"names":[],"mappings":";;;AAKa,QAAA,iBAAiB,GAAG,CAAC,eAAe,CAA2C,CAAC;AA2C7F,MAAa,cAAc;CAiE1B;AAjED,wCAiEC;AAED;;GAEG;AACU,QAAA,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -8,3 +8,22 @@ export declare function config(env: EnvironmentOptions): Configuration;
|
|
|
8
8
|
* @returns A new ContextReplacementPlugin that replaces the locales in angular.
|
|
9
9
|
*/
|
|
10
10
|
export declare function getLocalesContextReplacePlugin(env: EnvironmentOptions): ContextReplacementPlugin;
|
|
11
|
+
/**
|
|
12
|
+
* The @angular/common/locales folder in node_modules contains files with names created based on RFC 3066bis.
|
|
13
|
+
* https://www.w3.org/International/articles/bcp47/
|
|
14
|
+
*
|
|
15
|
+
* Same mapping also in ngx-components: packages\ngx-components\core\i18n\i18n.module.ts
|
|
16
|
+
* TODO: unify and move to a common place e.g. @c8y/options once this not only includes types
|
|
17
|
+
*/
|
|
18
|
+
declare const angularLocalesLanguageMap: {
|
|
19
|
+
readonly en: "en-GB";
|
|
20
|
+
readonly 'en-EN': "en-GB";
|
|
21
|
+
readonly 'en-US': "en";
|
|
22
|
+
readonly 'ja-JP': "ja";
|
|
23
|
+
readonly 'zh-CN': "zh";
|
|
24
|
+
readonly 'zh-TW': "zh";
|
|
25
|
+
readonly 'pt-BR': "pt";
|
|
26
|
+
};
|
|
27
|
+
export declare function getAngularLocalesLanguageString<T extends keyof typeof angularLocalesLanguageMap = 'en'>(language?: T): (typeof angularLocalesLanguageMap)[T];
|
|
28
|
+
export declare function getAngularLocalesLanguageString<T extends string>(language: T): T;
|
|
29
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLocalesContextReplacePlugin = exports.config = void 0;
|
|
3
|
+
exports.getAngularLocalesLanguageString = exports.getLocalesContextReplacePlugin = exports.config = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const EnvironmentOptions_1 = require("../EnvironmentOptions");
|
|
6
6
|
const webpack_1 = require("webpack");
|
|
@@ -44,7 +44,34 @@ function getLocalesContextReplacePlugin(env) {
|
|
|
44
44
|
if (usedLocales.length === 0) {
|
|
45
45
|
usedLocales = EnvironmentOptions_1.DEFAULT_LOCALES;
|
|
46
46
|
}
|
|
47
|
+
// need to perform the same mapping as in ngx-components
|
|
48
|
+
// packages\ngx-components\core\i18n\translate.service.ts (loadLocales)
|
|
49
|
+
usedLocales = usedLocales.map(locale => getAngularLocalesLanguageString(locale));
|
|
47
50
|
return new webpack_1.ContextReplacementPlugin(/@angular\/common\/locales$/, new RegExp(`\\/(${usedLocales.join('|')})\\.mjs$`));
|
|
48
51
|
}
|
|
49
52
|
exports.getLocalesContextReplacePlugin = getLocalesContextReplacePlugin;
|
|
53
|
+
/**
|
|
54
|
+
* The @angular/common/locales folder in node_modules contains files with names created based on RFC 3066bis.
|
|
55
|
+
* https://www.w3.org/International/articles/bcp47/
|
|
56
|
+
*
|
|
57
|
+
* Same mapping also in ngx-components: packages\ngx-components\core\i18n\i18n.module.ts
|
|
58
|
+
* TODO: unify and move to a common place e.g. @c8y/options once this not only includes types
|
|
59
|
+
*/
|
|
60
|
+
const angularLocalesLanguageMap = {
|
|
61
|
+
en: 'en-GB',
|
|
62
|
+
'en-EN': 'en-GB',
|
|
63
|
+
'en-US': 'en',
|
|
64
|
+
'ja-JP': 'ja',
|
|
65
|
+
'zh-CN': 'zh',
|
|
66
|
+
'zh-TW': 'zh',
|
|
67
|
+
'pt-BR': 'pt'
|
|
68
|
+
};
|
|
69
|
+
function getAngularLocalesLanguageString(language = 'en') {
|
|
70
|
+
const key = language;
|
|
71
|
+
if (angularLocalesLanguageMap[key]) {
|
|
72
|
+
return angularLocalesLanguageMap[key];
|
|
73
|
+
}
|
|
74
|
+
return language;
|
|
75
|
+
}
|
|
76
|
+
exports.getAngularLocalesLanguageString = getAngularLocalesLanguageString;
|
|
50
77
|
//# sourceMappingURL=translation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/webpack/config/translation.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,8DAA4E;AAC5E,qCAAkE;AAElE,SAAgB,MAAM,CAAC,GAAuB;IAC5C,OAAO;QACL,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,QAAQ,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,sBAAsB,CAAC;aACrD;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,OAAO;oBACb,GAAG,EAAE,CAAC,QAAQ,CAAC;iBAChB;gBACD;oBACE,IAAI,EAAE,sBAAsB;oBAC5B,GAAG,EAAE;wBACH;4BACE,MAAM,EAAE,IAAA,cAAO,EAAC,SAAS,EAAE,2BAA2B,CAAC;4BACvD,OAAO,EAAE;gCACP,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,SAAS;6BAC/B;yBACF;qBACF;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AA3BD,wBA2BC;AAED;;;;;GAKG;AACH,SAAgB,8BAA8B,CAAC,GAAuB;IACpE,IAAI,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAC3D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,WAAW,GAAG,oCAAe,CAAC;IAChC,CAAC;IAED,OAAO,IAAI,kCAAwB,CACjC,4BAA4B,EAC5B,IAAI,MAAM,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CACnD,CAAC;AACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../../../src/webpack/config/translation.ts"],"names":[],"mappings":";;;AAAA,+BAA+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IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;CACL,CAAC;AAMX,SAAgB,+BAA+B,CAAC,QAAQ,GAAG,IAAI;IAC7D,MAAM,GAAG,GAAG,QAAkD,CAAC;IAC/D,IAAI,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,OAAO,yBAAyB,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAND,0EAMC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c8y/devkit",
|
|
3
|
-
"version": "1020.14.
|
|
3
|
+
"version": "1020.14.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Cumulocity",
|
|
6
6
|
"description": "Cumulocity Webpack Build Facade",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
|
47
47
|
"@babel/plugin-transform-async-to-generator": "^7.18.6",
|
|
48
48
|
"@babel/preset-env": "^7.24.4",
|
|
49
|
-
"@c8y/client": "1020.14.
|
|
50
|
-
"@c8y/options": "1020.14.
|
|
49
|
+
"@c8y/client": "1020.14.10",
|
|
50
|
+
"@c8y/options": "1020.14.10",
|
|
51
51
|
"@schematics/angular": "^17.3.1",
|
|
52
52
|
"angular-gettext-tools": "2.5.3",
|
|
53
53
|
"autoprefixer": "10.4.19",
|