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 (
- - 有{this.info.num} - 个后台作业正在执行,请稍后 - + item.id === itemId); if (!itemModel) { - throw new RuntimeError(`没找到菜单项模型${itemId}`); + throw new RuntimeError( + ibiz.i18n.t('control.menu.notFoundModel', { + menuKey: itemId, + }), + ); } const provider = c.itemProviders[itemId]; if (!provider.renderText) { - throw new RuntimeError(`${itemId}的适配器没有renderText方法`); + throw new RuntimeError( + ibiz.i18n.t('control.menu.notFoundFunction', { + menuKey: itemId, + }), + ); } return provider.renderText(itemModel, c); } diff --git a/src/control/calendar/calendar.tsx b/src/control/calendar/calendar.tsx index 74ac3d060..1165d04e8 100644 --- a/src/control/calendar/calendar.tsx +++ b/src/control/calendar/calendar.tsx @@ -169,7 +169,7 @@ export const CalendarControl = defineComponent({ return ( {`+${ items.length - 1 - } 更多...`} + } ${ibiz.i18n.t('app.more')}...`} ); }, default: () => { diff --git a/src/control/chart/chart.tsx b/src/control/chart/chart.tsx index 4607cd00d..6bd4fd110 100644 --- a/src/control/chart/chart.tsx +++ b/src/control/chart/chart.tsx @@ -115,7 +115,7 @@ const ChartControl = defineComponent({ this.ns.e('empty'), this.ns.is('no-data', this.c.state.items.length === 0), ]} - description='暂无数据' + description={ibiz.i18n.t('control.common.currentNoData')} />
diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx index 1f8f7d6e6..016531b21 100644 --- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx +++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.tsx @@ -51,7 +51,9 @@ export const FormMDCtrlRepeater = defineComponent({ default: return (
- 暂未支持重复器样式{this.controller.repeaterStyle} + {ibiz.i18n.t('control.form.formMDctrlRepeater.noSupportStyle', { + repeaterStyle: this.controller.repeaterStyle, + })}
); } diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.tsx index 64fcd56e5..263c2ace8 100644 --- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.tsx +++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.tsx @@ -111,9 +111,9 @@ export const RepeaterGrid = defineComponent({ if (ibiz.config.form.mdCtrlConfirmBeforeRemove) { return ( props.controller.remove(index)} > {{ @@ -124,7 +124,7 @@ export const RepeaterGrid = defineComponent({ type='danger' class={[ns.be('index', 'remove')]} > - 删除 + {ibiz.i18n.t('app.delete')}
); }, @@ -139,7 +139,7 @@ export const RepeaterGrid = defineComponent({ class={[ns.be('index', 'remove')]} onClick={() => props.controller.remove(index)} > - 删除 + {ibiz.i18n.t('app.delete')} ); }; @@ -156,7 +156,7 @@ export const RepeaterGrid = defineComponent({ this.controller.create(); }} > - 添加 + {ibiz.i18n.t('app.add')} )} 不存在或加载中
; + return ( +
+ {ibiz.i18n.t( + 'control.form.repeaterGrid.absentOrLoad', + )} +
+ ); } const formItemC = formC.formItems.find( x => x.name === item.id, diff --git a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx index 6cb4e026e..e0ab4e68b 100644 --- a/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx +++ b/src/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.tsx @@ -48,7 +48,9 @@ export const RepeaterSingleForm = defineComponent({ }, render() { if (!this.controller.repeatedForm) { - throw new RuntimeError('没有repeatedForm'); + throw new RuntimeError( + ibiz.i18n.t('control.form.repeaterSingleForm.errorMessage'), + ); } return ( ; break; default: -
{model.contentType}暂未支持
; +
{ibiz.i18n.t('app.noSupport')}
; break; } return ( diff --git a/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx b/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx index 4ebdc47a7..5baf75527 100644 --- a/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx +++ b/src/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.tsx @@ -39,7 +39,7 @@ export const MDCtrlContainer = defineComponent({ ]} onClick={(): void => emit('addClick')} > - 添加 + {ibiz.i18n.t('app.add')} ); }; @@ -51,9 +51,11 @@ export const MDCtrlContainer = defineComponent({ if (ibiz.config.form.mdCtrlConfirmBeforeRemove) { return ( emit('removeClick', item, index)} > {{ @@ -66,7 +68,7 @@ export const MDCtrlContainer = defineComponent({ ns.be('item-actions', 'btn'), ]} > - 删除 + {ibiz.i18n.t('app.delete')} ); }, @@ -83,7 +85,7 @@ export const MDCtrlContainer = defineComponent({ ]} onClick={() => emit('removeClick', item, index)} > - 删除 + {ibiz.i18n.t('app.delete')} ); }; @@ -98,7 +100,7 @@ export const MDCtrlContainer = defineComponent({ const formComponent = this.$slots.item ? ( this.$slots.item({ data: item, index }) ) : ( -
未提供item插槽
+
{ibiz.i18n.t('control.form.mdCtrlContainer.noSlot')}
); return ( diff --git a/src/control/gantt/gantt.tsx b/src/control/gantt/gantt.tsx index 1ce8a4a06..894bd16a5 100644 --- a/src/control/gantt/gantt.tsx +++ b/src/control/gantt/gantt.tsx @@ -483,15 +483,15 @@ export const GanttControl = defineComponent({
-
完成量
+
{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
暂无数据
; + return ( +
+ {ibiz.i18n.t('control.common.currentNoData')} +
+ ); }, }); diff --git a/src/control/report-panel/report-panel.tsx b/src/control/report-panel/report-panel.tsx index ce7a1c88f..b0d7e6753 100644 --- a/src/control/report-panel/report-panel.tsx +++ b/src/control/report-panel/report-panel.tsx @@ -30,7 +30,7 @@ export const ReportPanelControl = defineComponent({ case 'USER2': return ; default: - return
暂未实现
; + return
{ibiz.i18n.t('control.reportPanel.unrealized')}
; } }; return { diff --git a/src/control/search-bar/filter-tree/filter-tree.tsx b/src/control/search-bar/filter-tree/filter-tree.tsx index 5d4b67800..e6a2ed11b 100644 --- a/src/control/search-bar/filter-tree/filter-tree.tsx +++ b/src/control/search-bar/filter-tree/filter-tree.tsx @@ -531,7 +531,7 @@ export const FilterTreeControl = defineComponent({ addItem(node); }} > - 添加项 + {ibiz.i18n.t('control.searchBar.filterTree.addItem')}
@@ -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 && ( @@ -199,7 +199,7 @@ export const SearchBarControl = defineComponent({ this.triggerFilter()} > diff --git a/src/control/search-bar/search-groups/edit-group-util.ts b/src/control/search-bar/search-groups/edit-group-util.ts index e5edebe31..39de70f94 100644 --- a/src/control/search-bar/search-groups/edit-group-util.ts +++ b/src/control/search-bar/search-groups/edit-group-util.ts @@ -22,7 +22,13 @@ export function useEditGroup(c: SearchBarController): { // 编辑分组表单规则 const editFormRules = reactive({ - caption: [{ required: true, message: '分组名称不能为空', trigger: 'blur' }], + caption: [ + { + required: true, + message: ibiz.i18n.t('control.searchBar.searchGroups.groupValueRule'), + trigger: 'blur', + }, + ], }); // 编辑分组表单提交 @@ -45,7 +51,9 @@ export function useEditGroup(c: SearchBarController): { } } } - ibiz.message.success('更新成功!'); + ibiz.message.success( + `${ibiz.i18n.t('control.common.updateSuccess')}!`, + ); editDialogVisible.value = false; } }, diff --git a/src/control/search-bar/search-groups/new-group-util.ts b/src/control/search-bar/search-groups/new-group-util.ts index 85572d404..d2c213920 100644 --- a/src/control/search-bar/search-groups/new-group-util.ts +++ b/src/control/search-bar/search-groups/new-group-util.ts @@ -22,7 +22,13 @@ export function useNewGroup(c: SearchBarController): { // 新建分组表单规则 const newFormRules = reactive({ - caption: [{ required: true, message: '分组名称不能为空', trigger: 'blur' }], + caption: [ + { + required: true, + message: ibiz.i18n.t('control.searchBar.searchGroups.groupValueRule'), + trigger: 'blur', + }, + ], }); // 新建分组表单取消 @@ -43,13 +49,17 @@ export function useNewGroup(c: SearchBarController): { return group.caption === newForm.caption; }); if (sameCaptionGroup) { - ibiz.message.error('分组名称不能重复!'); + ibiz.message.error( + ibiz.i18n.t('control.searchBar.searchGroups.errorMessage'), + ); return; } await c.service.create(newForm.caption); handleNewFormCancel(); await c.initSearBarGroups(); - ibiz.message.success('新建成功!'); + ibiz.message.success( + `${ibiz.i18n.t('control.common.newSuccCreated')}!`, + ); } }, ); diff --git a/src/control/search-bar/search-groups/search-groups.tsx b/src/control/search-bar/search-groups/search-groups.tsx index bc448f9a0..31c395490 100644 --- a/src/control/search-bar/search-groups/search-groups.tsx +++ b/src/control/search-bar/search-groups/search-groups.tsx @@ -77,11 +77,11 @@ export const SearchGroups = defineComponent({ const editLinkTitle = (groupItem: IBackendSearchBarGroup) => { if (groupItem.saved) { if (groupItem.noEdit) { - return '配置的分组不可编辑'; + return ibiz.i18n.t('control.searchBar.searchGroups.notEditPrompt'); } return ''; } - return '请先保存该分组'; + return ibiz.i18n.t('control.searchBar.searchGroups.savePrompt'); }; // 点击分组项 @@ -109,22 +109,29 @@ export const SearchGroups = defineComponent({ // 删除分组 const removeGroup = (groupItem: IBackendSearchBarGroup) => { ElMessageBox({ - title: '确认删除', + title: ibiz.i18n.t('control.searchBar.searchGroups.delTitle'), message: () => { return (
-
- 确认删除分组{groupItem.caption || groupItem.name} - 吗? +
+
+ {ibiz.i18n.t( + 'control.searchBar.searchGroups.unrecoverablePrompt', + )}
-
分组删除后不可恢复
); }, showCancelButton: true, - confirmButtonText: '确定', + confirmButtonText: ibiz.i18n.t('control.common.determine'), confirmButtonClass: ns.b('remove-confirm-btn'), - cancelButtonText: '取消', + cancelButtonText: ibiz.i18n.t('app.cancel'), cancelButtonClass: ns.b('remove-cancel-btn'), }) .then(async () => { @@ -139,7 +146,9 @@ export const SearchGroups = defineComponent({ c.state.searchBarGroups.splice(index, 1); } } - ibiz.message.success('删除成功!'); + ibiz.message.success( + `${ibiz.i18n.t('control.common.deleteSuccess')}!`, + ); await c.initSearBarGroups(); } }) @@ -261,7 +270,7 @@ export const SearchGroups = defineComponent({ this.ns.is('selected', this.isActiveMore), ]} > - {this.c.model.groupMoreText || '更多'} + {this.c.model.groupMoreText || ibiz.i18n.t('app.more')}
), @@ -288,11 +297,15 @@ export const SearchGroups = defineComponent({ onClick={this.newGroup} > - 新建分组 + + {ibiz.i18n.t('control.searchBar.searchGroups.newGroup')} + - 分组管理 + + {ibiz.i18n.t('control.searchBar.searchGroups.groupManage')} + ), @@ -300,7 +313,7 @@ export const SearchGroups = defineComponent({ {{ @@ -312,10 +325,17 @@ export const SearchGroups = defineComponent({ label-position='top' rules={this.newFormRules} > - + @@ -328,10 +348,12 @@ export const SearchGroups = defineComponent({ class={this.ns.b('cancel-btn')} onClick={this.handleNewFormCancel} > - 取 消 + {ibiz.i18n.t('control.searchBar.searchGroups.dialogCancel')}
- 确 定 + {ibiz.i18n.t( + 'control.searchBar.searchGroups.dialogDetermine', + )} ); @@ -340,7 +362,7 @@ export const SearchGroups = defineComponent({ {{ @@ -352,10 +374,17 @@ export const SearchGroups = defineComponent({ label-position='top' rules={this.editFormRules} > - + @@ -368,10 +397,12 @@ export const SearchGroups = defineComponent({ class={this.ns.b('cancel-btn')} onClick={this.handleEditFormCancel} > - 取 消 + {ibiz.i18n.t('control.searchBar.searchGroups.dialogCancel')}
- 确 定 + {ibiz.i18n.t( + 'control.searchBar.searchGroups.dialogDetermine', + )} ); @@ -380,14 +411,14 @@ export const SearchGroups = defineComponent({
- Tips:管理搜索栏的分组 + {ibiz.i18n.t('control.searchBar.searchGroups.manageTips')}
- 新建分组 + + {ibiz.i18n.t('control.searchBar.searchGroups.newGroup')}
-
名称
-
显示
-
操作
+
+ {ibiz.i18n.t('control.searchBar.searchGroups.name')} +
+
+ {ibiz.i18n.t('control.searchBar.searchGroups.show')} +
+
+ {ibiz.i18n.t('control.searchBar.searchGroups.operate')} +
this.editGroup(groupItem)} > - 编辑 + {ibiz.i18n.t('app.edit')} this.removeGroup(groupItem)} > - 删除 + {ibiz.i18n.t('app.delete')}
diff --git a/src/control/toolbar/export-excel/export-excel.tsx b/src/control/toolbar/export-excel/export-excel.tsx index f0047e3b7..95814c909 100644 --- a/src/control/toolbar/export-excel/export-excel.tsx +++ b/src/control/toolbar/export-excel/export-excel.tsx @@ -71,7 +71,7 @@ export const IBizExportExcel = defineComponent({ this.onCommand('maxRowCount', e) } > - 导出全部(最大导出1000行) + {ibiz.i18n.t('control.toolbar.exportExcel.exportAll')} , - 导出当前页 + {ibiz.i18n.t('control.toolbar.exportExcel.expCurrentPage')} , - 导出当前选中 + {ibiz.i18n.t('control.toolbar.exportExcel.expCurrentSelect')} , - 页 + {ibiz.i18n.t('control.toolbar.exportExcel.page')} @@ -135,7 +135,7 @@ export const IBizExportExcel = defineComponent({ } size='small' > - 导出 + {ibiz.i18n.t('control.toolbar.exportExcel.export')} , ]; @@ -165,15 +165,15 @@ export const IBizExportExcel = defineComponent({ return ( - 导出全部(最大导出1000行) + {ibiz.i18n.t('control.toolbar.exportExcel.exportAll')} - 导出当前页 + {ibiz.i18n.t('control.toolbar.exportExcel.expCurrentPage')} - 导出当前选中 + {ibiz.i18n.t('control.toolbar.exportExcel.expCurrentSelect')} @@ -212,7 +212,7 @@ export const IBizExportExcel = defineComponent({ event.stopPropagation(); }} > - 页 + {ibiz.i18n.t('control.toolbar.exportExcel.page')} @@ -220,7 +220,7 @@ export const IBizExportExcel = defineComponent({ } size='small' > - 导出 + {ibiz.i18n.t('control.toolbar.exportExcel.export')} diff --git a/src/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.tsx b/src/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.tsx index 94f0ed013..ce6eb4095 100644 --- a/src/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.tsx +++ b/src/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.tsx @@ -56,7 +56,11 @@ export const TreeGridExEditColumn = 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/tree-grid-ex/tree-grid-ex.tsx b/src/control/tree-grid-ex/tree-grid-ex.tsx index 02aad1567..373deec93 100644 --- a/src/control/tree-grid-ex/tree-grid-ex.tsx +++ b/src/control/tree-grid-ex/tree-grid-ex.tsx @@ -157,7 +157,9 @@ export const TreeGridExControl = defineComponent({ // 开启行编辑 await c.switchRowEdit(row, true); } else { - throw new RuntimeError(`找不到${data.id}的行数据对象`); + throw new RuntimeError( + ibiz.i18n.t('control.treeGridEx.notFoundMessage', { id: data.id }), + ); } } else { c.onTreeNodeClick(nodeData, event); @@ -203,7 +205,9 @@ export const TreeGridExControl = defineComponent({ const onExpandChange = (row: IData, expanded: boolean) => { const nodeData = c.getNodeData(row._uuid); if (!nodeData) { - throw new RuntimeError(`没有找到_uuid为${row._uuid}的节点`); + throw new RuntimeError( + ibiz.i18n.t('control.common.notFoundNode', { id: row._uuid }), + ); } c.onExpandChange(nodeData, expanded); }; diff --git a/src/control/tree-grid-ex/use-row-edit-popover.tsx b/src/control/tree-grid-ex/use-row-edit-popover.tsx index 55061ad60..5457c6f99 100644 --- a/src/control/tree-grid-ex/use-row-edit-popover.tsx +++ b/src/control/tree-grid-ex/use-row-edit-popover.tsx @@ -20,7 +20,7 @@ export function useRowEditPopover( const findTrEl = (row: TreeGridExRowState): HTMLElement => { if (!tableRef.value) { - throw new RuntimeError('找不到表格组件引用'); + throw new RuntimeError(ibiz.i18n.t('control.common.citeErrMessage')); } const tableEl = tableRef.value.$el as HTMLElement; @@ -31,7 +31,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; }; @@ -42,7 +42,7 @@ export function useRowEditPopover( showPlaceholder.value = trEl.parentNode?.lastElementChild === trEl; 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/tree-grid/tree-grid.tsx b/src/control/tree-grid/tree-grid.tsx index 7220ef467..d22dbcbac 100644 --- a/src/control/tree-grid/tree-grid.tsx +++ b/src/control/tree-grid/tree-grid.tsx @@ -161,7 +161,9 @@ export const TreeGridControl = defineComponent({ >
- 已选中{c.state.selectedData.length}项 + {ibiz.i18n.t('control.common.itemsSelected', { + length: c.state.selectedData.length, + })}
|
{ const elTree = treeRef.value; if (!elTree) { - throw new RuntimeError('找不到el-tree实例对象'); + throw new RuntimeError(ibiz.i18n.t('control.tree.notFoundInstance')); } return elTree; }; @@ -116,6 +116,8 @@ export function formatNodeDropType( case 'after': return 'next'; default: - throw new RuntimeError(`暂不支持dropType:${dropType}`); + throw new RuntimeError( + ibiz.i18n.t('control.tree.notSupported', { dropType }), + ); } } diff --git a/src/control/tree/tree.tsx b/src/control/tree/tree.tsx index 279dd3e06..92134ae9b 100644 --- a/src/control/tree/tree.tsx +++ b/src/control/tree/tree.tsx @@ -489,7 +489,9 @@ export const TreeControl = defineComponent({ const updateNodeExpand = (data: IData, expanded: boolean) => { const nodeData = findNodeData(data._uuid, c); if (!nodeData) { - throw new RuntimeError(`没有找到_uuid为${data._uuid}的节点`); + throw new RuntimeError( + ibiz.i18n.t('control.common.notFoundNode', { id: data._uuid }), + ); } c.onExpandChange(nodeData, expanded); }; diff --git a/src/control/wizard-panel/wizard-panel.tsx b/src/control/wizard-panel/wizard-panel.tsx index d2ae61971..e03b7bb0d 100644 --- a/src/control/wizard-panel/wizard-panel.tsx +++ b/src/control/wizard-panel/wizard-panel.tsx @@ -68,7 +68,9 @@ export const WizardPanelControl = defineComponent({ this.c.onPrevClick(); }} > - {dewizard.prevCaption ? dewizard.prevCaption : '后退'} + {dewizard.prevCaption + ? dewizard.prevCaption + : ibiz.i18n.t('control.common.retreat')} )} {buttonsState[`${activeFormTag}@NEXT`]?.visible && ( @@ -77,7 +79,9 @@ export const WizardPanelControl = defineComponent({ this.c.onNextClick(); }} > - {dewizard.nextCaption ? dewizard.nextCaption : '前进'} + {dewizard.nextCaption + ? dewizard.nextCaption + : ibiz.i18n.t('control.common.forward')} )} {buttonsState[`${activeFormTag}@FINISH`]?.visible && ( @@ -86,7 +90,9 @@ export const WizardPanelControl = defineComponent({ this.c.onFinishClick(); }} > - {dewizard.finishCaption ? dewizard.finishCaption : '完成'} + {dewizard.finishCaption + ? dewizard.finishCaption + : ibiz.i18n.t('app.complete')} )}
diff --git a/src/locale/en/index.ts b/src/locale/en/index.ts index 3f5610ea2..4b4d9da14 100644 --- a/src/locale/en/index.ts +++ b/src/locale/en/index.ts @@ -13,31 +13,55 @@ export default { add: 'Add', delete: 'Delete', save: 'Save', + edit: 'Edit', + complete: 'Complete', + more: 'More', }, // 视图 view: {}, // 部件 control: { + common: { + determine: 'Determine', + retreat: 'Retreat', + forward: 'Forward', + noSupportItem: '{name} is currently not supported', + notFoundNode: 'Node with _uuid {id} not found', + itemsSelected: '{length} items selected', + citeErrMessage: 'Unable to find table component reference', + noDomErrMessage: 'Unable to find corresponding table row dom element', + noPopErrMessage: 'Unable to obtain an instance of the pop component', + currentNoData: 'Current no data', + updateSuccess: 'Update success', + newSuccCreated: 'New successfully created', + deleteSuccess: 'Delete successful', + }, menu: { noSupportAlign: 'The menu direction {align} is not supported temporarily', + notFoundModel: 'no find the menu item model {menuKey}', + notFoundFunction: + 'The adapter for {menuKey} does not have a renderText method', }, calendar: { - lastYear: 'Last Year', - lastMonth: 'Last Month', + lastYear: 'Last year', + lastMonth: 'Last month', today: 'Today', - nextMonth: 'Next Month', - nextYear: 'Next Year', + nextMonth: 'Next month', + nextYear: 'Next year', }, chart: { - chartPlaceholder: 'chart', + chartPlaceholder: 'Chart', }, dashboard: { + customDashboardContainer: { + portalCustomPrompt: 'Portal customization', + }, dashboardDesign: { global: 'Global level', add: 'Add', customPortal: 'Customize portal', colNum: 'Column number', - cellHeight: 'Cell Height', + cellHeight: 'Cell height', restoreDefault: 'Restore default', save: 'Save', }, @@ -55,6 +79,85 @@ export default { formMDctrlForm: { notFindProvider: 'Provider not found for form', }, + formMDctrlRepeater: { + noSupportStyle: + 'Repeater style {repeaterStyle} is currently not supported', + }, + repeaterGrid: { + promptInformation: 'Do you want to delete the selected item', + absentOrLoad: 'Not present or loading', + }, + repeaterSingleForm: { + errorMessage: 'No repeatedForm', + }, + mdCtrlContainer: { + promptInformation: 'Do you want to delete the selected item', + noSlot: 'Item slot not provided', + }, + formMDctrl: { + errorMessage: + 'The content type is currently not supported as {contentType}', + }, + }, + gantt: { + complete: 'Completed amount', + total: 'Total', + deadline: 'Deadline', + }, + kanban: { + selectAll: 'Select all', + selectedDataCount: 'Selected {length} pieces of data', + newPrompt: 'Newly build', + natchOperation: 'Batch operation', + }, + reportPanel: { + unrealized: 'Unrealized', + }, + searchBar: { + saveGroup: 'Save group', + filter: 'Filter', + filterTree: { + addItem: 'Add item', + search: 'Search', + reset: 'Reset', + }, + searchGroups: { + groupValueRule: 'Group name cannot be empty', + errorMessage: 'Group name cannot be duplicate!', + notEditPrompt: 'The configured grouping is not editable', + savePrompt: 'Please save the group first', + delTitle: 'Confirm delete', + confirmDelPrompt: + 'Are you sure to delete group {itemName}{num} backend jobs currently executing, please wait', + }, extendActionTimeLine: { - processTime: 'processing time', + processTime: 'Processing time', comments: 'Approval opinions', + reject: 'Reject', + }, + mapChart: { + high: 'High', + low: 'Low', }, pagination: { display: 'Display', - piece: 'piece', - total: 'total', - pieceData: 'piece of data', + piece: 'Piece', + total: 'Total', + pieceData: 'Piece of data', }, rawItem: { errorConfig: '{type} type custom parameter configuration error', diff --git a/src/locale/zh-CN/index.ts b/src/locale/zh-CN/index.ts index 8ff84d7c4..fdcd43395 100644 --- a/src/locale/zh-CN/index.ts +++ b/src/locale/zh-CN/index.ts @@ -13,13 +13,33 @@ export default { add: '添加', delete: '删除', save: '保存', + edit: '编辑', + complete: '完成', + more: '更多', }, // 视图 view: {}, // 部件 control: { + common: { + determine: '确定', + retreat: '后退', + forward: '前进', + noSupportItem: '{name}暂未支持', + notFoundNode: '没有找到_uuid为{id}的节点', + itemsSelected: '已选中{length}项', + citeErrMessage: '找不到表格组件引用', + noDomErrMessage: '找不到对应的表格行dom元素', + noPopErrMessage: '拿不到pop组件的实例', + currentNoData: '暂无数据', + updateSuccess: '更新成功', + newSuccCreated: '新建成功', + deleteSuccess: '删除成功', + }, menu: { noSupportAlign: '暂未支持菜单方向为 {align}', + notFoundModel: '没找到菜单项模型{menuKey}', + notFoundFunction: '{menuKey}的适配器没有renderText方法', }, calendar: { lastYear: '去年', @@ -32,6 +52,9 @@ export default { chartPlaceholder: '图表', }, dashboard: { + customDashboardContainer: { + portalCustomPrompt: '门户定制', + }, dashboardDesign: { global: '全局', add: '添加', @@ -55,6 +78,82 @@ export default { formMDctrlForm: { notFindProvider: '未找到表单的适配器', }, + formMDctrlRepeater: { + noSupportStyle: '暂未支持重复器样式{repeaterStyle}', + }, + repeaterGrid: { + promptInformation: '是否删除选中项', + absentOrLoad: '不存在或加载中', + }, + repeaterSingleForm: { + errorMessage: '没有repeatedForm', + }, + mdCtrlContainer: { + promptInformation: '是否删除选中项', + noSlot: '未提供item插槽', + }, + formMDctrl: { + errorMessage: '暂未支持内容类型为{contentType}', + }, + }, + gantt: { + complete: '完成量', + total: '总量', + deadline: '截止时间', + }, + kanban: { + selectAll: '全选', + selectedDataCount: '已选择{length}条数据', + newPrompt: '新建', + natchOperation: '批量操作', + }, + reportPanel: { + unrealized: '暂未实现', + }, + searchBar: { + saveGroup: '保存分组', + filter: '过滤', + filterTree: { + addItem: '添加项', + search: '搜索', + reset: '重置', + }, + searchGroups: { + groupValueRule: '分组名称不能为空', + errorMessage: '分组名称不能重复!', + notEditPrompt: '配置的分组不可编辑', + savePrompt: '请先保存该分组', + delTitle: '确认删除', + confirmDelPrompt: '确认删除分组{itemName}吗?', + unrecoverablePrompt: '分组删除后不可恢复', + newGroup: '新建分组', + groupManage: '分组管理', + groupName: '分组名称', + enterPrompt: '请输入分组名称', + editGroup: '编辑分组', + manageTips: 'Tips:管理搜索栏的分组', + name: '名称', + show: '显示', + operate: '操作', + dialogCancel: '取 消', + dialogDetermine: '确 定', + }, + }, + toolbar: { + exportExcel: { + exportAll: '导出全部(最大导出1000行)', + expCurrentPage: '导出当前页', + expCurrentSelect: '导出当前选中', + page: '页', + export: '导出', + }, + }, + tree: { + notFoundInstance: '找不到el-tree实例对象', + notSupported: '暂不支持dropType:{dropType}', + }, + treeGridEx: { + notFoundMessage: '找不到{id}的行数据对象', }, }, // 组件 @@ -81,6 +180,7 @@ export default { reUpload: '重新上传文件', fileUpload: '文件上传', import: '导入', + selectProperties: '请选择列导入属性!', }, dataImport2Select: { selectMode: '选择导入模式', @@ -89,9 +189,18 @@ export default { dataImport2Table: { selectAttribute: '选择当前列对应的导入属性', }, + doingNotice: { + jobInProgress: + '有{num}个后台作业正在执行,请稍后', + }, extendActionTimeLine: { processTime: '处理时间', comments: '审批意见', + reject: '驳回', + }, + mapChart: { + high: '高', + low: '低', }, pagination: { display: '显示', -- Gitee