1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

fix i18n of new subflow feature

This commit is contained in:
Hiroyasu Nishiyama 2019-08-13 21:17:31 +09:00
parent ee6ee99577
commit daa98e8925
3 changed files with 63 additions and 34 deletions

View File

@ -325,16 +325,21 @@
"locale": "Select UI Language", "locale": "Select UI Language",
"icon": "Icon", "icon": "Icon",
"inputType": "Input type", "inputType": "Input type",
"previewUI": "Preview UI", "inputs" : {
"previewOK": "Preview OK", "input": "input",
"select": "select",
"checkbox": "checkbox",
"spinner": "spinner",
"none": "none",
"hidden": "hide property"
},
"types": { "types": {
"str": "string", "str": "string",
"num": "number", "num": "number",
"bool": "bool", "bool": "bool",
"json": "json", "json": "JSON",
"bin": "buffer", "bin": "buffer",
"env": "env var", "env": "env variable"
"no-value": "no value"
}, },
"menu": { "menu": {
"input": "input", "input": "input",
@ -343,9 +348,13 @@
"spinner": "spinner", "spinner": "spinner",
"hidden": "label only" "hidden": "label only"
}, },
"select": {
"label": "Label",
"value": "Value"
},
"spinner": { "spinner": {
"min": "min", "min": "Minimum",
"max": "max" "max": "Maximum"
}, },
"errors": { "errors": {
"scopeChange": "Changing the scope will make it unavailable to nodes in other flows that use it", "scopeChange": "Changing the scope will make it unavailable to nodes in other flows that use it",

View File

@ -327,14 +327,21 @@
"inputType": "入力形式", "inputType": "入力形式",
"previewUI": "UI確認", "previewUI": "UI確認",
"previewOK": "確認OK", "previewOK": "確認OK",
"inputs" : {
"input": "入力",
"select": "メニュー",
"checkbox": "チェックボックス",
"spinner": "スピナー",
"none": "無し",
"hidden": "非表示"
},
"types": { "types": {
"str": "文字列", "str": "文字列",
"num": "数値", "num": "数値",
"bool": "真偽", "bool": "真偽",
"json": "JSON", "json": "JSON",
"bin": "バッファ", "bin": "バッファ",
"env": "環境変数", "env": "環境変数"
"no-value": "値無し"
}, },
"menu": { "menu": {
"input": "入力", "input": "入力",
@ -343,9 +350,13 @@
"spinner": "数値", "spinner": "数値",
"hidden": "ラベルのみ" "hidden": "ラベルのみ"
}, },
"select": {
"label": "ラベル",
"value": "値"
},
"spinner": { "spinner": {
"min": "最小", "min": "最小",
"max": "最大" "max": "最大"
}, },
"errors": { "errors": {
"scopeChange": "スコープの変更は、他のフローで使われているノードを無効にします", "scopeChange": "スコープの変更は、他のフローで使われているノードを無効にします",
@ -964,9 +975,11 @@
}, },
"editor-tab": { "editor-tab": {
"properties": "プロパティ", "properties": "プロパティ",
"envProperties": "環境変数",
"description": "説明", "description": "説明",
"appearance": "外観", "appearance": "外観",
"env": "サブフロープロパティ" "preview": "UIプレビュー",
"defaultValue": "デフォルト値"
}, },
"languages": { "languages": {
"de": "ドイツ語", "de": "ドイツ語",

View File

@ -1068,14 +1068,15 @@ RED.subflow = (function() {
inputCellInput.typedInput({ inputCellInput.typedInput({
types: [ types: [
{value:"input", {
label:"input", icon:"fa fa-i-cursor",showLabel:false,multiple:true,options:[ value:"input",
{value:"str",label:"string",icon:"red/images/typedInput/az.svg"}, label:RED._("editor.inputs.input"), icon:"fa fa-i-cursor",showLabel:false,multiple:true,options:[
{value:"num",label:"number",icon:"red/images/typedInput/09.svg"}, {value:"str",label:RED._("editor.types.str"),icon:"red/images/typedInput/az.svg"},
{value:"bool",label:"boolean",icon:"red/images/typedInput/bool.svg"}, {value:"num",label:RED._("editor.types.num"),icon:"red/images/typedInput/09.svg"},
{value:"json",label:"JSON",icon:"red/images/typedInput/json.svg"}, {value:"bool",label:RED._("editor.types.bool"),icon:"red/images/typedInput/bool.svg"},
{value: "bin",label: "buffer",icon: "red/images/typedInput/bin.svg"}, {value:"json",label:RED._("editor.types.json"),icon:"red/images/typedInput/json.svg"},
{value: "env",label: "env variable",icon: "red/images/typedInput/env.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'], default: ['str','num','bool','json','bin','env'],
valueLabel: function(container,value) { 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) { valueLabel: function(container,value) {
container.css("padding","0"); container.css("padding","0");
@ -1131,7 +1133,7 @@ RED.subflow = (function() {
content: function(container) { content: function(container) {
var content = $('<div class="red-ui-editor-subflow-ui-edit-panel">').appendTo(container); var content = $('<div class="red-ui-editor-subflow-ui-edit-panel">').appendTo(container);
var optList = $('<ol>').appendTo(content).editableList({ var optList = $('<ol>').appendTo(content).editableList({
header:$("<div><div>Label</div><div>Value</div></div>"), header:$("<div><div>"+RED._("editor.select.label")+"</div><div>"+RED._("editor.select.value")+"</div></div>"),
addItem: function(row,index,itemData) { addItem: function(row,index,itemData) {
var labelDiv = $('<div>').appendTo(row); var labelDiv = $('<div>').appendTo(row);
var label = lookupLabel(itemData.l, "", currentLocale); 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) { valueLabel: function(container,value) {
container.css("padding",0); container.css("padding",0);
checkbox = $('<input type="checkbox">').appendTo(container); checkbox = $('<input type="checkbox">').appendTo(container);
@ -1231,8 +1234,9 @@ RED.subflow = (function() {
checkbox.prop('checked',valueField.typedInput('value')==="true"); 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) { valueLabel: function(container,value) {
container.css("padding",0); container.css("padding",0);
var innerContainer = $('<div>').css({ var innerContainer = $('<div>').css({
@ -1267,8 +1271,8 @@ RED.subflow = (function() {
minInput.val(min); minInput.val(min);
var maxInput = $('<input type="number" style="margin-bottom:0; width:60px">'); var maxInput = $('<input type="number" style="margin-bottom:0; width:60px">');
maxInput.val(max); maxInput.val(max);
$('<div class="form-row" style="margin-bottom:3px"><label>Minimum</label></div>').append(minInput).appendTo(content); $('<div class="form-row" style="margin-bottom:3px"><label>'+RED._("editor.spinner.min")+'</label></div>').append(minInput).appendTo(content);
$('<div class="form-row" style="margin-bottom:0"><label>Maximum</label></div>').append(maxInput).appendTo(content); $('<div class="form-row" style="margin-bottom:0"><label>'+RED._("editor.spinner.max")+'</label></div>').append(maxInput).appendTo(content);
return { return {
onclose: function() { onclose: function() {
var min = minInput.val().trim(); var min = minInput.val().trim();
@ -1289,11 +1293,14 @@ RED.subflow = (function() {
} }
} }
}, },
{value:"none", {
label:"none", icon:"fa fa-times",hasValue:false}, value:"none",
{value:"hide", label:RED._("editor.inputs.none"), icon:"fa fa-times",hasValue:false
label:"hide property", icon:"fa fa-ban",hasValue:false} },
{
value:"hide",
label:RED._("editor.inputs.hidden"), icon:"fa fa-ban",hasValue:false
}
], ],
default: 'none' default: 'none'
}).on("typedinputtypechange", function(evt,type) { }).on("typedinputtypechange", function(evt,type) {