From 3ce85617dac0e5a4a10c199f05f54a44181f3e3b Mon Sep 17 00:00:00 2001 From: tianqijiuyun-latiao <69459608+tianqijiuyun-latiao@users.noreply.github.com> Date: Tue, 23 Jun 2026 13:14:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E6=94=B6=E5=8F=A3=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=89=8D=E7=AB=AF=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DataExportDialog.tsx | 25 +- .../components/DataExportFlow.i18n.test.ts | 57 +++ .../src/components/DataGrid.layout.test.tsx | 88 ++--- .../src/components/ExportProgressModal.tsx | 25 +- .../components/TableExportWorkbench.test.tsx | 6 +- .../src/components/TableExportWorkbench.tsx | 331 ++++++++++-------- shared/i18n/de-DE.json | 114 +++++- shared/i18n/en-US.json | 114 +++++- shared/i18n/ja-JP.json | 114 +++++- shared/i18n/ru-RU.json | 114 +++++- shared/i18n/zh-CN.json | 114 +++++- shared/i18n/zh-TW.json | 114 +++++- 12 files changed, 1010 insertions(+), 206 deletions(-) create mode 100644 frontend/src/components/DataExportFlow.i18n.test.ts diff --git a/frontend/src/components/DataExportDialog.tsx b/frontend/src/components/DataExportDialog.tsx index 1e5995f..0625262 100644 --- a/frontend/src/components/DataExportDialog.tsx +++ b/frontend/src/components/DataExportDialog.tsx @@ -2,6 +2,7 @@ import Modal from './common/ResizableDraggableModal'; import React, { useEffect, useMemo, useState } from 'react'; import { Form, InputNumber, Select, message } from 'antd'; import { ExportOutlined } from '@ant-design/icons'; +import { t } from '../i18n'; export type DataExportFormat = 'csv' | 'xlsx' | 'json' | 'md' | 'html'; export type DataExportScope = 'selected' | 'page' | 'all' | 'filteredAll'; @@ -69,21 +70,23 @@ const validateDialogValues = ( scopeOptions: DataExportScopeOption[], ): string | null => { if (!DATA_EXPORT_FORMAT_OPTIONS.some((item) => item.value === values.format)) { - return '请选择导出格式'; + return t('data_export.dialog.validation.format_required'); } if (scopeOptions.length > 0) { const matchedScope = scopeOptions.find((item) => String(item.value) === String(values.scope)); if (!matchedScope || matchedScope.disabled) { - return '请选择可用的导出范围'; + return t('data_export.dialog.validation.scope_required'); } } if (values.format === 'xlsx') { const rows = Math.trunc(Number(values.xlsxMaxRowsPerSheet) || 0); if (!Number.isFinite(rows) || rows <= 0) { - return '请输入有效的每个工作表最大行数'; + return t('data_export.dialog.validation.xlsx_max_rows_required'); } if (rows > MAX_XLSX_ROWS_PER_SHEET) { - return `每个工作表最大行数不能超过 ${MAX_XLSX_ROWS_PER_SHEET.toLocaleString()}`; + return t('data_export.dialog.validation.xlsx_max_rows_limit', { + maxRows: MAX_XLSX_ROWS_PER_SHEET.toLocaleString(), + }); } } return null; @@ -108,7 +111,7 @@ const DataExportDialogContent: React.FC<{ return (