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 (