From 28d2ff704e67d65409d0152c5b3ead36447e1725 Mon Sep 17 00:00:00 2001 From: OG T Date: Thu, 9 Apr 2026 11:18:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20C1=20=E6=AE=98=E7=95=99=20i18n=20?= =?UTF-8?q?=E2=80=94=205=20=E8=99=95=E7=A1=AC=E7=B7=A8=E7=A2=BC=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E6=94=B9=20useTranslations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 告警 badge: alertBadge / alertBadgeZero - 等待確認: awaitingConfirm - 主機/拓撲 toggle: hostView / topoView - HOST_CATALOG description 確認未渲染,不需 i18n Co-Authored-By: Claude Sonnet 4.6 --- apps/web/messages/en.json | 5 ++++- apps/web/messages/zh-TW.json | 5 ++++- apps/web/src/app/[locale]/page.tsx | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index 650b038f..8124832a 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -195,7 +195,10 @@ "hostView": "Hosts", "topoView": "Topology", "waitingHostData": "Waiting for host data...", - "dashboardConnecting": "Dashboard API connecting..." + "dashboardConnecting": "Dashboard API connecting...", + "alertBadge": "{count} alerts", + "alertBadgeZero": "0 alerts", + "awaitingConfirm": "⏳ Awaiting Confirmation" }, "openclaw": { "name": "OpenClaw", diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index 74a03094..a56312d9 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -196,7 +196,10 @@ "hostView": "主機", "topoView": "拓撲", "waitingHostData": "等待主機資料...", - "dashboardConnecting": "Dashboard API 連線中" + "dashboardConnecting": "Dashboard API 連線中", + "alertBadge": "{count} 告警", + "alertBadgeZero": "0 告警", + "awaitingConfirm": "⏳ 等待確認" }, "openclaw": { "name": "OpenClaw", diff --git a/apps/web/src/app/[locale]/page.tsx b/apps/web/src/app/[locale]/page.tsx index 6264ef4f..679ae2fb 100644 --- a/apps/web/src/app/[locale]/page.tsx +++ b/apps/web/src/app/[locale]/page.tsx @@ -373,7 +373,7 @@ function MonitoringTools() { fontSize: 10, padding: '1px 7px', borderRadius: 8, fontWeight: 600, background: 'rgba(245,158,11,0.12)', color: '#F59E0B', }}> - {tool.firing_count} 告警 + {tDash('alertBadge', { count: tool.firing_count })} ) : ( - 0 告警 + {tDash('alertBadgeZero')} )} @@ -683,7 +683,7 @@ export default function Home({ params }: { params: { locale: string } }) { label: tDashboard('pendingApprovals'), value: pendingApprovals ?? '--', sub: hasPendingApprovals ? undefined : tDashboard('stable'), - badge: hasPendingApprovals ? { text: `⏳ 等待確認`, color: '#F59E0B', bg: 'rgba(245,158,11,0.08)' } : undefined, + badge: hasPendingApprovals ? { text: tDashboard('awaitingConfirm'), color: '#F59E0B', bg: 'rgba(245,158,11,0.08)' } : undefined, valueColor: hasPendingApprovals ? '#F59E0B' : undefined, }, { @@ -998,7 +998,7 @@ export default function Home({ params }: { params: { locale: string } }) { color: infraView === 'host' ? '#d97757' : '#87867f', boxShadow: infraView === 'host' ? '0 1px 2px rgba(0,0,0,0.06)' : 'none', }} - >主機 + >{tDashboard('hostView')} + >{tDashboard('topoView')} {/* 主機網格 (預設) */}