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

Support i18n for typedInput in split and switch nodes

This commit is contained in:
Kazuhito Yokoi 2019-10-30 19:58:29 +09:00
parent 3a1d0f3695
commit d2755a8049
4 changed files with 91 additions and 61 deletions

View File

@ -127,7 +127,7 @@
}, },
oneditprepare: function() { oneditprepare: function() {
var node = this; var node = this;
var previousValueType = {value:"prev",label:this._("inject.previous"),hasValue:false}; var previousValueType = {value:"prev",label:this._("switch.previous"),hasValue:false};
$("#node-input-property").typedInput({default:this.propertyType||'msg',types:['msg','flow','global','jsonata','env']}); $("#node-input-property").typedInput({default:this.propertyType||'msg',types:['msg','flow','global','jsonata','env']});
var outputCount = $("#node-input-outputs").val("{}"); var outputCount = $("#node-input-outputs").val("{}");
@ -237,15 +237,15 @@
function createTypeValueField(){ function createTypeValueField(){
return $('<input/>',{class:"node-input-rule-type-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'string',types:[ return $('<input/>',{class:"node-input-rule-type-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'string',types:[
{value:"string",label:"string",hasValue:false}, {value:"string",label:RED._("node-red:switch.label.string"),hasValue:false},
{value:"number",label:"number",hasValue:false}, {value:"number",label:RED._("node-red:switch.label.number"),hasValue:false},
{value:"boolean",label:"boolean",hasValue:false}, {value:"boolean",label:RED._("node-red:switch.label.boolean"),hasValue:false},
{value:"array",label:"array",hasValue:false}, {value:"array",label:RED._("node-red:switch.label.array"),hasValue:false},
{value:"buffer",label:"buffer",hasValue:false}, {value:"buffer",label:RED._("node-red:switch.label.buffer"),hasValue:false},
{value:"object",label:"object",hasValue:false}, {value:"object",label:RED._("node-red:switch.label.object"),hasValue:false},
{value:"json",label:"JSON string",hasValue:false}, {value:"json",label:RED._("node-red:switch.label.jsonString"),hasValue:false},
{value:"undefined",label:"undefined",hasValue:false}, {value:"undefined",label:RED._("node-red:switch.label.undefined"),hasValue:false},
{value:"null",label:"null",hasValue:false} {value:"null",label:RED._("node-red:switch.label.null"),hasValue:false}
]}); ]});
} }

View File

