From 3039b76cb535dea14bbdae3a3ad83d036a11fe59 Mon Sep 17 00:00:00 2001 From: attacker Date: Sun, 12 Jul 2026 09:48:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20U30=20=E4=BF=AE=E5=A4=8D=208=20?= =?UTF-8?q?=E5=A4=84=E6=89=B9=E9=87=8F=20i18n=20=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=8D=9F=E5=9D=8F=E7=9A=84=E8=B0=83=E7=94=A8=20=E2=80=94=20Dep?= =?UTF-8?q?loymentEditContainers/DeploymentEditStorage/AgentRuleDialog/Log?= =?UTF-8?q?FieldSidebar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 损坏原因: 早期批量正则 i18n 转换 (U20 记录的 i18n.t() 损坏模式遗留) 将模板表达式/JSX 碎片错误包裹进 i18n.t() 调用, 产生运行时垃圾文本渲染. 修复清单: - DeploymentEditContainers.tsx:85 — toast 调用 description 字段损坏 (i18n.t('), description: ...')) - DeploymentEditStorage.tsx:175 — !manifest 空状态文案损坏 - DeploymentEditStorage.tsx:202 — 数据卷卡片副标题损坏 - AgentRuleDialog.tsx:111 — DialogDescription 损坏 (i18n.t('>阈值 {ruleForm.metric !== ')) - AgentRuleDialog.tsx:157 — 操作符 Label 损坏 - AgentRuleDialog.tsx:183 — 端口 Label 损坏 - AgentRuleDialog.tsx:195 — 持续时间 Label 损坏 - LogFieldSidebar.tsx:68 — 搜索框 placeholder 损坏 新增 i18n 键 (zh/en 对齐 7370→7376 +6): - agent.ruleDialog.description / operator / port / duration - kubernetes.storage.volumeDesc - monitor.lbl.searchFields 验证: tsc -b=0, npm build✓ (17.99s), ESLint=0/53/0, go build=0, 17/17 测试通过 --- frontend/src/components/agent/AgentRuleDialog.tsx | 14 +++++++------- .../kubernetes/DeploymentEditContainers.tsx | 2 +- .../kubernetes/DeploymentEditStorage.tsx | 4 ++-- .../monitor/log-center/LogFieldSidebar.tsx | 2 +- frontend/src/locales/en-US.json | 12 +++++++++--- frontend/src/locales/zh-CN.json | 12 +++++++++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/agent/AgentRuleDialog.tsx b/frontend/src/components/agent/AgentRuleDialog.tsx index 15c0212..f082b64 100644 --- a/frontend/src/components/agent/AgentRuleDialog.tsx +++ b/frontend/src/components/agent/AgentRuleDialog.tsx @@ -108,7 +108,7 @@ export function AgentRuleDialog({ open, onOpenChange, editingRule, onSuccess }: {editingRule ? i18n.t('monitor.editRule') : i18n.t('agent.ruleDialog.editRule')} - {i18n.t('>阈值 {ruleForm.metric !== ')} + {i18n.t('agent.ruleDialog.description')}
@@ -154,7 +154,7 @@ export function AgentRuleDialog({ open, onOpenChange, editingRule, onSuccess }: {ruleForm.metric !== 'offline' && (
- + {i18n.t('agent.ruleDialog.port')} + setRuleForm({ ...ruleForm, port: e.target.value })} placeholder={i18n.t('agent.ruleDialog.portPlaceholder')} className="h-9 dg-input" @@ -192,7 +192,7 @@ export function AgentRuleDialog({ open, onOpenChange, editingRule, onSuccess }: )}
- + - {i18n.t('), description: `请为「${entry.volume.name}」${hint}`, variant: ')} + {i18n.t('kubernetes.storage.noManifest')} ); } @@ -199,7 +199,7 @@ export function DeploymentEditStorage({ clusterCode, namespace, deploymentName, 数据卷 {entries.length} -

{i18n.t('), description: `请为「${entry.volume.name}」${hint}`, variant: ')}

+

{i18n.t('kubernetes.storage.volumeDesc')}