fix(i18n): 回退到稳定的 32% 覆盖率状态 (tsc + Vite 构建通过)
批量转换脚本引入的语法错误已回退,保留稳定的 i18n 转换: - 翻译词典: 22 namespaces, 3600+ keys - 已接入: 145+ 文件 (Dashboard/Login/K8s 主页面/Monitor/System/Deploy) - 语言切换器在 Header 中可用 (🇨🇳/🇺🇸) - tsc 零错误, Vite 构建成功
This commit is contained in:
1 parent
ecec73989b
commit
72bfb0e12d
191 files changed
+5057
-7592
No files matched your search
@@ -1,14 +1,12 @@
|
||||
import { type ReactNode } from 'react';
|
||||
import { TrendingUp, TrendingDown } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import i18n from '@/i18n';
|
||||
|
||||
// 云厂商中文标签(主组件 + 弹窗共享) // Logan.Li
|
||||
export const providerLabels: Record<string, string> = {
|
||||
aliyun: i18n.t('cloud.aliyun'),
|
||||
tencent: i18n.t('cloud.tencent'),
|
||||
aliyun: '阿里云',
|
||||
tencent: '腾讯云',
|
||||
aws: 'AWS',
|
||||
huawei: i18n.t('cloud.huawei'),
|
||||
huawei: '华为云',
|
||||
azure: 'Azure',
|
||||
};
|
||||
|
||||
@@ -31,7 +29,6 @@ export const providerColors: Record<string, string> = {
|
||||
};
|
||||
|
||||
export function ProviderDot({ provider, className = 'w-2 h-2' }: { provider: string; className?: string }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<span
|
||||
className={`rounded-full shrink-0 ${className}`}
|
||||
@@ -52,7 +49,6 @@ export function StatCard({ icon, label, value, trend, trendLabel, alert }: {
|
||||
trendLabel?: string;
|
||||
alert?: boolean;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div className={alert ? 'dg-alert-banner' : 'rounded-lg border border-[var(--border-default)] bg-[var(--surface-raised)]/50 p-4'}>
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
@@ -72,9 +68,8 @@ export function StatCard({ icon, label, value, trend, trendLabel, alert }: {
|
||||
}
|
||||
|
||||
export function TrendChart({ data }: { data: { date: string; cost: number }[] }) {
|
||||
const { t } = useTranslation();
|
||||
if (data.length === 0) {
|
||||
return <p className="text-sm dg-text-muted py-8 text-center">{t('common.noData')}</p>;
|
||||
return <p className="text-sm dg-text-muted py-8 text-center">暂无数据</p>;
|
||||
}
|
||||
const max = Math.max(...data.map((d) => d.cost), 1);
|
||||
const recent = data.slice(-30);
|
||||
|
||||
Reference in new issue
Block a user