@ -285,7 +285,11 @@
$("#node-input-property").typedInput('types',['msg']); $("#node-input-property").typedInput('types',['msg']);
$("#node-input-joiner").typedInput("show"); $("#node-input-joiner").typedInput("show");
} else { } else {
$("#node-input-property").typedInput('types',['msg', {value:"full",label:"complete message",hasValue:false}]); $("#node-input-property").typedInput('types', ['msg', {
value: "full",
label: RED._("node-red:join.completeMessage"),
hasValue: false
}]);
} }
}); });
@ -297,7 +301,11 @@
$("#node-input-property").typedInput({ $("#node-input-property").typedInput({
typeField: $("#node-input-propertyType"), typeField: $("#node-input-propertyType"),
types:['msg', {value:"full", label:"complete message", hasValue:false}] types: ['msg', {
value: "full",
label: RED._("node-red:join.completeMessage"),
hasValue: false
}]
}); });
$("#node-input-key").typedInput({ $("#node-input-key").typedInput({

View File

@ -604,33 +604,43 @@
"label": { "label": {
"property": "Property", "property": "Property",
"rule": "rule", "rule": "rule",
"repair" : "recreate message sequences" "string": "string",
"number": "number",
"boolean": "boolean",
"array": "array",
"buffer": "buffer",
"object": "object",
"jsonString": "JSON string",
"undefined": "undefined",
"null": "null",
"repair": "recreate message sequences"
}, },
"previous": "previous value",
"and": "and", "and": "and",
"checkall": "checking all rules", "checkall": "checking all rules",
"stopfirst": "stopping after first match", "stopfirst": "stopping after first match",
"ignorecase": "ignore case", "ignorecase": "ignore case",
"rules": { "rules": {
"btwn":"is between", "btwn": "is between",
"cont":"contains", "cont": "contains",
"regex":"matches regex", "regex": "matches regex",
"true":"is true", "true": "is true",
"false":"is false", "false": "is false",
"null":"is null", "null": "is null",
"nnull":"is not null", "nnull": "is not null",
"istype":"is of type", "istype": "is of type",
"empty":"is empty", "empty": "is empty",
"nempty":"is not empty", "nempty": "is not empty",
"head":"head", "head": "head",
"tail":"tail", "tail": "tail",
"index":"index between", "index": "index between",
"exp":"JSONata exp", "exp": "JSONata exp",
"else":"otherwise", "else": "otherwise",
"hask":"has key" "hask": "has key"
}, },
"errors": { "errors": {
"invalid-expr": "Invalid JSONata expression: __error__", "invalid-expr": "Invalid JSONata expression: __error__",
"too-many" : "too many pending messages in switch node" "too-many": "too many pending messages in switch node"
} }
}, },
"change": { "change": {
@ -848,41 +858,42 @@
"stream":"Handle as a stream of messages", "stream":"Handle as a stream of messages",
"addname":" Copy key to " "addname":" Copy key to "
}, },
"join":{ "join": {
"join": "join", "join": "join",
"mode":{ "mode": {
"mode":"Mode", "mode": "Mode",
"auto":"automatic", "auto": "automatic",
"merge":"merge sequences", "merge": "merge sequences",
"reduce":"reduce sequence", "reduce": "reduce sequence",
"custom":"manual" "custom": "manual"
}, },
"combine":"Combine each", "combine": "Combine each",
"create":"to create", "completeMessage": "complete message",
"type":{ "create": "to create",
"string":"a String", "type": {
"array":"an Array", "string": "a String",
"buffer":"a Buffer", "array": "an Array",
"object":"a key/value Object", "buffer": "a Buffer",
"merged":"a merged Object" "object": "a key/value Object",
"merged": "a merged Object"
}, },
"using":"using the value of", "using": "using the value of",
"key":"as the key", "key": "as the key",
"joinedUsing":"joined using", "joinedUsing": "joined using",
"send":"Send the message:", "send": "Send the message:",
"afterCount":"After a number of message parts", "afterCount": "After a number of message parts",
"count":"count", "count": "count",
"subsequent":"and every subsequent message.", "subsequent": "and every subsequent message.",
"afterTimeout":"After a timeout following the first message", "afterTimeout": "After a timeout following the first message",
"seconds":"seconds", "seconds": "seconds",
"complete":"After a message with the <code>msg.complete</code> property set", "complete": "After a message with the <code>msg.complete</code> property set",
"tip":"This mode assumes this node is either paired with a <i>split</i> node or the received messages will have a properly configured <code>msg.parts</code> property.", "tip": "This mode assumes this node is either paired with a <i>split</i> node or the received messages will have a properly configured <code>msg.parts</code> property.",
"too-many" : "too many pending messages in join node", "too-many": "too many pending messages in join node",
"merge": { "merge": {
"topics-label":"Merged Topics", "topics-label": "Merged Topics",
"topics":"topics", "topics": "topics",
"topic" : "topic", "topic": "topic",
"on-change":"Send merged message on arrival of a new topic" "on-change": "Send merged message on arrival of a new topic"
}, },
"reduce": { "reduce": {
"exp": "Reduce exp", "exp": "Reduce exp",

View File

@ -602,8 +602,18 @@
"label": { "label": {
"property": "プロパティ", "property": "プロパティ",
"rule": "条件", "rule": "条件",
"string": "文字列",
"number": "数値",
"boolean": "真偽値",
"array": "配列",
"buffer": "バッファ",
"object": "オブジェクト",
"jsonString": "JSON文字列",
"undefined": "undefined",
"null": "null",
"repair": "メッセージ列の補正" "repair": "メッセージ列の補正"
}, },
"previous": "前回の値",
"and": "", "and": "",
"checkall": "全ての条件を適用", "checkall": "全ての条件を適用",
"stopfirst": "最初に合致した条件で終了", "stopfirst": "最初に合致した条件で終了",
@ -856,6 +866,7 @@
"custom": "手動" "custom": "手動"
}, },
"combine": "結合", "combine": "結合",
"completeMessage": "メッセージ全体",
"create": "出力", "create": "出力",
"type": { "type": {
"string": "文字列", "string": "文字列",