refactor(i18n): U37 全量 JSX 文本节点硬编码中文清零 — 65 文件 151 处→0, 新增 common.* 98 翻译键, zh/en 对齐, tsc -b=0, npm build✓ (17.96s), ESLint=0/43/any=0, go build=0, 17/17 测试通过

This commit is contained in:
attacker committed 2026-07-13 06:39:08 +08:00
1 parent e274ba7b9b
commit 7c80e35411
68 files changed
+11819 -11622

No files matched your search

@@ -107,7 +107,7 @@ export function AlertRulesTab({
{/* 批量操作栏 // Logan.Li */}
{selectedIds.length > 0 && (
<div className="flex items-center gap-2 mb-3">
<span className="text-sm dg-text-secondary">已选择 {selectedIds.length} 项</span>
<span className="text-sm dg-text-secondary">{i18n.t('common.selectedCount', { count: selectedIds.length })}</span>
<Button
variant="outline"
size="sm"
@@ -99,7 +99,7 @@ export default function PrometheusDatasourceManager() {
description={i18n.t('monitor.promDs2.addHint')}
action={(
<Button onClick={openCreate} size="sm" className="dg-btn-primary">
<Plus className="w-4 h-4 mr-1" />添加数据源
<Plus className="w-4 h-4 mr-1" />{i18n.t("common.addDatasource")}
</Button>
)}
/>
@@ -61,10 +61,10 @@ export function LogAlertsPanel() {
<p className="text-sm text-[var(--dg-text-muted)]"> {i18n.t('monitor.logAlertSpanel.desc')} </p>
<div className="flex gap-2">
<Button variant="outline" size="sm" onClick={load} disabled={loading}>
<RefreshCw className={`h-4 w-4 mr-1 ${loading ? 'animate-spin' : ''}`} />刷新
<RefreshCw className={`h-4 w-4 mr-1 ${loading ? 'animate-spin' : ''}`} />{i18n.t("common.refresh")}
</Button>
<Button size="sm" onClick={() => { setEditing(null); setDialogOpen(true); }}>
<Plus className="h-4 w-4 mr-1" />新建
<Plus className="h-4 w-4 mr-1" />{i18n.t("common.buildNew")}
</Button>
</div>
</div>
@@ -41,7 +41,7 @@ export function LogClusterPanel({ clusters }: Props) {
<div className="border rounded-lg overflow-hidden" style={{ borderColor: 'var(--dg-border)' }}>
{/* 头部 */}
<div className="flex items-center justify-between px-4 py-2" style={{ background: 'var(--dg-bg-tertiary)', borderBottom: '1px solid var(--dg-border)' }}>
<span className="text-xs" style={{ color: 'var(--dg-text-muted)' }}>共 {clusters.length} 个聚类模式,总计 {total.toLocaleString()} 条日志</span>
<span className="text-xs" style={{ color: 'var(--dg-text-muted)' }}>{i18n.t('common.clusterMode', { count: clusters.length })},{i18n.t('common.totalLogs', { count: total.toLocaleString() })}</span>
<span className="text-[10px]" style={{ color: 'var(--dg-text-muted)' }}> {i18n.t('monitor.logClusterPanel.desc')} </span>
</div>
@@ -96,8 +96,8 @@ export function LogClusterPanel({ clusters }: Props) {
{cluster.sample}
</div>
<div className="flex gap-4 mt-2 text-[10px]" style={{ color: 'var(--dg-text-muted)' }}>
<span>数量:{cluster.count.toLocaleString()}</span>
<span>占比:{cluster.percentage.toFixed(2)}%</span>
<span>{i18n.t('common.countLabel')}:{cluster.count.toLocaleString()}</span>
<span>{i18n.t('common.percentage')}:{cluster.percentage.toFixed(2)}%</span>
</div>
</div>
)}
@@ -154,7 +154,7 @@ export function LogDatasourcePage() {
toolbarExtra={
<>
<Button variant="outline" size="sm" className="h-8 border-[var(--dg-border)] text-[var(--dg-text-secondary)] hover:bg-[var(--dg-bg-hover)] hover:text-[var(--dg-text-primary)]" onClick={load}>
<RefreshCw className="h-3.5 w-3.5 mr-1" />刷新
<RefreshCw className="h-3.5 w-3.5 mr-1" />{i18n.t("common.refresh")}
</Button>
<Button size="sm" className="h-8" onClick={() => handleAdd('loki')}>
<Plus className="h-4 w-4 mr-1" />Loki
@@ -57,7 +57,7 @@ export function LogQueryToolbar({
{st.text}
</span>
{queryTime !== undefined && (
<span className="text-xs" style={{ color: 'var(--dg-text-muted)' }}>耗时: {queryTime}ms</span>
<span className="text-xs" style={{ color: 'var(--dg-text-muted)' }}>{i18n.t('common.queryTime')}: {queryTime}ms</span>
)}
</div>
@@ -69,7 +69,7 @@ export function LogQueryToolbar({
className="h-7 px-1.5 text-[11px] rounded dg-input"
style={{ background: 'var(--dg-bg-tertiary)', border: '1px solid var(--dg-border)', color: 'var(--dg-text-primary)' }}
>
{[10, 20, 50, 100, 200].map(n => <option key={n} value={n}>每页 {n}</option>)}
{[10, 20, 50, 100, 200].map(n => <option key={n} value={n}>{i18n.t('common.perPage', { count: n })}</option>)}
</select>
<span className="text-[11px] mx-1" style={{ color: 'var(--dg-text-muted)' }}>
@@ -131,7 +131,7 @@ export function LogQueryToolbar({
className="h-7 w-10 text-center text-[11px] rounded dg-input"
style={{ background: 'var(--dg-bg-tertiary)', border: '1px solid var(--dg-border)', color: 'var(--dg-text-primary)' }}
/>
<span className="text-[10px]" style={{ color: 'var(--dg-text-muted)' }}>页</span>
<span className="text-[10px]" style={{ color: 'var(--dg-text-muted)' }}>{i18n.t("common.page")}</span>
</div>
</div>