mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
More node i18n tidy-up
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
If msg.<input type="text" id="node-input-property" style="width: 200px;"/>
|
||||
<span data-i18n="switch.label.property"></span> msg.<input type="text" id="node-input-property" style="width: 200px;"/>
|
||||
</div>
|
||||
<div class="form-row node-input-rule-container-row" style="margin-bottom: 0px;">
|
||||
<div id="node-input-rule-container-div" style="box-sizing: border-box; border-radius: 5px; height: 310px; padding: 5px; border: 1px solid #ccc; overflow-y:scroll;">
|
||||
@@ -61,7 +61,7 @@
|
||||
outputs: 1,
|
||||
icon: "switch.png",
|
||||
label: function() {
|
||||
return this.name||this._("switch.label.switchlabel");
|
||||
return this.name||"switch";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
|
||||
@@ -72,14 +72,14 @@
|
||||
{v:"lte",t:"<="},
|
||||
{v:"gt",t:">"},
|
||||
{v:"gte",t:">="},
|
||||
{v:"btwn",t:"is between"},
|
||||
{v:"cont",t:"contains"},
|
||||
{v:"regex",t:"matches regex"},
|
||||
{v:"true",t:"is true"},
|
||||
{v:"false",t:"is false"},
|
||||
{v:"null",t:"is null"},
|
||||
{v:"nnull",t:"is not null"},
|
||||
{v:"else",t:"otherwise"}
|
||||
{v:"btwn",t:this._("switch.rules.btwn")},
|
||||
{v:"cont",t:this._("switch.rules.cont")},
|
||||
{v:"regex",t:this._("switch.rules.regex")},
|
||||
{v:"true",t:this._("switch.rules.true")},
|
||||
{v:"false",t:this._("switch.rules.false")},
|
||||
{v:"null",t:this._("switch.rules.null")},
|
||||
{v:"nnull",t:this._("switch.rules.nnull")},
|
||||
{v:"else",t:this._("switch.rules.else")}
|
||||
];
|
||||
|
||||
function generateRule(i,rule) {
|
||||
|
@@ -68,23 +68,23 @@
|
||||
}
|
||||
if (!this.rules) {
|
||||
if (this.action === "replace") {
|
||||
return "set msg."+this.property;
|
||||
return this._("change.label.set",{property:"msg."+this.property});
|
||||
} else if (this.action === "change") {
|
||||
return "change msg."+this.property;
|
||||
return this._("change.label.change",{property:"msg."+this.property});
|
||||
} else {
|
||||
return this.action+" msg."+this.property
|
||||
return this._("change.label.delete",{property:"msg."+this.property});
|
||||
}
|
||||
} else {
|
||||
if (this.rules.length == 1) {
|
||||
if (this.rules[0].t === "set") {
|
||||
return "set msg."+this.rules[0].p;
|
||||
return this._("change.label.set",{property:"msg."+this.rules[0].p});
|
||||
} else if (this.rules[0].t === "change") {
|
||||
return "change msg."+this.rules[0].p;
|
||||
return this._("change.label.change",{property:"msg."+this.rules[0].p});
|
||||
} else {
|
||||
return "delete msg."+this.rules[0].p;
|
||||
return this._("change.label.delete",{property:"msg."+this.rules[0].p});
|
||||
}
|
||||
} else {
|
||||
return "change: "+(this.rules.length||"no")+" rules";
|
||||
return this._("change.label.changeCount",{count:this.rules.length});
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -154,7 +154,6 @@
|
||||
} else if (type == "delete") {
|
||||
row2.hide();
|
||||
row3.hide();
|
||||
$("#node-tip").hide();
|
||||
}
|
||||
});
|
||||
deleteButton.click(function() {
|
||||
|
@@ -52,7 +52,7 @@ module.exports = function(RED) {
|
||||
rule.from = new RegExp(rule.from, "g");
|
||||
} catch (e) {
|
||||
valid = false;
|
||||
this.error(RED._("change.errors.invalid-from")+" "+e.message);
|
||||
this.error(RED._("change.errors.invalid-from",{error:e.message}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,21 +18,21 @@
|
||||
<div class="form-row">
|
||||
<label for="node-input-action"><i class="fa fa-dot-circle-o"></i> <span data-i18n="range.label.action"></span></label>
|
||||
<select id="node-input-action" style="width:70%; margin-right:5px;">
|
||||
<option value="scale" data-i18n="range.scale-payload"></option>
|
||||
<option value="clamp" data-i18n="range.scale-limit"></option>
|
||||
<option value="roll" data-i18n="range.scale-wrap"></option>
|
||||
<option value="scale" data-i18n="range.scale.payload"></option>
|
||||
<option value="clamp" data-i18n="range.scale.limit"></option>
|
||||
<option value="roll" data-i18n="range.scale.wrap"></option>
|
||||
</select>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-row"><i class="fa fa-sign-in"></i> <span data-i18n="range.label.inputrange"></span>:</div>
|
||||
<div class="form-row"><label></label>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minin" data-i18n="[placeholder]range.label.eg0ph" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxin" data-i18n="[placeholder]range.label.eg99ph" style="width:100px;"/>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minin" data-i18n="[placeholder]range.placeholder.min" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxin" data-i18n="[placeholder]range.placeholder.maxin" style="width:100px;"/>
|
||||
</div>
|
||||
<div class="form-row"><i class="fa fa-sign-out"></i> <span data-i18n="range.label.resultrange"></span>:</div>
|
||||
<div class="form-row"><label></label>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minout" data-i18n="[placeholder]range.label.eg0ph" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxout" data-i18n="[placeholder]range.label.eg255ph" style="width:100px;"/>
|
||||
<span data-i18n="range.label.from"></span>: <input type="text" id="node-input-minout" data-i18n="[placeholder]range.placeholder.min" style="width:100px;"/>
|
||||
<span data-i18n="range.label.to"></span>: <input type="text" id="node-input-maxout" data-i18n="[placeholder]range.placeholder.maxout" style="width:100px;"/>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-row"><label></label>
|
||||
@@ -72,7 +72,7 @@
|
||||
outputs: 1,
|
||||
icon: "range.png",
|
||||
label: function() {
|
||||
return this.name || this._("range.label.rangelabel");
|
||||
return this.name || "range";
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name ? "node_label_italic" : "";
|
||||
|
Reference in New Issue
Block a user