mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Make core nodes labels more consistent, to close #1673
and make them translateable
This commit is contained in:
@@ -138,7 +138,7 @@
|
||||
icon: "arrow-in.png",
|
||||
align: "right",
|
||||
label: function() {
|
||||
return this.name||this.command;
|
||||
return this.name||this.command||(this.useSpawn=="true"?this._("exec.spawn"):this._("exec.exec"));
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
@@ -99,7 +99,7 @@
|
||||
outputs:1,
|
||||
icon: "template.png",
|
||||
label: function() {
|
||||
return this.name;
|
||||
return this.name||this._("template.template");;
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
@@ -50,6 +50,7 @@ module.exports = function(RED) {
|
||||
|
||||
// try node context:
|
||||
var dot = name.indexOf(".");
|
||||
/* istanbul ignore else */
|
||||
if (dot > 0) {
|
||||
var contextName = name.substr(0, dot);
|
||||
var variableName = name.substr(dot + 1);
|
||||
@@ -61,7 +62,8 @@ module.exports = function(RED) {
|
||||
return this.nodeContext.global.get(variableName);
|
||||
}
|
||||
}
|
||||
}catch(err) {
|
||||
}
|
||||
catch(err) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -103,9 +105,11 @@ module.exports = function(RED) {
|
||||
} else {
|
||||
value = template;
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
if (node.outputFormat === "json") {
|
||||
value = JSON.parse(value);
|
||||
}
|
||||
/* istanbul ignore else */
|
||||
if (node.outputFormat === "yaml") {
|
||||
value = yaml.load(value);
|
||||
}
|
||||
@@ -118,7 +122,8 @@ module.exports = function(RED) {
|
||||
node.context().global.set(node.field,value);
|
||||
}
|
||||
node.send(msg);
|
||||
} catch(err) {
|
||||
}
|
||||
catch(err) {
|
||||
node.error(err.message);
|
||||
}
|
||||
});
|
||||
|
@@ -33,7 +33,7 @@
|
||||
outputs:0,
|
||||
icon: "comment.png",
|
||||
label: function() {
|
||||
return this.name||"";
|
||||
return this.name||this._("comment.comment");
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
Reference in New Issue
Block a user