@liujitcn/kratos-admin-core 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.
@@ -81,7 +81,7 @@ export interface BaseDictForm {
81
81
  /** 字典名称 */
82
82
  name: string;
83
83
  /** 非主语言翻译 */
84
- translations: BaseI18n[];
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
- translations: BaseI18n[];
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
- translations: BaseI18n[];
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
- translations: BaseI18n[];
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 TranslationTargetType {
4
- /** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
5
- TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
6
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
7
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
8
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
9
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME = 2,
10
- /** TRANSLATION_TARGET_TYPE_BASE_DICT - 字典名称。 */
11
- TRANSLATION_TARGET_TYPE_BASE_DICT = 3,
12
- /** TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
13
- TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM = 4,
14
- /** TRANSLATION_TARGET_TYPE_BASE_MENU - 菜单标题。 */
15
- TRANSLATION_TARGET_TYPE_BASE_MENU = 5
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 DraftBaseTranslationRequest {
18
+ export interface DraftBaseI18nRequest {
19
19
  /** 待翻译文本 */
20
20
  source: string;
21
21
  /** 目标语言区域,不传时翻译所有启用的非主语言 */
22
22
  locale?: string | undefined;
23
23
  }
24
24
  /** 翻译单个文本响应。 */
25
- export interface DraftBaseTranslationResponse {
25
+ export interface DraftBaseI18nResponse {
26
26
  /** 翻译结果 */
27
- translations: DraftBaseTranslationItem[];
27
+ i18ns: DraftBaseI18nItem[];
28
28
  }
29
29
  /** 翻译单个文本响应。 */
30
- export interface DraftBaseTranslationItem {
30
+ export interface DraftBaseI18nItem {
31
31
  /** 目标语言区域 */
32
32
  locale: string;
33
33
  /** 翻译文本 */
34
- translation: string;
34
+ i18n: string;
35
35
  }
36
36
  /** 修改单个翻译信息请求。 */
37
- export interface UpdateBaseTranslationRequest {
37
+ export interface UpdateBaseI18nRequest {
38
38
  /** 翻译记录ID,大于零时优先按ID更新;ID不存在时根据目标信息更新或新增 */
39
39
  id: number;
40
40
  /** 翻译目标类型,ID为零时用于查询或新增 */
41
- target_type: TranslationTargetType;
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: TranslationTargetType;
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
- DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
72
+ DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse>;
73
73
  /** 修改国际化翻译信息 */
74
- UpdateBaseTranslation(request: UpdateBaseTranslationRequest): Promise<Empty>;
74
+ UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty>;
75
75
  }
@@ -88,5 +88,5 @@ export interface SiteConfigState {
88
88
  /** 当前登录验证码配置 */
89
89
  captcha: LoginCaptchaConfig;
90
90
  /** 是否允许显式生成机器翻译草稿。 */
91
- translationDraftEnabled: boolean;
91
+ i18nDraftEnabled: boolean;
92
92
  }
@@ -102,7 +102,7 @@ export interface BaseDictForm {
102
102
  /** 字典名称 */
103
103
  name: string;
104
104
  /** 非主语言翻译 */
105
- translations: BaseI18n[];
105
+ i18ns: BaseI18n[];
106
106
  /** 状态 */
107
107
  status: Status;
108
108
  }
@@ -128,7 +128,7 @@ export interface BaseDictItemForm {
128
128
  /** 排序 */
129
129
  sort: number;
130
130
  /** 非主语言翻译 */
131
- translations: BaseI18n[];
131
+ i18ns: BaseI18n[];
132
132
  /** 状态 */
133
133
  status: Status;
134
134
  }
@@ -200,7 +200,7 @@ export interface BaseDict {
200
200
  /** 更新时间 */
201
201
  updated_at: string;
202
202
  /** 非主语言翻译 */
203
- translations: BaseI18n[];
203
+ i18ns: BaseI18n[];
204
204
  }
205
205
 
206
206
  /** 字典项 */
@@ -224,7 +224,7 @@ export interface BaseDictItem {
224
224
  /** 更新时间 */
225
225
  updated_at: string;
226
226
  /** 非主语言翻译 */
227
- translations: BaseI18n[];
227
+ i18ns: BaseI18n[];
228
228
  }
229
229
 
230
230
  /** Admin字典服务 */
@@ -8,23 +8,23 @@
8
8
  import type { Empty } from "../../../google/protobuf/empty";
9
9
 
10
10
  /** 统一翻译表目标类型,和 base_i18n.target_type 的值一一对应。 */
11
- export enum TranslationTargetType {
12
- /** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
13
- TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
14
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
15
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
16
- /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
17
- TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME = 2,
18
- /** TRANSLATION_TARGET_TYPE_BASE_DICT - 字典名称。 */
19
- TRANSLATION_TARGET_TYPE_BASE_DICT = 3,
20
- /** TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
21
- TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM = 4,
22
- /** TRANSLATION_TARGET_TYPE_BASE_MENU - 菜单标题。 */
23
- TRANSLATION_TARGET_TYPE_BASE_MENU = 5,
11
+ export enum I18nTargetType {
12
+ /** I18N_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
13
+ I18N_TARGET_TYPE_UNSPECIFIED = 0,
14
+ /** I18N_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
15
+ I18N_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
16
+ /** I18N_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
17
+ I18N_TARGET_TYPE_BASE_CONFIG_NAME = 2,
18
+ /** I18N_TARGET_TYPE_BASE_DICT - 字典名称。 */
19
+ I18N_TARGET_TYPE_BASE_DICT = 3,
20
+ /** I18N_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
21
+ I18N_TARGET_TYPE_BASE_DICT_ITEM = 4,
22
+ /** I18N_TARGET_TYPE_BASE_MENU - 菜单标题。 */
23
+ I18N_TARGET_TYPE_BASE_MENU = 5,
24
24
  }
25
25
 
26
26
  /** 翻译单个文本请求。 */
27
- export interface DraftBaseTranslationRequest {
27
+ export interface DraftBaseI18nRequest {
28
28
  /** 待翻译文本 */
29
29
  source: string;
30
30
  /** 目标语言区域,不传时翻译所有启用的非主语言 */
@@ -32,25 +32,25 @@ export interface DraftBaseTranslationRequest {
32
32
  }
33
33
 
34
34
  /** 翻译单个文本响应。 */
35
- export interface DraftBaseTranslationResponse {
35
+ export interface DraftBaseI18nResponse {
36
36
  /** 翻译结果 */
37
- translations: DraftBaseTranslationItem[];
37
+ i18ns: DraftBaseI18nItem[];
38
38
  }
39
39
 
40
40
  /** 翻译单个文本响应。 */
41
- export interface DraftBaseTranslationItem {
41
+ export interface DraftBaseI18nItem {
42
42
  /** 目标语言区域 */
43
43
  locale: string;
44
44
  /** 翻译文本 */
45
- translation: string;
45
+ i18n: string;
46
46
  }
47
47
 
48
48
  /** 修改单个翻译信息请求。 */
49
- export interface UpdateBaseTranslationRequest {
49
+ export interface UpdateBaseI18nRequest {
50
50
  /** 翻译记录ID,大于零时优先按ID更新;ID不存在时根据目标信息更新或新增 */
51
51
  id: number;
52
52
  /** 翻译目标类型,ID为零时用于查询或新增 */
53
- target_type: TranslationTargetType;
53
+ target_type: I18nTargetType;
54
54
  /** 目标资源ID,ID为零时用于查询或新增 */
55
55
  target_id: number;
56
56
  /** 目标语言区域,ID为零时用于查询或新增 */
@@ -64,7 +64,7 @@ export interface BaseI18n {
64
64
  /** 翻译记录ID */
65
65
  id: number;
66
66
  /** 翻译目标类型 */
67
- target_type: TranslationTargetType;
67
+ target_type: I18nTargetType;
68
68
  /** 目标资源ID */
69
69
  target_id: number;
70
70
  /** 语言区域 */
@@ -84,7 +84,7 @@ export interface CodeGenLocaleConfig {
84
84
  /** 国际化翻译信息服务。 */
85
85
  export interface BaseI18nService {
86
86
  /** 翻译单个文本。 */
87
- DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
87
+ DraftBaseI18n(request: DraftBaseI18nRequest): Promise<DraftBaseI18nResponse>;
88
88
  /** 修改国际化翻译信息 */
89
- UpdateBaseTranslation(request: UpdateBaseTranslationRequest): Promise<Empty>;
89
+ UpdateBaseI18n(request: UpdateBaseI18nRequest): Promise<Empty>;
90
90
  }
@@ -100,5 +100,5 @@ export interface SiteConfigState {
100
100
  /** 当前登录验证码配置 */
101
101
  captcha: LoginCaptchaConfig;
102
102
  /** 是否允许显式生成机器翻译草稿。 */
103
- translationDraftEnabled: boolean;
103
+ i18nDraftEnabled: boolean;
104
104
  }
@@ -6,7 +6,7 @@ import defaultLogoUrl from "../../assets/images/logo.svg";
6
6
  import defaultBackgroundUrl from "../../assets/images/login_left.png";
7
7
 
8
8
  const CAPTCHA_TYPE_KEY = "captchaType";
9
- const TRANSLATION_DRAFT_ENABLED_KEY = "i18n.translation_draft.enabled";
9
+ const I18N_DRAFT_ENABLED_KEY = "i18n.draft.enabled";
10
10
 
11
11
  const DEFAULT_SITE_DISPLAY_CONFIG: SiteDisplayConfig = {
12
12
  sysName: "Admin",
@@ -78,7 +78,7 @@ export const useConfigStore = defineStore("admin-config", {
78
78
  state: (): SiteConfigState => ({
79
79
  display: { ...DEFAULT_SITE_DISPLAY_CONFIG },
80
80
  captcha: { ...DEFAULT_LOGIN_CAPTCHA_CONFIG },
81
- translationDraftEnabled: false
81
+ i18nDraftEnabled: false
82
82
  }),
83
83
  getters: {},
84
84
  actions: {
@@ -103,7 +103,7 @@ export const useConfigStore = defineStore("admin-config", {
103
103
  resetDisplayConfig() {
104
104
  this.display = { ...DEFAULT_SITE_DISPLAY_CONFIG };
105
105
  this.captcha = { ...DEFAULT_LOGIN_CAPTCHA_CONFIG };
106
- this.translationDraftEnabled = false;
106
+ this.i18nDraftEnabled = false;
107
107
  },
108
108
  /**
109
109
  * 加载管理端站点配置,并以服务端返回值覆盖本地默认值。
@@ -116,7 +116,7 @@ export const useConfigStore = defineStore("admin-config", {
116
116
 
117
117
  this.setDisplayConfig(normalizeSiteDisplayConfig(configMap));
118
118
  this.setLoginCaptchaConfig(normalizeLoginCaptchaConfig(configMap));
119
- this.translationDraftEnabled = configMap[TRANSLATION_DRAFT_ENABLED_KEY] === "true";
119
+ this.i18nDraftEnabled = configMap[I18N_DRAFT_ENABLED_KEY] === "true";
120
120
  return this.display;
121
121
  }
122
122
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liujitcn/kratos-admin-core",
3
3
  "private": false,
4
- "version": "0.0.28",
4
+ "version": "0.0.29",
5
5
  "type": "module",
6
6
  "description": "kratos-admin frontend runtime and base modules",
7
7
  "author": {