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

Allow port labels be i18n identifiers

This commit is contained in:
Nick O'Leary 2017-01-27 22:36:00 +00:00
parent 85b2a03a42
commit 50017c28da
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 9 additions and 1 deletions

View File

@ -136,10 +136,15 @@ RED.nodes = (function() {
} }
def["_"] = function() { def["_"] = function() {
var args = Array.prototype.slice.call(arguments, 0); var args = Array.prototype.slice.call(arguments, 0);
var original = args[0];
if (args[0].indexOf(":") === -1) { if (args[0].indexOf(":") === -1) {
args[0] = ns+":"+args[0]; args[0] = ns+":"+args[0];
} }
return RED._.apply(null,args); var result = RED._.apply(null,args);
if (result === args[0]) {
result = original;
}
return result;
} }
// TODO: too tightly coupled into palette UI // TODO: too tightly coupled into palette UI

View File

@ -1500,6 +1500,9 @@ RED.view = (function() {
} else if ($.isArray(portLabels)) { } else if ($.isArray(portLabels)) {
result = portLabels[portIndex]; result = portLabels[portIndex];
} }
if (result) {
result = node._(result);
}
return result; return result;
} }
function portMouseOver(port,d,portType,portIndex) { function portMouseOver(port,d,portType,portIndex) {