🐛 fix(i18n): 收口 dev 合并后的业务提示多语言遗漏

This commit is contained in:
tianqijiuyun-latiao
2026-06-23 18:26:20 +08:00
parent 09ae3d74c4
commit 71989af586
33 changed files with 1556 additions and 150 deletions

View File

@@ -1,3 +1,5 @@
import { getCurrentLanguage, t } from '../i18n';
export type ExportProgressStatus = 'idle' | 'start' | 'running' | 'finalizing' | 'done' | 'error';
const hasUsableExportTotal = (total: number, totalRowsKnown: boolean): boolean => {
@@ -54,13 +56,16 @@ export const formatExportProgressRows = (
total: number,
totalRowsKnown: boolean,
): string => {
const formatter = new Intl.NumberFormat('zh-CN');
const formatter = new Intl.NumberFormat(getCurrentLanguage());
const safeCurrent = formatter.format(Math.max(0, Math.trunc(Number(current) || 0)));
if (!hasUsableExportTotal(total, totalRowsKnown)) {
return `已写入 ${safeCurrent}`;
return t('data_export.progress.rows_written', { current: safeCurrent });
}
const safeTotal = formatter.format(Math.max(0, Math.trunc(Number(total) || 0)));
return `已写入 ${safeCurrent} / ${safeTotal}`;
return t('data_export.progress.rows_written_with_total', {
current: safeCurrent,
total: safeTotal,
});
};
export const resolveExportElapsedMs = (