mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-14 02:46:37 +08:00
feat(frontend): 控制台 next-intl 中英双语
接入无 URL 前缀的 zh-CN/en,顶栏与外观设置可切换语言;选择写入 cookie 后刷新生效。
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user