diff --git a/CHANGELOG.md b/CHANGELOG.md
index 14965754eb6308581bcff292a3b50918cf86734f..3c3093c078773575a43f5614690ee9c54c40f3cf 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 4e607c4e143fcf3192013037065a44d6ade355ac..b87babb0490d34aa1a3b1ef650d8f2eb309840c7 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 cb9c8fbb6f6d40327e1996fa5adcd1590ccec793..d33165089a1d9ab52bcbe70e10c3f888ab368d19 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 f88681220ef825ebc17664ecfa10698ab7ba30fa..f5b709f0192fe94cf13ebf01edf255d63acc3800 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 3300182ee631130051081cdf0a383e6321c6ccdb..678d7195187fc7ce8e77204ec33ce1d772909d99 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 5f17ac2767d87a39db93b88166aeac60dd142b29..7a1ae8f3021c0f0e811dbdd4651efb99f664847a 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 f67e64d4785f343e2775ee3df8bffa7369a939c7..7366ca90524f61bcad920ece2ca852b02438ef32 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 9f4f111af9e185f5f0a4154f7d8efcf898e0e7d1..866b6cd0bd73d03ccbf0e10bdef2f8ba723e0ca7 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 b9f0897d58c0050c31f518a7a14e9461a89e8346..12e497f3705b05e6dcedcdc6bbe698569886250a 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 && (