@tachybase/plugin-i18n-editor 1.3.21 → 1.3.22
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/externalVersion.js +6 -9
- package/dist/node_modules/deepmerge/package.json +1 -1
- package/dist/server/actions/localization.d.ts +1 -2
- package/dist/server/actions/localization.js +6 -6
- package/dist/server/actions/localizationTexts.d.ts +1 -1
- package/dist/server/actions/localizationTexts.js +5 -6
- package/dist/server/collections/localization-texts.d.ts +1 -1
- package/dist/server/collections/localization-texts.js +2 -2
- package/dist/server/collections/localization-translations.d.ts +1 -1
- package/dist/server/collections/localization-translations.js +2 -2
- package/dist/server/migrations/20230706200900-roles-add-translation.d.ts +1 -1
- package/dist/server/migrations/20230706200900-roles-add-translation.js +1 -1
- package/dist/server/migrations/20231206161851-fix-module.d.ts +1 -1
- package/dist/server/migrations/20231206161851-fix-module.js +4 -5
- package/dist/server/plugin.d.ts +1 -1
- package/dist/server/plugin.js +1 -1
- package/dist/server/resources.d.ts +1 -2
- package/dist/server/resources.js +2 -2
- package/package.json +11 -17
package/dist/externalVersion.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.3.
|
|
4
|
-
"@tachybase/schema": "1.3.
|
|
5
|
-
"@ant-design/icons": "5.
|
|
3
|
+
"@tachybase/client": "1.3.22",
|
|
4
|
+
"@tachybase/schema": "1.3.39",
|
|
5
|
+
"@ant-design/icons": "5.6.1",
|
|
6
6
|
"ahooks": "3.9.0",
|
|
7
7
|
"antd": "5.22.5",
|
|
8
|
-
"@tachybase/
|
|
9
|
-
"@
|
|
10
|
-
"
|
|
11
|
-
"@tachybase/cache": "1.3.21",
|
|
12
|
-
"react-i18next": "15.2.0",
|
|
13
|
-
"@tachybase/actions": "1.3.21"
|
|
8
|
+
"@tachybase/module-ui-schema": "1.3.22",
|
|
9
|
+
"@tego/server": "1.3.39",
|
|
10
|
+
"react-i18next": "15.2.0"
|
|
14
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"deepmerge","description":"A library for deep (recursive) merging of Javascript objects","keywords":["merge","deep","extend","copy","clone","recursive"],"version":"4.3.1","homepage":"https://github.com/TehShrike/deepmerge","repository":{"type":"git","url":"git://github.com/TehShrike/deepmerge.git"},"main":"dist/cjs.js","engines":{"node":">=0.10.0"},"scripts":{"build":"rollup -c","test":"npm run build && tape test/*.js && jsmd readme.md && npm run test:typescript","test:typescript":"tsc --noEmit test/typescript.ts && ts-node test/typescript.ts","size":"npm run build && uglifyjs --compress --mangle -- ./dist/umd.js | gzip -c | wc -c"},"devDependencies":{"@types/node":"^8.10.54","is-mergeable-object":"1.1.0","is-plain-object":"^5.0.0","jsmd":"^1.0.2","rollup":"^1.23.1","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","tape":"^4.11.0","ts-node":"7.0.1","typescript":"=2.2.2","uglify-js":"^3.6.1"},"license":"MIT","_lastModified":"2025-07-
|
|
1
|
+
{"name":"deepmerge","description":"A library for deep (recursive) merging of Javascript objects","keywords":["merge","deep","extend","copy","clone","recursive"],"version":"4.3.1","homepage":"https://github.com/TehShrike/deepmerge","repository":{"type":"git","url":"git://github.com/TehShrike/deepmerge.git"},"main":"dist/cjs.js","engines":{"node":">=0.10.0"},"scripts":{"build":"rollup -c","test":"npm run build && tape test/*.js && jsmd readme.md && npm run test:typescript","test:typescript":"tsc --noEmit test/typescript.ts && ts-node test/typescript.ts","size":"npm run build && uglifyjs --compress --mangle -- ./dist/umd.js | gzip -c | wc -c"},"devDependencies":{"@types/node":"^8.10.54","is-mergeable-object":"1.1.0","is-plain-object":"^5.0.0","jsmd":"^1.0.2","rollup":"^1.23.1","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^5.2.0","tape":"^4.11.0","ts-node":"7.0.1","typescript":"=2.2.2","uglify-js":"^3.6.1"},"license":"MIT","_lastModified":"2025-07-29T06:19:48.203Z"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Context, Next } from '@
|
|
2
|
-
import { Database, Model } from '@tachybase/database';
|
|
1
|
+
import { Context, Database, Model, Next } from '@tego/server';
|
|
3
2
|
export declare const getResources: (ctx: Context) => Promise<any>;
|
|
4
3
|
export declare const getUISchemas: (db: Database) => Promise<Model<any, any>[]>;
|
|
5
4
|
export declare const getTextsFromDB: (db: Database) => Promise<{}>;
|
|
@@ -34,7 +34,7 @@ __export(localization_exports, {
|
|
|
34
34
|
getUISchemas: () => getUISchemas
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(localization_exports);
|
|
37
|
-
var
|
|
37
|
+
var import_server = require("@tego/server");
|
|
38
38
|
var import_constans = require("../constans");
|
|
39
39
|
var import_plugin = __toESM(require("../plugin"));
|
|
40
40
|
var import_utils = require("../utils");
|
|
@@ -50,11 +50,11 @@ const getUISchemas = async (db) => {
|
|
|
50
50
|
const uiSchemas = await db.getModel("uiSchemas").findAll({
|
|
51
51
|
attributes: ["schema"],
|
|
52
52
|
where: {
|
|
53
|
-
[
|
|
53
|
+
[import_server.Op.or]: [
|
|
54
54
|
{
|
|
55
55
|
schema: {
|
|
56
56
|
title: {
|
|
57
|
-
[
|
|
57
|
+
[import_server.Op.ne]: null
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
},
|
|
@@ -62,7 +62,7 @@ const getUISchemas = async (db) => {
|
|
|
62
62
|
schema: {
|
|
63
63
|
"x-component-props": {
|
|
64
64
|
title: {
|
|
65
|
-
[
|
|
65
|
+
[import_server.Op.ne]: null
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -71,7 +71,7 @@ const getUISchemas = async (db) => {
|
|
|
71
71
|
schema: {
|
|
72
72
|
"x-decorator-props": {
|
|
73
73
|
title: {
|
|
74
|
-
[
|
|
74
|
+
[import_server.Op.ne]: null
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -79,7 +79,7 @@ const getUISchemas = async (db) => {
|
|
|
79
79
|
{
|
|
80
80
|
schema: {
|
|
81
81
|
"x-data-templates": {
|
|
82
|
-
[
|
|
82
|
+
[import_server.Op.ne]: null
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -20,8 +20,7 @@ __export(localizationTexts_exports, {
|
|
|
20
20
|
default: () => localizationTexts_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(localizationTexts_exports);
|
|
23
|
-
var
|
|
24
|
-
var import_database = require("@tachybase/database");
|
|
23
|
+
var import_server = require("@tego/server");
|
|
25
24
|
var import_constans = require("../constans");
|
|
26
25
|
const appendTranslations = async (db, rows, locale) => {
|
|
27
26
|
const texts = rows || [];
|
|
@@ -68,9 +67,9 @@ const listText = async (db, params) => {
|
|
|
68
67
|
};
|
|
69
68
|
} else {
|
|
70
69
|
options["where"] = {
|
|
71
|
-
[
|
|
72
|
-
{ text: { [
|
|
73
|
-
{ "$translations.translation$": { [
|
|
70
|
+
[import_server.Op.or]: [
|
|
71
|
+
{ text: { [import_server.Op.like]: `%${keyword}%` } },
|
|
72
|
+
{ "$translations.translation$": { [import_server.Op.like]: `%${keyword}%` } }
|
|
74
73
|
]
|
|
75
74
|
};
|
|
76
75
|
}
|
|
@@ -83,7 +82,7 @@ const listText = async (db, params) => {
|
|
|
83
82
|
};
|
|
84
83
|
const list = async (ctx, next) => {
|
|
85
84
|
const locale = ctx.get("X-Locale") || "en-US";
|
|
86
|
-
let { page =
|
|
85
|
+
let { page = import_server.DEFAULT_PAGE, pageSize = import_server.DEFAULT_PER_PAGE, hasTranslation } = ctx.action.params;
|
|
87
86
|
page = parseInt(String(page));
|
|
88
87
|
pageSize = parseInt(String(pageSize));
|
|
89
88
|
hasTranslation = hasTranslation === "true" || hasTranslation === void 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(localization_texts_exports, {
|
|
|
20
20
|
default: () => localization_texts_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(localization_texts_exports);
|
|
23
|
-
var
|
|
24
|
-
var localization_texts_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var localization_texts_default = (0, import_server.defineCollection)({
|
|
25
25
|
dumpRules: {
|
|
26
26
|
group: "required"
|
|
27
27
|
},
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@
|
|
1
|
+
declare const _default: import("@tego/server").CollectionOptions;
|
|
2
2
|
export default _default;
|
|
@@ -20,8 +20,8 @@ __export(localization_translations_exports, {
|
|
|
20
20
|
default: () => localization_translations_default
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(localization_translations_exports);
|
|
23
|
-
var
|
|
24
|
-
var localization_translations_default = (0,
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
var localization_translations_default = (0, import_server.defineCollection)({
|
|
25
25
|
namespace: "localization.localization",
|
|
26
26
|
dumpRules: {
|
|
27
27
|
group: "required"
|
|
@@ -20,7 +20,7 @@ __export(roles_add_translation_exports, {
|
|
|
20
20
|
default: () => AddTranslationToRoleTitleMigration
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(roles_add_translation_exports);
|
|
23
|
-
var import_server = require("@
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
24
|
class AddTranslationToRoleTitleMigration extends import_server.Migration {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
@@ -20,8 +20,7 @@ __export(fix_module_exports, {
|
|
|
20
20
|
default: () => FixModuleMigration
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(fix_module_exports);
|
|
23
|
-
var
|
|
24
|
-
var import_server = require("@tachybase/server");
|
|
23
|
+
var import_server = require("@tego/server");
|
|
25
24
|
var import_localization = require("../actions/localization");
|
|
26
25
|
var import_constans = require("../constans");
|
|
27
26
|
class FixModuleMigration extends import_server.Migration {
|
|
@@ -48,7 +47,7 @@ class FixModuleMigration extends import_server.Migration {
|
|
|
48
47
|
{
|
|
49
48
|
where: {
|
|
50
49
|
text: {
|
|
51
|
-
[
|
|
50
|
+
[import_server.Op.in]: menuTexts
|
|
52
51
|
}
|
|
53
52
|
},
|
|
54
53
|
transaction: t
|
|
@@ -62,7 +61,7 @@ class FixModuleMigration extends import_server.Migration {
|
|
|
62
61
|
{
|
|
63
62
|
where: {
|
|
64
63
|
text: {
|
|
65
|
-
[
|
|
64
|
+
[import_server.Op.in]: collectionTexts
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
67
|
transaction: t
|
|
@@ -80,7 +79,7 @@ class FixModuleMigration extends import_server.Migration {
|
|
|
80
79
|
{
|
|
81
80
|
where: {
|
|
82
81
|
text: {
|
|
83
|
-
[
|
|
82
|
+
[import_server.Op.in]: texts
|
|
84
83
|
}
|
|
85
84
|
},
|
|
86
85
|
transaction: t
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleUiSchema } from '@tachybase/module-ui-schema';
|
|
2
|
-
import { InstallOptions, Plugin } from '@
|
|
2
|
+
import { InstallOptions, Plugin } from '@tego/server';
|
|
3
3
|
import Resources from './resources';
|
|
4
4
|
export declare class LocalizationManagementPlugin extends Plugin {
|
|
5
5
|
resources: Resources;
|
package/dist/server/plugin.js
CHANGED
|
@@ -31,7 +31,7 @@ __export(plugin_exports, {
|
|
|
31
31
|
default: () => plugin_default
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(plugin_exports);
|
|
34
|
-
var import_server = require("@
|
|
34
|
+
var import_server = require("@tego/server");
|
|
35
35
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
36
36
|
var import_localization = __toESM(require("./actions/localization"));
|
|
37
37
|
var import_localizationTexts = __toESM(require("./actions/localizationTexts"));
|
package/dist/server/resources.js
CHANGED
|
@@ -20,7 +20,7 @@ __export(resources_exports, {
|
|
|
20
20
|
default: () => Resources
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(resources_exports);
|
|
23
|
-
var
|
|
23
|
+
var import_node_crypto = require("node:crypto");
|
|
24
24
|
class Resources {
|
|
25
25
|
constructor(db, cache) {
|
|
26
26
|
this.cache = cache;
|
|
@@ -51,7 +51,7 @@ class Resources {
|
|
|
51
51
|
raw: true
|
|
52
52
|
});
|
|
53
53
|
this.cache.del(`translationsETag:${locale}`);
|
|
54
|
-
return { result, eTag: (0,
|
|
54
|
+
return { result, eTag: (0, import_node_crypto.randomUUID)() };
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
async getResources(locale) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-i18n-editor",
|
|
3
3
|
"displayName": "Localization",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "Allows to manage localization resources of the application.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"System management"
|
|
@@ -10,26 +10,20 @@
|
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "^5.
|
|
13
|
+
"@ant-design/icons": "^5.6.1",
|
|
14
|
+
"@tachybase/schema": "^1.3.39",
|
|
15
|
+
"@tachybase/test": "^1.3.39",
|
|
16
|
+
"@tego/client": "^1.3.39",
|
|
17
|
+
"@tego/server": "^1.3.39",
|
|
14
18
|
"ahooks": "^3.9.0",
|
|
15
19
|
"antd": "5.22.5",
|
|
16
20
|
"deepmerge": "^4.3.1",
|
|
17
|
-
"react-i18next": "
|
|
18
|
-
"@tachybase/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"@tachybase/cache": "1.3.21",
|
|
22
|
-
"@tachybase/client": "1.3.21",
|
|
23
|
-
"@tachybase/database": "1.3.21",
|
|
24
|
-
"@tachybase/module-ui-schema": "1.3.21",
|
|
25
|
-
"@tachybase/actions": "1.3.21",
|
|
26
|
-
"@tachybase/module-web": "1.3.21",
|
|
27
|
-
"@tachybase/server": "1.3.21",
|
|
28
|
-
"@tachybase/test": "1.3.21"
|
|
21
|
+
"react-i18next": "15.2.0",
|
|
22
|
+
"@tachybase/client": "1.3.22",
|
|
23
|
+
"@tachybase/module-ui-schema": "1.3.22",
|
|
24
|
+
"@tachybase/module-web": "1.3.22"
|
|
29
25
|
},
|
|
30
26
|
"description.zh-CN": "支持管理应用程序的本地化资源。",
|
|
31
27
|
"displayName.zh-CN": "本地化",
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tachybase-build --no-dts @tachybase/plugin-i18n-editor"
|
|
34
|
-
}
|
|
28
|
+
"scripts": {}
|
|
35
29
|
}
|