@aidc-toolkit/core 0.9.13-beta → 0.9.15-beta
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/index.cjs +116 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +14 -56
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -1
- package/dist/locale/i18n.d.ts +64 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/package.json +9 -7
- package/resource/icon-1024.png +0 -0
- package/resource/icon-128.png +0 -0
- package/resource/icon-16.png +0 -0
- package/resource/icon-256.png +0 -0
- package/resource/icon-32.png +0 -0
- package/resource/icon-512.png +0 -0
- package/resource/icon-64.png +0 -0
- package/resource/icon-80.png +0 -0
- package/src/locale/i18n.ts +7 -0
- package/resource/icon-1152.png +0 -0
- package/resource/icon-144.png +0 -0
- package/resource/icon-288.png +0 -0
- package/resource/icon-576.png +0 -0
- package/resource/icon-72.png +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,119 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
I18NEnvironment: () => I18NEnvironment,
|
|
34
|
+
i18nAssertValidResources: () => i18nAssertValidResources,
|
|
35
|
+
i18nCoreInit: () => i18nCoreInit
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
|
|
39
|
+
// src/locale/i18n.ts
|
|
40
|
+
var import_i18next_browser_languagedetector = __toESM(require("i18next-browser-languagedetector"), 1);
|
|
41
|
+
var import_i18next_cli_language_detector = __toESM(require("i18next-cli-language-detector"), 1);
|
|
42
|
+
var I18NEnvironment = /* @__PURE__ */ ((I18NEnvironment2) => {
|
|
43
|
+
I18NEnvironment2[I18NEnvironment2["CLI"] = 0] = "CLI";
|
|
44
|
+
I18NEnvironment2[I18NEnvironment2["Server"] = 1] = "Server";
|
|
45
|
+
I18NEnvironment2[I18NEnvironment2["Browser"] = 2] = "Browser";
|
|
46
|
+
return I18NEnvironment2;
|
|
47
|
+
})(I18NEnvironment || {});
|
|
48
|
+
function i18nAssertValidResources(enResources, lng, lngResources, parent) {
|
|
49
|
+
const enResourcesMap = new Map(Object.entries(enResources));
|
|
50
|
+
const lngResourcesMap = new Map(Object.entries(lngResources));
|
|
51
|
+
const isLocale = lng.includes("-");
|
|
52
|
+
for (const [enKey, enValue] of enResourcesMap) {
|
|
53
|
+
const lngValue = lngResourcesMap.get(enKey);
|
|
54
|
+
if (lngValue !== void 0) {
|
|
55
|
+
const enValueType = typeof enValue;
|
|
56
|
+
const lngValueType = typeof lngValue;
|
|
57
|
+
if (lngValueType !== enValueType) {
|
|
58
|
+
throw new Error(`Invalid value type ${lngValueType} for key ${parent === void 0 ? "" : `${parent}.`}${enKey} in ${lng} resources`);
|
|
59
|
+
}
|
|
60
|
+
if (enValueType === "object") {
|
|
61
|
+
i18nAssertValidResources(enValue, lng, lngValue, `${parent === void 0 ? "" : `${parent}.`}${enKey}`);
|
|
62
|
+
}
|
|
63
|
+
} else if (!isLocale) {
|
|
64
|
+
throw new Error(`Missing key ${parent === void 0 ? "" : `${parent}.`}${enKey} from ${lng} resources`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
for (const [lngKey] of lngResourcesMap) {
|
|
68
|
+
if (!enResourcesMap.has(lngKey)) {
|
|
69
|
+
throw new Error(`Extraneous key ${parent === void 0 ? "" : `${parent}.`}${lngKey} in ${lng} resources`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function toLowerCase(s) {
|
|
74
|
+
return s.split(" ").map((word) => /[a-z]/.test(word) ? word.toLowerCase() : word).join(" ");
|
|
75
|
+
}
|
|
76
|
+
async function i18nCoreInit(i18next, environment, debug, defaultNS, ...resources) {
|
|
77
|
+
if (!i18next.isInitialized) {
|
|
78
|
+
const mergedResource = {};
|
|
79
|
+
for (const resource of resources) {
|
|
80
|
+
for (const [language, resourceLanguage] of Object.entries(resource)) {
|
|
81
|
+
if (!(language in mergedResource)) {
|
|
82
|
+
mergedResource[language] = {};
|
|
83
|
+
}
|
|
84
|
+
const mergedResourceLanguage = mergedResource[language];
|
|
85
|
+
for (const [namespace, resourceKey] of Object.entries(resourceLanguage)) {
|
|
86
|
+
mergedResourceLanguage[namespace] = resourceKey;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
let module2;
|
|
91
|
+
switch (environment) {
|
|
92
|
+
case 0 /* CLI */:
|
|
93
|
+
module2 = import_i18next_cli_language_detector.default;
|
|
94
|
+
break;
|
|
95
|
+
case 2 /* Browser */:
|
|
96
|
+
module2 = import_i18next_browser_languagedetector.default;
|
|
97
|
+
break;
|
|
98
|
+
default:
|
|
99
|
+
throw new Error("Not supported");
|
|
100
|
+
}
|
|
101
|
+
await i18next.use(module2).init({
|
|
102
|
+
debug,
|
|
103
|
+
resources: mergedResource,
|
|
104
|
+
fallbackLng: "en",
|
|
105
|
+
defaultNS
|
|
106
|
+
}).then(() => {
|
|
107
|
+
i18next.services.formatter?.add("toLowerCase", (value) => typeof value === "string" ? toLowerCase(value) : String(value));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
I18NEnvironment,
|
|
114
|
+
i18nAssertValidResources,
|
|
115
|
+
i18nCoreInit
|
|
116
|
+
});
|
|
2
117
|
/*!
|
|
3
118
|
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
4
119
|
* contributors
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { i18n, Resource } from 'i18next';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Locale strings type for generic manipulation.
|
|
5
|
+
*/
|
|
6
|
+
interface LocaleStrings {
|
|
7
|
+
[key: string]: LocaleStrings | string;
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* Internationalization operating environment.
|
|
5
11
|
*/
|
|
@@ -57,4 +63,4 @@ declare function i18nAssertValidResources(enResources: object, lng: string, lngR
|
|
|
57
63
|
*/
|
|
58
64
|
declare function i18nCoreInit(i18next: i18n, environment: I18NEnvironment, debug: boolean, defaultNS: string, ...resources: Resource[]): Promise<void>;
|
|
59
65
|
|
|
60
|
-
export { I18NEnvironment, i18nAssertValidResources, i18nCoreInit };
|
|
66
|
+
export { I18NEnvironment, type LocaleStrings, i18nAssertValidResources, i18nCoreInit };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,60 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Internationalization operating environment.
|
|
5
|
-
*/
|
|
6
|
-
declare enum I18NEnvironment {
|
|
7
|
-
/**
|
|
8
|
-
* Command-line interface (e.g., unit tests).
|
|
9
|
-
*/
|
|
10
|
-
CLI = 0,
|
|
11
|
-
/**
|
|
12
|
-
* Web server.
|
|
13
|
-
*/
|
|
14
|
-
Server = 1,
|
|
15
|
-
/**
|
|
16
|
-
* Web browser.
|
|
17
|
-
*/
|
|
18
|
-
Browser = 2
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Assert that language resources are a type match for English (default) resources.
|
|
22
|
-
*
|
|
23
|
-
* @param enResources
|
|
24
|
-
* English resources.
|
|
25
|
-
*
|
|
26
|
-
* @param lng
|
|
27
|
-
* Language.
|
|
28
|
-
*
|
|
29
|
-
* @param lngResources
|
|
30
|
-
* Language resources.
|
|
31
|
-
*
|
|
32
|
-
* @param parent
|
|
33
|
-
* Parent key name (set recursively).
|
|
34
|
-
*/
|
|
35
|
-
declare function i18nAssertValidResources(enResources: object, lng: string, lngResources: object, parent?: string): void;
|
|
36
|
-
/**
|
|
37
|
-
* Initialize internationalization.
|
|
38
|
-
*
|
|
39
|
-
* @param i18next
|
|
40
|
-
* Internationalization object. As multiple objects exists, this parameter represents the one for the module for which
|
|
41
|
-
* internationalization is being initialized.
|
|
42
|
-
*
|
|
43
|
-
* @param environment
|
|
44
|
-
* Environment in which the application is running.
|
|
45
|
-
*
|
|
46
|
-
* @param debug
|
|
47
|
-
* Debug setting.
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
3
|
+
* contributors
|
|
48
4
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
51
8
|
*
|
|
52
|
-
*
|
|
53
|
-
* Resources.
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
54
10
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
57
16
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export { I18NEnvironment, i18nAssertValidResources, i18nCoreInit };
|
|
17
|
+
export * from "./locale/i18n.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/i18n.ts
|
|
2
|
+
import I18nextBrowserLanguageDetector from "i18next-browser-languagedetector";
|
|
3
|
+
import I18nextCLILanguageDetector from "i18next-cli-language-detector";
|
|
4
|
+
var I18NEnvironment = /* @__PURE__ */ ((I18NEnvironment2) => {
|
|
5
|
+
I18NEnvironment2[I18NEnvironment2["CLI"] = 0] = "CLI";
|
|
6
|
+
I18NEnvironment2[I18NEnvironment2["Server"] = 1] = "Server";
|
|
7
|
+
I18NEnvironment2[I18NEnvironment2["Browser"] = 2] = "Browser";
|
|
8
|
+
return I18NEnvironment2;
|
|
9
|
+
})(I18NEnvironment || {});
|
|
10
|
+
function i18nAssertValidResources(enResources, lng, lngResources, parent) {
|
|
11
|
+
const enResourcesMap = new Map(Object.entries(enResources));
|
|
12
|
+
const lngResourcesMap = new Map(Object.entries(lngResources));
|
|
13
|
+
const isLocale = lng.includes("-");
|
|
14
|
+
for (const [enKey, enValue] of enResourcesMap) {
|
|
15
|
+
const lngValue = lngResourcesMap.get(enKey);
|
|
16
|
+
if (lngValue !== void 0) {
|
|
17
|
+
const enValueType = typeof enValue;
|
|
18
|
+
const lngValueType = typeof lngValue;
|
|
19
|
+
if (lngValueType !== enValueType) {
|
|
20
|
+
throw new Error(`Invalid value type ${lngValueType} for key ${parent === void 0 ? "" : `${parent}.`}${enKey} in ${lng} resources`);
|
|
21
|
+
}
|
|
22
|
+
if (enValueType === "object") {
|
|
23
|
+
i18nAssertValidResources(enValue, lng, lngValue, `${parent === void 0 ? "" : `${parent}.`}${enKey}`);
|
|
24
|
+
}
|
|
25
|
+
} else if (!isLocale) {
|
|
26
|
+
throw new Error(`Missing key ${parent === void 0 ? "" : `${parent}.`}${enKey} from ${lng} resources`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const [lngKey] of lngResourcesMap) {
|
|
30
|
+
if (!enResourcesMap.has(lngKey)) {
|
|
31
|
+
throw new Error(`Extraneous key ${parent === void 0 ? "" : `${parent}.`}${lngKey} in ${lng} resources`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function toLowerCase(s) {
|
|
36
|
+
return s.split(" ").map((word) => /[a-z]/.test(word) ? word.toLowerCase() : word).join(" ");
|
|
37
|
+
}
|
|
38
|
+
async function i18nCoreInit(i18next, environment, debug, defaultNS, ...resources) {
|
|
39
|
+
if (!i18next.isInitialized) {
|
|
40
|
+
const mergedResource = {};
|
|
41
|
+
for (const resource of resources) {
|
|
42
|
+
for (const [language, resourceLanguage] of Object.entries(resource)) {
|
|
43
|
+
if (!(language in mergedResource)) {
|
|
44
|
+
mergedResource[language] = {};
|
|
45
|
+
}
|
|
46
|
+
const mergedResourceLanguage = mergedResource[language];
|
|
47
|
+
for (const [namespace, resourceKey] of Object.entries(resourceLanguage)) {
|
|
48
|
+
mergedResourceLanguage[namespace] = resourceKey;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
let module;
|
|
53
|
+
switch (environment) {
|
|
54
|
+
case 0 /* CLI */:
|
|
55
|
+
module = I18nextCLILanguageDetector;
|
|
56
|
+
break;
|
|
57
|
+
case 2 /* Browser */:
|
|
58
|
+
module = I18nextBrowserLanguageDetector;
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
throw new Error("Not supported");
|
|
62
|
+
}
|
|
63
|
+
await i18next.use(module).init({
|
|
64
|
+
debug,
|
|
65
|
+
resources: mergedResource,
|
|
66
|
+
fallbackLng: "en",
|
|
67
|
+
defaultNS
|
|
68
|
+
}).then(() => {
|
|
69
|
+
i18next.services.formatter?.add("toLowerCase", (value) => typeof value === "string" ? toLowerCase(value) : String(value));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
I18NEnvironment,
|
|
75
|
+
i18nAssertValidResources,
|
|
76
|
+
i18nCoreInit
|
|
77
|
+
};
|
|
2
78
|
/*!
|
|
3
79
|
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
4
80
|
* contributors
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { i18n, Resource } from "i18next";
|
|
2
|
+
/**
|
|
3
|
+
* Locale strings type for generic manipulation.
|
|
4
|
+
*/
|
|
5
|
+
export interface LocaleStrings {
|
|
6
|
+
[key: string]: LocaleStrings | string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Internationalization operating environment.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum I18NEnvironment {
|
|
12
|
+
/**
|
|
13
|
+
* Command-line interface (e.g., unit tests).
|
|
14
|
+
*/
|
|
15
|
+
CLI = 0,
|
|
16
|
+
/**
|
|
17
|
+
* Web server.
|
|
18
|
+
*/
|
|
19
|
+
Server = 1,
|
|
20
|
+
/**
|
|
21
|
+
* Web browser.
|
|
22
|
+
*/
|
|
23
|
+
Browser = 2
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Assert that language resources are a type match for English (default) resources.
|
|
27
|
+
*
|
|
28
|
+
* @param enResources
|
|
29
|
+
* English resources.
|
|
30
|
+
*
|
|
31
|
+
* @param lng
|
|
32
|
+
* Language.
|
|
33
|
+
*
|
|
34
|
+
* @param lngResources
|
|
35
|
+
* Language resources.
|
|
36
|
+
*
|
|
37
|
+
* @param parent
|
|
38
|
+
* Parent key name (set recursively).
|
|
39
|
+
*/
|
|
40
|
+
export declare function i18nAssertValidResources(enResources: object, lng: string, lngResources: object, parent?: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Initialize internationalization.
|
|
43
|
+
*
|
|
44
|
+
* @param i18next
|
|
45
|
+
* Internationalization object. As multiple objects exists, this parameter represents the one for the module for which
|
|
46
|
+
* internationalization is being initialized.
|
|
47
|
+
*
|
|
48
|
+
* @param environment
|
|
49
|
+
* Environment in which the application is running.
|
|
50
|
+
*
|
|
51
|
+
* @param debug
|
|
52
|
+
* Debug setting.
|
|
53
|
+
*
|
|
54
|
+
* @param defaultNS
|
|
55
|
+
* Default namespace.
|
|
56
|
+
*
|
|
57
|
+
* @param resources
|
|
58
|
+
* Resources.
|
|
59
|
+
*
|
|
60
|
+
* @returns
|
|
61
|
+
* Void promise.
|
|
62
|
+
*/
|
|
63
|
+
export declare function i18nCoreInit(i18next: i18n, environment: I18NEnvironment, debug: boolean, defaultNS: string, ...resources: Resource[]): Promise<void>;
|
|
64
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,QAAQ,EAAE,MAAM,SAAS,CAAC;AAItE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,GAAG,IAAA;IAEH;;OAEG;IACH,MAAM,IAAA;IAEN;;OAEG;IACH,OAAO,IAAA;CACV;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CA+BtH;AAgBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiD1J"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.15-beta",
|
|
4
4
|
"description": "Core functionality for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://aidc-toolkit.com/",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/aidc-toolkit/core.git"
|
|
@@ -19,18 +19,20 @@
|
|
|
19
19
|
"url": "https://www.linkedin.com/in/kdean"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"build:
|
|
22
|
+
"update-aidc-toolkit": "npm update @aidc-toolkit/dev",
|
|
23
|
+
"lint": "eslint",
|
|
24
|
+
"build:core": "tsup --config node_modules/@aidc-toolkit/dev/tsup.config.ts",
|
|
25
|
+
"build:dev": "npm run build:core && tsc --project node_modules/@aidc-toolkit/dev/tsconfig-declaration.json",
|
|
25
26
|
"build:release": "npm run build:core -- --minify",
|
|
27
|
+
"build:doc": "npm run build:dev",
|
|
26
28
|
"publish-dev": "publish-dev"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
|
-
"@aidc-toolkit/dev": "^0.9.
|
|
31
|
+
"@aidc-toolkit/dev": "^0.9.15-beta"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
34
|
"i18next": "^24.2.2",
|
|
33
|
-
"i18next-browser-languagedetector": "^8.0.
|
|
35
|
+
"i18next-browser-languagedetector": "^8.0.4",
|
|
34
36
|
"i18next-cli-language-detector": "^1.1.8"
|
|
35
37
|
}
|
|
36
38
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/locale/i18n.ts
CHANGED
|
@@ -2,6 +2,13 @@ import type { i18n, LanguageDetectorModule, Resource } from "i18next";
|
|
|
2
2
|
import I18nextBrowserLanguageDetector from "i18next-browser-languagedetector";
|
|
3
3
|
import I18nextCLILanguageDetector from "i18next-cli-language-detector";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Locale strings type for generic manipulation.
|
|
7
|
+
*/
|
|
8
|
+
export interface LocaleStrings {
|
|
9
|
+
[key: string]: LocaleStrings | string;
|
|
10
|
+
}
|
|
11
|
+
|
|
5
12
|
/**
|
|
6
13
|
* Internationalization operating environment.
|
|
7
14
|
*/
|
package/resource/icon-1152.png
DELETED
|
Binary file
|
package/resource/icon-144.png
DELETED
|
Binary file
|
package/resource/icon-288.png
DELETED
|
Binary file
|
package/resource/icon-576.png
DELETED
|
Binary file
|
package/resource/icon-72.png
DELETED
|
Binary file
|