feat(frontend): 控制台 next-intl 中英双语

接入无 URL 前缀的 zh-CN/en,顶栏与外观设置可切换语言;选择写入 cookie 后刷新生效。
This commit is contained in:
ryan
2026-08-16 16:49:16 +08:00
parent 64fbaa7ef1
commit 5a8722ff07
219 changed files with 21437 additions and 5212 deletions
@@ -8,6 +8,7 @@ import {
useRef,
useState,
} from 'react';
import { useTranslations } from 'next-intl';
import {
addEdge,
applyEdgeChanges,
@@ -82,6 +83,7 @@ export function RuleFlowCanvas({
onSelect,
onSelectEdge,
}: RuleFlowCanvasProps) {
const t = useTranslations('waf.editor');
const instance = useRef<ReactFlowInstance<FlowNode, FlowEdge> | null>(null);
const [nodes, setNodes, applyFlowNodeChanges] = useNodesState<FlowNode>(
buildFlowNodes(graph, issues, selectedId),
@@ -415,7 +417,7 @@ export function RuleFlowCanvas({
}}
>
<Trash2 className='size-4' />
{contextCanDeleteNode ? '删除节点' : '系统节点不可删除'}
{contextCanDeleteNode ? t('deleteNode') : t('systemNodeLocked')}
</button>
)}
{contextMenu.kind === 'edge' && (
@@ -435,7 +437,7 @@ export function RuleFlowCanvas({
}}
>
<Trash2 className='size-4' />
删除连线
{t('deleteEdge')}
</button>
)}
</div>