From 1260cd0beb0ef58cef541373de31bf9b3d553841 Mon Sep 17 00:00:00 2001
From: lijisanxiong <1518062161@qq.com>
Date: Wed, 8 May 2024 09:44:59 +0800
Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E9=80=9A=E7=94=A8=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E5=8F=8A=E9=83=A8=E4=BB=B6=E7=BB=84=E4=BB=B6=E5=9B=BD?=
=?UTF-8?q?=E9=99=85=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 4 +
src/common/data-import2/data-import2.tsx | 6 +-
src/common/doing-notice/doing-notice.tsx | 11 +-
src/common/map-chart/map-chart.util.ts | 5 +-
src/control/app-menu/app-menu.tsx | 12 +-
src/control/calendar/calendar.tsx | 2 +-
src/control/chart/chart.tsx | 2 +-
.../custom-dashboard-container.tsx | 4 +-
.../form-mdctrl-repeater.tsx | 4 +-
.../repeater-grid/repeater-grid.tsx | 20 ++-
.../repeater-single-form.tsx | 4 +-
.../form-mdctrl/form-mdctrl.provider.ts | 4 +-
.../form-detail/form-mdctrl/form-mdctrl.tsx | 2 +-
.../mdctrl-container/mdctrl-container.tsx | 16 ++-
src/control/gantt/gantt.tsx | 6 +-
.../grid-field-edit-column.tsx | 6 +-
src/control/grid/grid/grid.tsx | 4 +-
.../row-edit-popover/row-edit-popover.tsx | 8 +-
.../row-edit-popover/use-row-edit-popover.tsx | 6 +-
src/control/kanban/kanban.tsx | 20 ++-
.../user2-report-panel/user2-report-panel.tsx | 6 +-
src/control/report-panel/report-panel.tsx | 2 +-
.../search-bar/filter-tree/filter-tree.tsx | 8 +-
src/control/search-bar/search-bar.tsx | 4 +-
.../search-groups/edit-group-util.ts | 12 +-
.../search-groups/new-group-util.ts | 16 ++-
.../search-groups/search-groups.tsx | 108 +++++++++-----
.../toolbar/export-excel/export-excel.tsx | 20 +--
.../tree-grid-ex-edit-column.tsx | 6 +-
src/control/tree-grid-ex/tree-grid-ex.tsx | 8 +-
.../tree-grid-ex/use-row-edit-popover.tsx | 6 +-
src/control/tree-grid/tree-grid.tsx | 4 +-
src/control/tree/el-tree-util.ts | 6 +-
src/control/tree/tree.tsx | 4 +-
src/control/wizard-panel/wizard-panel.tsx | 12 +-
src/locale/en/index.ts | 133 ++++++++++++++++--
src/locale/zh-CN/index.ts | 109 ++++++++++++++
37 files changed, 487 insertions(+), 123 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14965754e..3c3093c07 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@
## [Unreleased]
+### Added
+
+- 通用组件及部件组件国际化
+
## [0.7.9] - 2024-05-07
### Added
diff --git a/src/common/data-import2/data-import2.tsx b/src/common/data-import2/data-import2.tsx
index 4e607c4e1..b87babb04 100644
--- a/src/common/data-import2/data-import2.tsx
+++ b/src/common/data-import2/data-import2.tsx
@@ -572,7 +572,11 @@ export const DataImport2 = defineComponent({
onClick={this.onButtonImportClick}
disabled={!this.selectValues.join('')}
title={
- !this.selectValues.join('') ? '请选择列导入属性!' : ''
+ !this.selectValues.join('')
+ ? ibiz.i18n.t(
+ 'component.dataImport2.selectProperties',
+ )
+ : ''
}
>
{ibiz.i18n.t('component.dataImport2.import')}
diff --git a/src/common/doing-notice/doing-notice.tsx b/src/common/doing-notice/doing-notice.tsx
index cb9c8fbb6..d33165089 100644
--- a/src/common/doing-notice/doing-notice.tsx
+++ b/src/common/doing-notice/doing-notice.tsx
@@ -18,10 +18,13 @@ export const DoingNotice = defineComponent({
render() {
return (
-
完成量
+
{ibiz.i18n.t('control.gantt.complete')}
{item._finishDataItemValue}
-
总量
+
{ibiz.i18n.t('control.gantt.total')}
{item._totalDataItemValue}
-
截止时间
+
{ibiz.i18n.t('control.gantt.deadline')}
{dayjs(item._endDataItemValue).format('YYYY-MM-DD HH:mm:ss')}
diff --git a/src/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.tsx b/src/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.tsx
index f88681220..f5b709f01 100644
--- a/src/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.tsx
+++ b/src/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.tsx
@@ -61,7 +61,11 @@ export const GridFieldEditColumn = defineComponent({
case 'all':
return useAllEdit(props, componentRef);
default:
- throw new RuntimeError(`${ibiz.config.grid.editShowMode}暂未支持`);
+ throw new RuntimeError(
+ ibiz.i18n.t('control.common.noSupportItem', {
+ name: ibiz.config.grid.editShowMode,
+ }),
+ );
}
};
const { gridEditItemProps, editorProps } = useByShowMode();
diff --git a/src/control/grid/grid/grid.tsx b/src/control/grid/grid/grid.tsx
index 3300182ee..678d71951 100644
--- a/src/control/grid/grid/grid.tsx
+++ b/src/control/grid/grid/grid.tsx
@@ -235,7 +235,9 @@ export const GridControl = defineComponent({
>
- 已选中{c.state.selectedData.length}项
+ {ibiz.i18n.t('control.common.itemsSelected', {
+ length: c.state.selectedData.length,
+ })}
|
- 确定
- 取消
+
+ {ibiz.i18n.t('control.common.determine')}
+
+
+ {ibiz.i18n.t('app.cancel')}
+
);
},
diff --git a/src/control/grid/row-edit-popover/use-row-edit-popover.tsx b/src/control/grid/row-edit-popover/use-row-edit-popover.tsx
index 5f17ac276..7a1ae8f30 100644
--- a/src/control/grid/row-edit-popover/use-row-edit-popover.tsx
+++ b/src/control/grid/row-edit-popover/use-row-edit-popover.tsx
@@ -16,7 +16,7 @@ export function useRowEditPopover(
const findTrEl = (row: GridRowState): HTMLElement => {
if (!tableRef.value) {
- throw new RuntimeError('找不到表格组件引用');
+ throw new RuntimeError(ibiz.i18n.t('control.common.citeErrMessage'));
}
const tableEl = tableRef.value.$el as HTMLElement;
@@ -27,7 +27,7 @@ export function useRowEditPopover(
}
const trEl = tableEl.querySelector(selector);
if (!trEl) {
- throw new RuntimeError('找不到对应的表格行dom元素');
+ throw new RuntimeError(ibiz.i18n.t('control.common.noDomErrMessage'));
}
return trEl as HTMLElement;
};
@@ -35,7 +35,7 @@ export function useRowEditPopover(
const showRowEditPop = async (row: GridRowState) => {
const trEl = findTrEl(row);
if (!popInstance) {
- throw new RuntimeError('拿不到pop组件的实例');
+ throw new RuntimeError(ibiz.i18n.t('control.common.noPopErrMessage'));
}
const popEl = popInstance.$el as HTMLElement;
const { x, y } = await computePosition(trEl, popEl, {
diff --git a/src/control/kanban/kanban.tsx b/src/control/kanban/kanban.tsx
index f67e64d47..7366ca905 100644
--- a/src/control/kanban/kanban.tsx
+++ b/src/control/kanban/kanban.tsx
@@ -226,11 +226,14 @@ export const KanbanControl = defineComponent({
indeterminate={isIndeterminate}
onChange={() => handleCheckAllGroup(group, checkAll)}
>
- 全选
+ {ibiz.i18n.t('control.kanban.selectAll')}
-
- 已选择{selectedData.length}条数据
-
+
);
};
@@ -368,7 +371,7 @@ export const KanbanControl = defineComponent({
onClick={(event: MouseEvent) => stopPropagation(event)}
>
c.closeBatch()}>
- 完成
+ {ibiz.i18n.t('app.complete')}
);
@@ -387,7 +390,10 @@ export const KanbanControl = defineComponent({
onClickNew(event, group.key);
}}
>
-
+
)}
{showActionBar && (
@@ -423,7 +429,7 @@ export const KanbanControl = defineComponent({
}}
>
- 批量操作
+ {ibiz.i18n.t('control.kanban.natchOperation')}
)}
diff --git a/src/control/report-panel/report-detail/user2-report-panel/user2-report-panel.tsx b/src/control/report-panel/report-detail/user2-report-panel/user2-report-panel.tsx
index 9f4f111af..866b6cd0b 100644
--- a/src/control/report-panel/report-detail/user2-report-panel/user2-report-panel.tsx
+++ b/src/control/report-panel/report-detail/user2-report-panel/user2-report-panel.tsx
@@ -58,6 +58,10 @@ export const User2ReportPanel = defineComponent({
>
);
}
- return
@@ -601,14 +601,16 @@ export const FilterTreeControl = defineComponent({
this.onConfirm();
}}
>
- {this.isInSearchBar ? '搜索' : '确定'}
+ {this.isInSearchBar
+ ? ibiz.i18n.t('control.searchBar.filterTree.search')
+ : ibiz.i18n.t('control.common.determine')}
{
this.onCancel();
}}
>
- 重置
+ {ibiz.i18n.t('control.searchBar.filterTree.reset')}
diff --git a/src/control/search-bar/search-bar.tsx b/src/control/search-bar/search-bar.tsx
index b9f0897d5..12e497f37 100644
--- a/src/control/search-bar/search-bar.tsx
+++ b/src/control/search-bar/search-bar.tsx
@@ -168,7 +168,7 @@ export const SearchBarControl = defineComponent({
{this.c.model.enableGroup && this.c.isBackendSearchGroup && (