From daa98e8925d501fc1612293eee6dacd28f1fbf6e Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Tue, 13 Aug 2019 21:17:31 +0900 Subject: [PATCH] fix i18n of new subflow feature --- .../editor-client/locales/en-US/editor.json | 23 ++++++--- .../editor-client/locales/ja/editor.json | 23 +++++++-- .../editor-client/src/js/ui/subflow.js | 51 +++++++++++-------- 3 files changed, 63 insertions(+), 34 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 de38dad17..67dfa8a73 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 @@ -325,16 +325,21 @@ "locale": "Select UI Language", "icon": "Icon", "inputType": "Input type", - "previewUI": "Preview UI", - "previewOK": "Preview OK", + "inputs" : { + "input": "input", + "select": "select", + "checkbox": "checkbox", + "spinner": "spinner", + "none": "none", + "hidden": "hide property" + }, "types": { "str": "string", "num": "number", "bool": "bool", - "json": "json", + "json": "JSON", "bin": "buffer", - "env": "env var", - "no-value": "no value" + "env": "env variable" }, "menu": { "input": "input", @@ -343,9 +348,13 @@ "spinner": "spinner", "hidden": "label only" }, + "select": { + "label": "Label", + "value": "Value" + }, "spinner": { - "min": "min", - "max": "max" + "min": "Minimum", + "max": "Maximum" }, "errors": { "scopeChange": "Changing the scope will make it unavailable to nodes in other flows that use it", 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 e0953396a..b95119530 100755 --- a/packages/node_modules/@node-red/editor-client/locales/ja/editor.json +++ b/packages/node_modules/@node-red/editor-client/locales/ja/editor.json @@ -327,14 +327,21 @@ "inputType": "入力形式", "previewUI": "UI確認", "previewOK": "確認OK", + "inputs" : { + "input": "入力", + "select": "メニュー", + "checkbox": "チェックボックス", + "spinner": "スピナー", + "none": "無し", + "hidden": "非表示" + }, "types": { "str": "文字列", "num": "数値", "bool": "真偽", "json": "JSON", "bin": "バッファ", - "env": "環境変数", - "no-value": "値無し" + "env": "環境変数" }, "menu": { "input": "入力", @@ -343,9 +350,13 @@ "spinner": "数値", "hidden": "ラベルのみ" }, + "select": { + "label": "ラベル", + "value": "値" + }, "spinner": { - "min": "最小", - "max": "最大" + "min": "最小値", + "max": "最大値" }, "errors": { "scopeChange": "スコープの変更は、他のフローで使われているノードを無効にします", @@ -964,9 +975,11 @@ }, "editor-tab": { "properties": "プロパティ", + "envProperties": "環境変数", "description": "説明", "appearance": "外観", - "env": "サブフロープロパティ" + "preview": "UIプレビュー", + "defaultValue": "デフォルト値" }, "languages": { "de": "ドイツ語", diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js index 3714a1569..8e2bdf453 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js @@ -1068,14 +1068,15 @@ RED.subflow = (function() { inputCellInput.typedInput({ types: [ - {value:"input", - label:"input", icon:"fa fa-i-cursor",showLabel:false,multiple:true,options:[ - {value:"str",label:"string",icon:"red/images/typedInput/az.svg"}, - {value:"num",label:"number",icon:"red/images/typedInput/09.svg"}, - {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.svg"}, - {value:"json",label:"JSON",icon:"red/images/typedInput/json.svg"}, - {value: "bin",label: "buffer",icon: "red/images/typedInput/bin.svg"}, - {value: "env",label: "env variable",icon: "red/images/typedInput/env.svg"} + { + value:"input", + label:RED._("editor.inputs.input"), icon:"fa fa-i-cursor",showLabel:false,multiple:true,options:[ + {value:"str",label:RED._("editor.types.str"),icon:"red/images/typedInput/az.svg"}, + {value:"num",label:RED._("editor.types.num"),icon:"red/images/typedInput/09.svg"}, + {value:"bool",label:RED._("editor.types.bool"),icon:"red/images/typedInput/bool.svg"}, + {value:"json",label:RED._("editor.types.json"),icon:"red/images/typedInput/json.svg"}, + {value: "bin",label: RED._("editor.types.bin"),icon: "red/images/typedInput/bin.svg"}, + {value: "env",label: RED._("editor.types.env"),icon: "red/images/typedInput/env.svg"} ], default: ['str','num','bool','json','bin','env'], valueLabel: function(container,value) { @@ -1100,8 +1101,9 @@ RED.subflow = (function() { } } }, - {value:"select", - label:"select", icon:"fa fa-tasks",showLabel:false, + { + value:"select", + label:RED._("editor.inputs.select"), icon:"fa fa-tasks",showLabel:false, valueLabel: function(container,value) { container.css("padding","0"); @@ -1131,7 +1133,7 @@ RED.subflow = (function() { content: function(container) { var content = $('
').appendTo(container); var optList = $('
    ').appendTo(content).editableList({ - header:$("
    Label
    Value
    "), + header:$("
    "+RED._("editor.select.label")+"
    "+RED._("editor.select.value")+"
    "), addItem: function(row,index,itemData) { var labelDiv = $('
    ').appendTo(row); var label = lookupLabel(itemData.l, "", currentLocale); @@ -1220,8 +1222,9 @@ RED.subflow = (function() { } } }, - {value:"checkbox", - label:"checkbox", icon:"fa fa-check-square-o",showLabel:false, + { + value:"checkbox", + label:RED._("editor.inputs.checkbox"), icon:"fa fa-check-square-o",showLabel:false, valueLabel: function(container,value) { container.css("padding",0); checkbox = $('').appendTo(container); @@ -1231,8 +1234,9 @@ RED.subflow = (function() { checkbox.prop('checked',valueField.typedInput('value')==="true"); } }, - {value:"spinner", - label:"spinner", icon:"fa fa-sort-numeric-asc", showLabel:false, + { + value:"spinner", + label:RED._("editor.inputs.spinner"), icon:"fa fa-sort-numeric-asc", showLabel:false, valueLabel: function(container,value) { container.css("padding",0); var innerContainer = $('
    ').css({ @@ -1267,8 +1271,8 @@ RED.subflow = (function() { minInput.val(min); var maxInput = $(''); maxInput.val(max); - $('
    ').append(minInput).appendTo(content); - $('
    ').append(maxInput).appendTo(content); + $('
    ').append(minInput).appendTo(content); + $('
    ').append(maxInput).appendTo(content); return { onclose: function() { var min = minInput.val().trim(); @@ -1289,11 +1293,14 @@ RED.subflow = (function() { } } }, - {value:"none", - label:"none", icon:"fa fa-times",hasValue:false}, - {value:"hide", - label:"hide property", icon:"fa fa-ban",hasValue:false} - + { + value:"none", + label:RED._("editor.inputs.none"), icon:"fa fa-times",hasValue:false + }, + { + value:"hide", + label:RED._("editor.inputs.hidden"), icon:"fa fa-ban",hasValue:false + } ], default: 'none' }).on("typedinputtypechange", function(evt,type) {