@liujitcn/kratos-admin-system 0.0.28 → 0.0.29
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 +1 -1
- package/dist/package/declarations/src/api/system/base_i18n.d.ts +5 -5
- package/dist/package/declarations/src/components/DynamicI18nCell.vue.d.ts +16 -0
- package/dist/package/declarations/src/components/DynamicI18nEditor.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/dynamicI18n.d.ts +38 -0
- package/dist/package/declarations/src/locales/generated.d.ts +52 -52
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +3 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +4 -4
- package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +23 -23
- package/dist/package/declarations/src/rpc/system/admin/v1/base_menu.d.ts +2 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/code_gen.d.ts +1 -1
- package/dist/package/src/api/system/base_i18n.ts +12 -12
- package/dist/package/src/components/{DynamicTranslationCell.vue → DynamicI18nCell.vue} +50 -50
- package/dist/package/src/components/{DynamicTranslationEditor.vue → DynamicI18nEditor.vue} +45 -45
- package/dist/package/src/components/{dynamicTranslation.ts → dynamicI18n.ts} +15 -15
- package/dist/package/src/locales/README.md +1 -1
- package/dist/package/src/locales/en-US.json +15 -15
- package/dist/package/src/locales/ja-JP.json +13 -13
- package/dist/package/src/locales/zh-CN.json +13 -13
- package/dist/package/src/locales/zh-TW.json +13 -13
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +3 -3
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +4 -4
- package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +23 -23
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +2 -2
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +1 -1
- package/dist/package/src/views/base/config/index.vue +38 -38
- package/dist/package/src/views/base/dict/index.vue +23 -23
- package/dist/package/src/views/base/dict/item.vue +25 -25
- package/dist/package/src/views/base/menu/index.vue +23 -23
- package/dist/package/src/views/tool/code-gen/code-preview/index.vue +9 -9
- package/dist/package/src/views/tool/code-gen/columns/index.vue +1 -1
- package/dist/package/src/views/tool/code-gen/components/CodeGenLocaleEditor.vue +8 -8
- package/dist/package/src/views/tool/code-gen/table/index.vue +7 -7
- package/package.json +2 -2
- package/dist/package/declarations/src/components/DynamicTranslationCell.vue.d.ts +0 -16
- package/dist/package/declarations/src/components/DynamicTranslationEditor.vue.d.ts +0 -20
- package/dist/package/declarations/src/components/dynamicTranslation.d.ts +0 -38
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ packages/modules/system
|
|
|
35
35
|
| `src/module.ts` | 注册 System 页面、AI 顶部入口、个人中心菜单和路由行为。 |
|
|
36
36
|
| `src/ai.ts` | 定义 AI 流程卡片扩展名称、类型和读取入口。 |
|
|
37
37
|
| `src/components/Ai.vue` | System 提供的 AI 顶部工具入口。 |
|
|
38
|
-
| `src/components/
|
|
38
|
+
| `src/components/DynamicI18nCell.vue` | 翻译资源列表单元格,悬停预览当前语言之外的内容。 |
|
|
39
39
|
| `src/rpc/**/*.ts` | System 页面与 API 自包含的 RPC 类型。 |
|
|
40
40
|
| `src/typings/*.d.ts` | 声明 System 页面使用的 Markdown 和 Swagger 模块。 |
|
|
41
41
|
| `package.json` | 声明依赖以及公开的模块入口、API 和 RPC 子路径。 |
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
2
|
-
import type { BaseI18nService,
|
|
2
|
+
import type { BaseI18nService, DraftBaseI18nRequest, DraftBaseI18nResponse, UpdateBaseI18nRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
3
3
|
/** BaseI18nServiceImpl Admin 单条动态翻译服务。 */
|
|
4
4
|
export declare class BaseI18nServiceImpl implements BaseI18nService {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
5
|
+
/** DraftBaseI18n 翻译请求中的单个文本。 */
|
|
6
|
+
DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse>;
|
|
7
|
+
/** UpdateBaseI18n 修改或新增单条翻译信息。 */
|
|
8
|
+
UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty>;
|
|
9
9
|
}
|
|
10
10
|
export declare const defBaseI18nService: BaseI18nServiceImpl;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BaseI18n } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
2
|
+
import { I18nTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
3
|
+
/** DynamicI18nCellProps 动态翻译列表单元格属性。 */
|
|
4
|
+
interface DynamicI18nCellProps {
|
|
5
|
+
/** 资源源文。 */
|
|
6
|
+
source: string;
|
|
7
|
+
/** 统一翻译表目标类型。 */
|
|
8
|
+
targetType?: I18nTargetType;
|
|
9
|
+
/** 目标资源编号。 */
|
|
10
|
+
targetId?: number;
|
|
11
|
+
/** 资源列表返回的非主语言翻译。 */
|
|
12
|
+
i18ns?: BaseI18n[];
|
|
13
|
+
}
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<DynamicI18nCellProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DynamicI18nCellProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type DynamicI18nValue } from "./dynamicI18n";
|
|
2
|
+
/** DynamicI18nEditorProps 动态翻译编辑器属性。 */
|
|
3
|
+
interface DynamicI18nEditorProps {
|
|
4
|
+
modelValue: DynamicI18nValue[];
|
|
5
|
+
/** 当前语言源文本。 */
|
|
6
|
+
source?: string;
|
|
7
|
+
maxlength?: number;
|
|
8
|
+
multiline?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<DynamicI18nEditorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: DynamicI18nValue[]) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<DynamicI18nEditorProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: DynamicI18nValue[]) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
source: string;
|
|
16
|
+
maxlength: number;
|
|
17
|
+
multiline: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { I18nTargetType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
2
|
+
/** DynamicI18nValue 动态资源单语言翻译编辑状态。 */
|
|
3
|
+
export interface DynamicI18nValue {
|
|
4
|
+
/** 语言代码。 */
|
|
5
|
+
locale: string;
|
|
6
|
+
text: string;
|
|
7
|
+
id: number;
|
|
8
|
+
}
|
|
9
|
+
/** DynamicI18nRecord 描述三类动态资源翻译共有字段。 */
|
|
10
|
+
export interface DynamicI18nRecord extends Omit<DynamicI18nValue, "text"> {
|
|
11
|
+
target_type?: I18nTargetType;
|
|
12
|
+
target_id?: number;
|
|
13
|
+
name?: string;
|
|
14
|
+
/** 兼容旧接口缓存中的字段名。 */
|
|
15
|
+
title?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
/** DynamicLanguageOption 动态翻译编辑器显示的语言选项。 */
|
|
19
|
+
export interface DynamicLanguageOption {
|
|
20
|
+
/** 语言代码。 */
|
|
21
|
+
value: string;
|
|
22
|
+
/** 语言显示名称。 */
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
/** 返回语言管理中启用且非主语言的翻译语言选项。 */
|
|
26
|
+
export declare function getEditableLanguageOptions(): DynamicLanguageOption[];
|
|
27
|
+
/** 返回语言管理中的语言显示名称。 */
|
|
28
|
+
export declare function getLanguageLabel(locale: string): string;
|
|
29
|
+
/** normalizeDynamicI18ns 将后端翻译记录补齐为全部非主语言编辑状态。 */
|
|
30
|
+
export declare function normalizeDynamicI18ns(records: DynamicI18nRecord[] | undefined, _textField: "title" | "name" | "label", locales?: string[]): DynamicI18nValue[];
|
|
31
|
+
/** serializeDynamicI18ns 将编辑状态转换回后端资源翻译结构。 */
|
|
32
|
+
export declare function serializeDynamicI18ns(values: DynamicI18nValue[], targetType: I18nTargetType, targetId: number): Array<{
|
|
33
|
+
id: number;
|
|
34
|
+
target_type: I18nTargetType;
|
|
35
|
+
target_id: number;
|
|
36
|
+
locale: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}>;
|
|
@@ -249,17 +249,17 @@ export declare const LOCALE_MESSAGES: {
|
|
|
249
249
|
"system.base.user.message.confirm_delete_selected": string;
|
|
250
250
|
"system.base.user.message.delete_success": string;
|
|
251
251
|
"system.base.user.message.delete_canceled": string;
|
|
252
|
-
"system.base.
|
|
253
|
-
"system.base.
|
|
254
|
-
"system.base.
|
|
255
|
-
"system.base.
|
|
256
|
-
"system.base.
|
|
257
|
-
"system.base.
|
|
258
|
-
"system.base.
|
|
259
|
-
"system.base.
|
|
260
|
-
"system.base.
|
|
261
|
-
"system.base.
|
|
262
|
-
"system.base.
|
|
252
|
+
"system.base.i18n.field.i18ns": string;
|
|
253
|
+
"system.base.i18n.field.name_i18ns": string;
|
|
254
|
+
"system.base.i18n.field.value_i18ns": string;
|
|
255
|
+
"system.base.i18n.placeholder.text": string;
|
|
256
|
+
"system.base.i18n.action.translate": string;
|
|
257
|
+
"system.base.i18n.action.batch_translate": string;
|
|
258
|
+
"system.base.i18n.message.translate_success": string;
|
|
259
|
+
"system.base.i18n.message.translate_failed": string;
|
|
260
|
+
"system.base.i18n.message.batch_translate_success": string;
|
|
261
|
+
"system.base.i18n.message.batch_translate_partial": string;
|
|
262
|
+
"system.base.i18n.message.batch_translate_failed": string;
|
|
263
263
|
"system.base.menu.title.list": string;
|
|
264
264
|
"system.base.menu.action.create": string;
|
|
265
265
|
"system.base.menu.action.edit": string;
|
|
@@ -627,7 +627,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
627
627
|
"system.code.gen.validation.left_tree_parent_required": string;
|
|
628
628
|
"system.code.gen.validation.left_tree_label_required": string;
|
|
629
629
|
"system.code.gen.validation.left_tree_value_required": string;
|
|
630
|
-
"system.code.gen.i18n.field.
|
|
630
|
+
"system.code.gen.i18n.field.i18ns": string;
|
|
631
631
|
"system.code.gen.i18n.action.edit_column": string;
|
|
632
632
|
"system.code.gen.i18n.status.complete": string;
|
|
633
633
|
"system.code.gen.i18n.status.missing": string;
|
|
@@ -882,7 +882,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
882
882
|
"system.code.gen.preview.message.create_success": string;
|
|
883
883
|
"system.code.gen.preview.message.update_success": string;
|
|
884
884
|
"system.code.gen.preview.message.delete_success": string;
|
|
885
|
-
"system.code.gen.preview.message.
|
|
885
|
+
"system.code.gen.preview.message.missing_i18ns": string;
|
|
886
886
|
"system.code.gen.preview.value.list_separator": string;
|
|
887
887
|
"system.project.document.title.navigation": string;
|
|
888
888
|
"system.project.document.placeholder.search": string;
|
|
@@ -1213,17 +1213,17 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1213
1213
|
"system.base.user.message.confirm_delete_selected": string;
|
|
1214
1214
|
"system.base.user.message.delete_success": string;
|
|
1215
1215
|
"system.base.user.message.delete_canceled": string;
|
|
1216
|
-
"system.base.
|
|
1217
|
-
"system.base.
|
|
1218
|
-
"system.base.
|
|
1219
|
-
"system.base.
|
|
1220
|
-
"system.base.
|
|
1221
|
-
"system.base.
|
|
1222
|
-
"system.base.
|
|
1223
|
-
"system.base.
|
|
1224
|
-
"system.base.
|
|
1225
|
-
"system.base.
|
|
1226
|
-
"system.base.
|
|
1216
|
+
"system.base.i18n.field.i18ns": string;
|
|
1217
|
+
"system.base.i18n.field.name_i18ns": string;
|
|
1218
|
+
"system.base.i18n.field.value_i18ns": string;
|
|
1219
|
+
"system.base.i18n.placeholder.text": string;
|
|
1220
|
+
"system.base.i18n.action.translate": string;
|
|
1221
|
+
"system.base.i18n.action.batch_translate": string;
|
|
1222
|
+
"system.base.i18n.message.translate_success": string;
|
|
1223
|
+
"system.base.i18n.message.translate_failed": string;
|
|
1224
|
+
"system.base.i18n.message.batch_translate_success": string;
|
|
1225
|
+
"system.base.i18n.message.batch_translate_partial": string;
|
|
1226
|
+
"system.base.i18n.message.batch_translate_failed": string;
|
|
1227
1227
|
"system.base.menu.title.list": string;
|
|
1228
1228
|
"system.base.menu.action.create": string;
|
|
1229
1229
|
"system.base.menu.action.edit": string;
|
|
@@ -1591,7 +1591,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1591
1591
|
"system.code.gen.validation.left_tree_parent_required": string;
|
|
1592
1592
|
"system.code.gen.validation.left_tree_label_required": string;
|
|
1593
1593
|
"system.code.gen.validation.left_tree_value_required": string;
|
|
1594
|
-
"system.code.gen.i18n.field.
|
|
1594
|
+
"system.code.gen.i18n.field.i18ns": string;
|
|
1595
1595
|
"system.code.gen.i18n.action.edit_column": string;
|
|
1596
1596
|
"system.code.gen.i18n.status.complete": string;
|
|
1597
1597
|
"system.code.gen.i18n.status.missing": string;
|
|
@@ -1846,7 +1846,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1846
1846
|
"system.code.gen.preview.message.create_success": string;
|
|
1847
1847
|
"system.code.gen.preview.message.update_success": string;
|
|
1848
1848
|
"system.code.gen.preview.message.delete_success": string;
|
|
1849
|
-
"system.code.gen.preview.message.
|
|
1849
|
+
"system.code.gen.preview.message.missing_i18ns": string;
|
|
1850
1850
|
"system.code.gen.preview.value.list_separator": string;
|
|
1851
1851
|
"system.project.document.title.navigation": string;
|
|
1852
1852
|
"system.project.document.placeholder.search": string;
|
|
@@ -2177,17 +2177,17 @@ export declare const LOCALE_MESSAGES: {
|
|
|
2177
2177
|
"system.base.user.message.confirm_delete_selected": string;
|
|
2178
2178
|
"system.base.user.message.delete_success": string;
|
|
2179
2179
|
"system.base.user.message.delete_canceled": string;
|
|
2180
|
-
"system.base.
|
|
2181
|
-
"system.base.
|
|
2182
|
-
"system.base.
|
|
2183
|
-
"system.base.
|
|
2184
|
-
"system.base.
|
|
2185
|
-
"system.base.
|
|
2186
|
-
"system.base.
|
|
2187
|
-
"system.base.
|
|
2188
|
-
"system.base.
|
|
2189
|
-
"system.base.
|
|
2190
|
-
"system.base.
|
|
2180
|
+
"system.base.i18n.field.i18ns": string;
|
|
2181
|
+
"system.base.i18n.field.name_i18ns": string;
|
|
2182
|
+
"system.base.i18n.field.value_i18ns": string;
|
|
2183
|
+
"system.base.i18n.placeholder.text": string;
|
|
2184
|
+
"system.base.i18n.action.translate": string;
|
|
2185
|
+
"system.base.i18n.action.batch_translate": string;
|
|
2186
|
+
"system.base.i18n.message.translate_success": string;
|
|
2187
|
+
"system.base.i18n.message.translate_failed": string;
|
|
2188
|
+
"system.base.i18n.message.batch_translate_success": string;
|
|
2189
|
+
"system.base.i18n.message.batch_translate_partial": string;
|
|
2190
|
+
"system.base.i18n.message.batch_translate_failed": string;
|
|
2191
2191
|
"system.base.menu.title.list": string;
|
|
2192
2192
|
"system.base.menu.action.create": string;
|
|
2193
2193
|
"system.base.menu.action.edit": string;
|
|
@@ -2555,7 +2555,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
2555
2555
|
"system.code.gen.validation.left_tree_parent_required": string;
|
|
2556
2556
|
"system.code.gen.validation.left_tree_label_required": string;
|
|
2557
2557
|
"system.code.gen.validation.left_tree_value_required": string;
|
|
2558
|
-
"system.code.gen.i18n.field.
|
|
2558
|
+
"system.code.gen.i18n.field.i18ns": string;
|
|
2559
2559
|
"system.code.gen.i18n.action.edit_column": string;
|
|
2560
2560
|
"system.code.gen.i18n.status.complete": string;
|
|
2561
2561
|
"system.code.gen.i18n.status.missing": string;
|
|
@@ -2810,7 +2810,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
2810
2810
|
"system.code.gen.preview.message.create_success": string;
|
|
2811
2811
|
"system.code.gen.preview.message.update_success": string;
|
|
2812
2812
|
"system.code.gen.preview.message.delete_success": string;
|
|
2813
|
-
"system.code.gen.preview.message.
|
|
2813
|
+
"system.code.gen.preview.message.missing_i18ns": string;
|
|
2814
2814
|
"system.code.gen.preview.value.list_separator": string;
|
|
2815
2815
|
"system.project.document.title.navigation": string;
|
|
2816
2816
|
"system.project.document.placeholder.search": string;
|
|
@@ -3141,17 +3141,17 @@ export declare const LOCALE_MESSAGES: {
|
|
|
3141
3141
|
"system.base.user.message.confirm_delete_selected": string;
|
|
3142
3142
|
"system.base.user.message.delete_success": string;
|
|
3143
3143
|
"system.base.user.message.delete_canceled": string;
|
|
3144
|
-
"system.base.
|
|
3145
|
-
"system.base.
|
|
3146
|
-
"system.base.
|
|
3147
|
-
"system.base.
|
|
3148
|
-
"system.base.
|
|
3149
|
-
"system.base.
|
|
3150
|
-
"system.base.
|
|
3151
|
-
"system.base.
|
|
3152
|
-
"system.base.
|
|
3153
|
-
"system.base.
|
|
3154
|
-
"system.base.
|
|
3144
|
+
"system.base.i18n.field.i18ns": string;
|
|
3145
|
+
"system.base.i18n.field.name_i18ns": string;
|
|
3146
|
+
"system.base.i18n.field.value_i18ns": string;
|
|
3147
|
+
"system.base.i18n.placeholder.text": string;
|
|
3148
|
+
"system.base.i18n.action.translate": string;
|
|
3149
|
+
"system.base.i18n.action.batch_translate": string;
|
|
3150
|
+
"system.base.i18n.message.translate_success": string;
|
|
3151
|
+
"system.base.i18n.message.translate_failed": string;
|
|
3152
|
+
"system.base.i18n.message.batch_translate_success": string;
|
|
3153
|
+
"system.base.i18n.message.batch_translate_partial": string;
|
|
3154
|
+
"system.base.i18n.message.batch_translate_failed": string;
|
|
3155
3155
|
"system.base.menu.title.list": string;
|
|
3156
3156
|
"system.base.menu.action.create": string;
|
|
3157
3157
|
"system.base.menu.action.edit": string;
|
|
@@ -3519,7 +3519,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
3519
3519
|
"system.code.gen.validation.left_tree_parent_required": string;
|
|
3520
3520
|
"system.code.gen.validation.left_tree_label_required": string;
|
|
3521
3521
|
"system.code.gen.validation.left_tree_value_required": string;
|
|
3522
|
-
"system.code.gen.i18n.field.
|
|
3522
|
+
"system.code.gen.i18n.field.i18ns": string;
|
|
3523
3523
|
"system.code.gen.i18n.action.edit_column": string;
|
|
3524
3524
|
"system.code.gen.i18n.status.complete": string;
|
|
3525
3525
|
"system.code.gen.i18n.status.missing": string;
|
|
@@ -3774,7 +3774,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
3774
3774
|
"system.code.gen.preview.message.create_success": string;
|
|
3775
3775
|
"system.code.gen.preview.message.update_success": string;
|
|
3776
3776
|
"system.code.gen.preview.message.delete_success": string;
|
|
3777
|
-
"system.code.gen.preview.message.
|
|
3777
|
+
"system.code.gen.preview.message.missing_i18ns": string;
|
|
3778
3778
|
"system.code.gen.preview.value.list_separator": string;
|
|
3779
3779
|
"system.project.document.title.navigation": string;
|
|
3780
3780
|
"system.project.document.placeholder.search": string;
|
|
@@ -61,9 +61,9 @@ export interface BaseConfigForm {
|
|
|
61
61
|
/** 配置value */
|
|
62
62
|
value: string;
|
|
63
63
|
/** 配置名称多语言翻 */
|
|
64
|
-
|
|
64
|
+
name_i18ns: BaseI18n[];
|
|
65
65
|
/** 配置value文本/富文本配置值的多语言翻译 */
|
|
66
|
-
|
|
66
|
+
value_i18ns: BaseI18n[];
|
|
67
67
|
/** 状态 */
|
|
68
68
|
status: Status;
|
|
69
69
|
}
|
|
@@ -113,7 +113,7 @@ export interface BaseConfig {
|
|
|
113
113
|
/** 更新时间 */
|
|
114
114
|
updated_at: string;
|
|
115
115
|
/** 配置名称及文本/富文本配置值的多语言翻译 */
|
|
116
|
-
|
|
116
|
+
i18ns: BaseI18n[];
|
|
117
117
|
}
|
|
118
118
|
/** Admin系统配置服务 */
|
|
119
119
|
export interface BaseConfigService {
|
|
@@ -81,7 +81,7 @@ export interface BaseDictForm {
|
|
|
81
81
|
/** 字典名称 */
|
|
82
82
|
name: string;
|
|
83
83
|
/** 非主语言翻译 */
|
|
84
|
-
|
|
84
|
+
i18ns: BaseI18n[];
|
|
85
85
|
/** 状态 */
|
|
86
86
|
status: Status;
|
|
87
87
|
}
|
|
@@ -105,7 +105,7 @@ export interface BaseDictItemForm {
|
|
|
105
105
|
/** 排序 */
|
|
106
106
|
sort: number;
|
|
107
107
|
/** 非主语言翻译 */
|
|
108
|
-
|
|
108
|
+
i18ns: BaseI18n[];
|
|
109
109
|
/** 状态 */
|
|
110
110
|
status: Status;
|
|
111
111
|
}
|
|
@@ -168,7 +168,7 @@ export interface BaseDict {
|
|
|
168
168
|
/** 更新时间 */
|
|
169
169
|
updated_at: string;
|
|
170
170
|
/** 非主语言翻译 */
|
|
171
|
-
|
|
171
|
+
i18ns: BaseI18n[];
|
|
172
172
|
}
|
|
173
173
|
/** 字典项 */
|
|
174
174
|
export interface BaseDictItem {
|
|
@@ -191,7 +191,7 @@ export interface BaseDictItem {
|
|
|
191
191
|
/** 更新时间 */
|
|
192
192
|
updated_at: string;
|
|
193
193
|
/** 非主语言翻译 */
|
|
194
|
-
|
|
194
|
+
i18ns: BaseI18n[];
|
|
195
195
|
}
|
|
196
196
|
/** Admin字典服务 */
|
|
197
197
|
export interface BaseDictService {
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
2
2
|
/** 统一翻译表目标类型,和 base_i18n.target_type 的值一一对应。 */
|
|
3
|
-
export declare enum
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
3
|
+
export declare enum I18nTargetType {
|
|
4
|
+
/** I18N_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
|
|
5
|
+
I18N_TARGET_TYPE_UNSPECIFIED = 0,
|
|
6
|
+
/** I18N_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
|
|
7
|
+
I18N_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
|
|
8
|
+
/** I18N_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
|
|
9
|
+
I18N_TARGET_TYPE_BASE_CONFIG_NAME = 2,
|
|
10
|
+
/** I18N_TARGET_TYPE_BASE_DICT - 字典名称。 */
|
|
11
|
+
I18N_TARGET_TYPE_BASE_DICT = 3,
|
|
12
|
+
/** I18N_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
|
|
13
|
+
I18N_TARGET_TYPE_BASE_DICT_ITEM = 4,
|
|
14
|
+
/** I18N_TARGET_TYPE_BASE_MENU - 菜单标题。 */
|
|
15
|
+
I18N_TARGET_TYPE_BASE_MENU = 5
|
|
16
16
|
}
|
|
17
17
|
/** 翻译单个文本请求。 */
|
|
18
|
-
export interface
|
|
18
|
+
export interface DraftBaseI18nRequest {
|
|
19
19
|
/** 待翻译文本 */
|
|
20
20
|
source: string;
|
|
21
21
|
/** 目标语言区域,不传时翻译所有启用的非主语言 */
|
|
22
22
|
locale?: string | undefined;
|
|
23
23
|
}
|
|
24
24
|
/** 翻译单个文本响应。 */
|
|
25
|
-
export interface
|
|
25
|
+
export interface DraftBaseI18nResponse {
|
|
26
26
|
/** 翻译结果 */
|
|
27
|
-
|
|
27
|
+
i18ns: DraftBaseI18nItem[];
|
|
28
28
|
}
|
|
29
29
|
/** 翻译单个文本响应。 */
|
|
30
|
-
export interface
|
|
30
|
+
export interface DraftBaseI18nItem {
|
|
31
31
|
/** 目标语言区域 */
|
|
32
32
|
locale: string;
|
|
33
33
|
/** 翻译文本 */
|
|
34
|
-
|
|
34
|
+
i18n: string;
|
|
35
35
|
}
|
|
36
36
|
/** 修改单个翻译信息请求。 */
|
|
37
|
-
export interface
|
|
37
|
+
export interface UpdateBaseI18nRequest {
|
|
38
38
|
/** 翻译记录ID,大于零时优先按ID更新;ID不存在时根据目标信息更新或新增 */
|
|
39
39
|
id: number;
|
|
40
40
|
/** 翻译目标类型,ID为零时用于查询或新增 */
|
|
41
|
-
target_type:
|
|
41
|
+
target_type: I18nTargetType;
|
|
42
42
|
/** 目标资源ID,ID为零时用于查询或新增 */
|
|
43
43
|
target_id: number;
|
|
44
44
|
/** 目标语言区域,ID为零时用于查询或新增 */
|
|
@@ -51,7 +51,7 @@ export interface BaseI18n {
|
|
|
51
51
|
/** 翻译记录ID */
|
|
52
52
|
id: number;
|
|
53
53
|
/** 翻译目标类型 */
|
|
54
|
-
target_type:
|
|
54
|
+
target_type: I18nTargetType;
|
|
55
55
|
/** 目标资源ID */
|
|
56
56
|
target_id: number;
|
|
57
57
|
/** 语言区域 */
|
|
@@ -69,7 +69,7 @@ export interface CodeGenLocaleConfig {
|
|
|
69
69
|
/** 国际化翻译信息服务。 */
|
|
70
70
|
export interface BaseI18nService {
|
|
71
71
|
/** 翻译单个文本。 */
|
|
72
|
-
|
|
72
|
+
DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse>;
|
|
73
73
|
/** 修改国际化翻译信息 */
|
|
74
|
-
|
|
74
|
+
UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty>;
|
|
75
75
|
}
|
|
@@ -50,7 +50,7 @@ export interface BaseMenuForm {
|
|
|
50
50
|
/** 分配的API列表 */
|
|
51
51
|
api: string[];
|
|
52
52
|
/** 非主语言翻译 */
|
|
53
|
-
|
|
53
|
+
i18ns: BaseI18n[];
|
|
54
54
|
/** 排序 */
|
|
55
55
|
sort: number;
|
|
56
56
|
/** 状态 */
|
|
@@ -109,7 +109,7 @@ export interface BaseMenu {
|
|
|
109
109
|
/** 是否存在子节点 */
|
|
110
110
|
has_children: boolean;
|
|
111
111
|
/** 非主语言翻译 */
|
|
112
|
-
|
|
112
|
+
i18ns: BaseI18n[];
|
|
113
113
|
}
|
|
114
114
|
/** 菜单元信息 */
|
|
115
115
|
export interface BaseMenuMeta {
|
|
@@ -67,7 +67,7 @@ export interface PreviewCodeGenResponse {
|
|
|
67
67
|
/** 本次生效输出路径 */
|
|
68
68
|
output_paths: CodeGenOutputPaths | undefined;
|
|
69
69
|
/** 正式生成前必须补齐的翻译配置 */
|
|
70
|
-
|
|
70
|
+
missing_i18ns: string[];
|
|
71
71
|
}
|
|
72
72
|
/** 启动代码生成任务条件 */
|
|
73
73
|
export interface StartCodeGenTaskRequest {
|
|
@@ -2,28 +2,28 @@ import service from "@liujitcn/kratos-admin-core/request";
|
|
|
2
2
|
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
3
3
|
import type {
|
|
4
4
|
BaseI18nService,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
DraftBaseI18nRequest,
|
|
6
|
+
DraftBaseI18nResponse,
|
|
7
|
+
UpdateBaseI18nRequest
|
|
8
8
|
} from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_i18n";
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const BASE_I18N_URL = "/v1/admin/base/i18n";
|
|
11
11
|
|
|
12
12
|
/** BaseI18nServiceImpl Admin 单条动态翻译服务。 */
|
|
13
13
|
export class BaseI18nServiceImpl implements BaseI18nService {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
return service<
|
|
17
|
-
url: `${
|
|
14
|
+
/** DraftBaseI18n 翻译请求中的单个文本。 */
|
|
15
|
+
DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse> {
|
|
16
|
+
return service<DraftBaseI18nRequest, DraftBaseI18nResponse>({
|
|
17
|
+
url: `${BASE_I18N_URL}/draft`,
|
|
18
18
|
method: "post",
|
|
19
19
|
data: request
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
return service<
|
|
26
|
-
url:
|
|
23
|
+
/** UpdateBaseI18n 修改或新增单条翻译信息。 */
|
|
24
|
+
UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty> {
|
|
25
|
+
return service<UpdateBaseI18nRequest, Empty>({
|
|
26
|
+
url: BASE_I18N_URL,
|
|
27
27
|
method: "put",
|
|
28
28
|
data: request
|
|
29
29
|
});
|