translation for nodes

This commit is contained in:
codetypes committed 2024-04-19 13:20:46 +08:00
1 parent 1e614a6c18
commit 0ff92fe429
4 files changed
+5 -2

No files matched your search

+1
View File
@@ -24,6 +24,7 @@
"newFile": "New File...",
"newFolder": "New Folder...",
"newWindow": "New Window",
"nodeDefinition": "NODES",
"open": "Open...",
"openProject": "Open Project",
"paste": "Paste",
+1
View File
@@ -24,6 +24,7 @@
"newFile": "新建行为树...",
"newFolder": "新建目录...",
"newWindow": "新建窗口",
"nodeDefinition": "节点定义",
"open": "打开...",
"openProject": "打开项目",
"paste": "粘贴",
+1
View File
@@ -136,6 +136,7 @@ export const Explorer: FC = () => {
}
if (workspace.nodeTree) {
workspace.nodeTree.title = t("nodeDefinition");
workspace.nodeTree.icon = (
<Flex justify="center" align="center" style={{ height: "100%" }}>
<PiTreeStructureFill size={19} />
+2 -2
View File
@@ -445,7 +445,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
const workspace = get();
const nodeDefData = readJson(`${workspace.workdir}/node-config.b3-setting`) as NodeDef[];
const nodeTree: NodeTreeType = {
title: "NODES",
title: i18n.t("nodeDefinition"),
children: [],
style: {
fontWeight: "bold",
@@ -455,7 +455,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
const nodeDefs: Map<string, NodeDef> = new Map();
for (const v of nodeDefData) {
nodeDefs.set(v.name, v);
let catalog: NodeTreeType | undefined = nodeTree.children?.find((nt) => nt.title === v.type);
let catalog = nodeTree.children?.find((nt) => nt.title === v.type);
if (!catalog) {
catalog = {
title: v.type,