From 0000f2a34d274d0785d6d7c6a8021ff38d8000fa Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sat, 18 Jun 2022 00:51:05 +0900 Subject: [PATCH] Support i18n in context menu --- .../@node-red/editor-client/locales/en-US/editor.json | 6 ++++++ .../@node-red/editor-client/locales/ja/editor.json | 6 ++++++ .../@node-red/editor-client/src/js/ui/contextMenu.js | 8 ++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json index 01107d49d..e3028272b 100755 --- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json @@ -1187,5 +1187,11 @@ "missing-config": "__prop__: missing configuration node", "validation-error": "__prop__: validation error: __node__, __id__: __error__" } + }, + "contextMenu": { + "insert": "Insert", + "node": "Node", + "junction": "Junction", + "linkNodes": "Link Nodes" } } diff --git a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json index 4c918b615..a78fb7d24 100644 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -1188,6 +1188,12 @@ "validation-error": "__prop__: チェックエラー: __node__, __id__: __error__" } }, + "contextMenu": { + "insert": "挿入", + "node": "ノード", + "junction": "分岐点", + "linkNodes": "Linkノード" + }, "action-list": { "toggle-show-tips": "ヒント表示切替", "show-about": "Node-REDの説明を表示", diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js index 379ed5433..9920789f5 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js @@ -48,10 +48,10 @@ RED.contextMenu = (function() { const menuItems = [ { onselect: 'core:show-action-list', onpostselect: function() {} }, { - label: 'Insert', + label: RED._("contextMenu.insert"), options: [ { - label: 'Node', + label: RED._("contextMenu.node"), onselect: function() { RED.view.showQuickAddDialog({ position: [ options.x - offset.left, options.y - offset.top ], @@ -62,12 +62,12 @@ RED.contextMenu = (function() { } }, { - label: 'Junction', + label: RED._("contextMenu.junction"), onselect: 'core:split-wires-with-junctions', disabled: hasSelection || !hasLinks }, { - label: 'Link Nodes', + label: RED._("contextMenu.linkNodes"), onselect: 'core:split-wire-with-link-nodes', disabled: hasSelection || !hasLinks }