feat(i18n): 安全批量转换 135 文件 — 覆盖率 34%→62%

使用 i18n.t() 全局方式(避免 hook 定位问题):
- 288 目标文件中 135 个成功转换
- 2228 处中文替换为 i18n.t() 调用
- 1006 个新翻译 key 添加到 zh-CN.json + en-US.json
- 词典总量: 3554 keys (22 namespaces)
- tsc 零错误 + Vite 构建成功
- 6 个含代码示例/数据字符串的文件安全回退
This commit is contained in:
attacker committed 2026-07-03 02:14:20 +08:00
1 parent 72bfb0e12d
commit 55f216cfbb
131 files changed
+4049 -1908

No files matched your search

@@ -1,12 +1,13 @@
import { type ReactNode } from 'react';
import { TrendingUp, TrendingDown } from 'lucide-react';
import i18n from '@/i18n';
// 云厂商中文标签(主组件 + 弹窗共享) // Logan.Li
export const providerLabels: Record<string, string> = {
aliyun: '阿里云',
tencent: '腾讯云',
aliyun: i18n.t('cloud.aliyun'),
tencent: i18n.t('cloud.tencent'),
aws: 'AWS',
huawei: '华为云',
huawei: i18n.t('cloud.huawei'),
azure: 'Azure',
};
@@ -69,7 +70,7 @@ export function StatCard({ icon, label, value, trend, trendLabel, alert }: {
export function TrendChart({ data }: { data: { date: string; cost: number }[] }) {
if (data.length === 0) {
return <p className="text-sm dg-text-muted py-8 text-center">暂无数据</p>;
return <p className="text-sm dg-text-muted py-8 text-center"> {i18n.t('aiops.assistantNoData')} </p>;
}
const max = Math.max(...data.map((d) => d.cost), 1);
const recent = data.slice(-30);