From a8f6fd190bd161cc2041d89b439a9707dc26a2b4 Mon Sep 17 00:00:00 2001 From: attacker Date: Sat, 11 Jul 2026 15:15:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(i18n):=20U22=20=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=BB=84=E4=BB=B6=20i18n=20=E6=B2=BB?= =?UTF-8?q?=E7=90=86=20=E2=80=94=20QuickQueryBar/types-v3/TimeRangePicker/?= =?UTF-8?q?LogRBAC=20=E4=B8=AD=E6=96=87=E9=94=AE=E6=B8=85=E9=9B=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - QuickQueryBar.tsx: 23 处中文键 → monitor.logCenter.quickQuery.* 语义键 - types-v3.ts: 15 处中文键 → monitor.logCenter.quickQuery.* 语义键 (含 QUICK_TEMPLATES 3 引擎) - TimeRangePicker.tsx: 13 处中文键 → monitor.timeRangePicker.* 语义键 + 修复 3 个复制粘贴 bug 键 (i18n.t('开启后折叠行仅显示前 500 字预览') 应为 '选择时间范围'/'绝对时间'/'自定义时间范围') (i18n.t(' > 另存为 = { viewer: i18n.t('pipeline.viewer'), - analyst: i18n.t('分析者'), + analyst: i18n.t('monitor.logRbac.analyst'), }; const ENGINE_LABEL: Record = { @@ -108,7 +108,7 @@ export default function LogRBAC() { const handleCreate = async () => { if (!newName.trim() || !newCode.trim() || !newPattern.trim()) { - toast.error(i18n.t('请填写名称、标识与正则')); return; + toast.error(i18n.t('monitor.logRbac.fillRequired')); return; } setSaving(true); try { @@ -147,8 +147,8 @@ export default function LogRBAC() { const handleDelete = async (role: LogScopeRole) => { const ok = await _confirm({ - title: i18n.t('删除权限'), - description: `确定删除「${role.name}」?将影响 ${matchCount[role.id]?.length || 0} 个示例范围`, + title: i18n.t('monitor.logRbac.deletePermission'), + description: i18n.t('monitor.logRbac.deleteConfirm', { name: role.name, count: matchCount[role.id]?.length || 0 }), variant: 'destructive', }); if (!ok) return; @@ -165,7 +165,7 @@ export default function LogRBAC() { }; const handleAssign = async () => { - if (!selectedUserId || !assignRoleId) { toast.error(i18n.t('请选择用户和权限')); return; } + if (!selectedUserId || !assignRoleId) { toast.error(i18n.t('monitor.logRbac.selectUserAndPermission')); return; } setAssignLoading(true); try { await logRbacApi.assignRole(Number(selectedUserId), { @@ -189,8 +189,8 @@ export default function LogRBAC() { const selectedUser = users.find((u) => String(u.id) === selectedUserId); const pageTabs = [ - { id: 'roles', label: i18n.t('权限策略'), badge: roles.length || undefined }, - { id: 'users', label: i18n.t('用户授权') }, + { id: 'roles', label: i18n.t('monitor.logRbac.permissionPolicy'), badge: roles.length || undefined }, + { id: 'users', label: i18n.t('monitor.logRbac.userAssignment') }, { id: 'preview', label: i18n.t('pipeline.matchPreview') }, ]; @@ -206,7 +206,7 @@ export default function LogRBAC() { onTabChange={setActiveTab} actions={( )} contentClassName="space-y-4" @@ -215,8 +215,8 @@ export default function LogRBAC() { roles.length === 0 ? ( } - title={i18n.t('暂无日志权限策略')} - description={i18n.t('创建策略并分配给用户后,将按正则限制可查询的索引与 Label 范围')} + title={i18n.t('monitor.logRbac.noPolicies')} + description={i18n.t('monitor.logRbac.noPoliciesDesc')} action={} /> ) : ( @@ -243,7 +243,7 @@ export default function LogRBAC() { className="text-[10px] cursor-pointer border-[var(--dg-border)]" onClick={() => { setActiveTab('preview'); setPreviewRoleId(role.id); }} > - {matchCount[role.id]?.length || 0} 个范围 + {i18n.t('monitor.logRbac.scopeCount', { count: matchCount[role.id]?.length || 0 })}

@@ -259,7 +259,7 @@ export default function LogRBAC() { {i18n.t('pipeline.viewer')} - {i18n.t('分析者')} + {i18n.t('monitor.logRbac.analyst')} @@ -285,7 +285,7 @@ export default function LogRBAC() {

- 用户未分配任何策略时不拦截(向后兼容);分配后仅允许命中策略的查询。 + {i18n.t('monitor.logRbac.userPolicyHint')}

@@ -302,7 +302,7 @@ export default function LogRBAC() {
- +