mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
[groups] i18n group messages
This commit is contained in:
parent
13830ffc9c
commit
94ef25bbb9
@ -16,7 +16,9 @@
|
|||||||
"clone": "Clone project",
|
"clone": "Clone project",
|
||||||
"cont": "Continue",
|
"cont": "Continue",
|
||||||
"line": "Outline",
|
"line": "Outline",
|
||||||
"fill": "Fill"
|
"fill": "Fill",
|
||||||
|
"color": "Color",
|
||||||
|
"position": "Position"
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"string": "string",
|
"string": "string",
|
||||||
@ -320,6 +322,13 @@
|
|||||||
"multipleInputsToSelection": "<strong>Cannot create subflow</strong>: multiple inputs to selection"
|
"multipleInputsToSelection": "<strong>Cannot create subflow</strong>: multiple inputs to selection"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"group": {
|
||||||
|
"editGroup": "Edit group: __name__",
|
||||||
|
"errors": {
|
||||||
|
"cannotCreateDiffGroups": "Cannot create group using nodes from different groups",
|
||||||
|
"cannotAddSubflowPorts": "Cannot add subflow ports to a group"
|
||||||
|
}
|
||||||
|
},
|
||||||
"editor": {
|
"editor": {
|
||||||
"configEdit": "Edit",
|
"configEdit": "Edit",
|
||||||
"configAdd": "Add",
|
"configAdd": "Add",
|
||||||
|
@ -515,7 +515,7 @@ RED.editor = (function() {
|
|||||||
var node = editStack[i];
|
var node = editStack[i];
|
||||||
label = node.type;
|
label = node.type;
|
||||||
if (node.type === 'group') {
|
if (node.type === 'group') {
|
||||||
label = RED._("subflow.editGroup",{name:RED.utils.sanitize(node.name||node.id)});
|
label = RED._("group.editGroup",{name:RED.utils.sanitize(node.name||node.id)});
|
||||||
} else if (node.type === '_expression') {
|
} else if (node.type === '_expression') {
|
||||||
label = RED._("expressionEditor.title");
|
label = RED._("expressionEditor.title");
|
||||||
} else if (node.type === '_js') {
|
} else if (node.type === '_js') {
|
||||||
|
@ -39,12 +39,12 @@ RED.group = (function() {
|
|||||||
'<div style="margin-left: 100px; display: inline-block">'+
|
'<div style="margin-left: 100px; display: inline-block">'+
|
||||||
'<div class="form-row">'+
|
'<div class="form-row">'+
|
||||||
'<span style="display: inline-block; min-width: 140px" id="node-input-row-style-label-color">'+
|
'<span style="display: inline-block; min-width: 140px" id="node-input-row-style-label-color">'+
|
||||||
'<label style="width: 70px;margin-right: 10px" for="node-input-style-fill">Color</label>'+
|
'<label style="width: 70px;margin-right: 10px" for="node-input-style-fill" data-i18n="editor:common.label.color"></label>'+
|
||||||
'</span>'+
|
'</span>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<div class="form-row">'+
|
'<div class="form-row">'+
|
||||||
'<span style="display: inline-block; min-width: 140px;" id="node-input-row-style-label-position">'+
|
'<span style="display: inline-block; min-width: 140px;" id="node-input-row-style-label-position">'+
|
||||||
'<label style="width: 70px;margin-right: 10px " for="node-input-style-label-position">Position</label>'+
|
'<label style="width: 70px;margin-right: 10px " for="node-input-style-label-position" data-i18n="editor:common.label.position"></label>'+
|
||||||
'</span>'+
|
'</span>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
@ -340,7 +340,7 @@ RED.group = (function() {
|
|||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
parentGroup = n.g;
|
parentGroup = n.g;
|
||||||
} else if (n.g !== parentGroup) {
|
} else if (n.g !== parentGroup) {
|
||||||
RED.notify("Cannot merge nodes from different groups","error");
|
RED.notify(RED._("group.errors.cannotCreateDiffGroups"),"error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ RED.group = (function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (nodes.filter(function(n) { return n.type === "subflow" }).length > 0) {
|
if (nodes.filter(function(n) { return n.type === "subflow" }).length > 0) {
|
||||||
RED.notify("Cannot add subflow ports to a group","error");
|
RED.notify(RED._("group.errors.cannotAddSubflowPorts"),"error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// nodes is an array
|
// nodes is an array
|
||||||
@ -446,7 +446,7 @@ RED.group = (function() {
|
|||||||
if (!z) {
|
if (!z) {
|
||||||
z = n.z;
|
z = n.z;
|
||||||
} else if (z !== n.z) {
|
} else if (z !== n.z) {
|
||||||
throw new Error("Cannot create group using nodes with different z properties")
|
throw new Error("Cannot add nooes with different z properties")
|
||||||
}
|
}
|
||||||
if (n.g) {
|
if (n.g) {
|
||||||
// This is already in a group.
|
// This is already in a group.
|
||||||
@ -454,13 +454,13 @@ RED.group = (function() {
|
|||||||
if (!g) {
|
if (!g) {
|
||||||
if (i!==0) {
|
if (i!==0) {
|
||||||
// TODO: this might be ok when merging groups
|
// TODO: this might be ok when merging groups
|
||||||
throw new Error("Cannot create group using nodes from different groups")
|
throw new Error(RED._("group.errors.cannotCreateDiffGroups"))
|
||||||
}
|
}
|
||||||
g = n.g
|
g = n.g
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g !== n.g) {
|
if (g !== n.g) {
|
||||||
throw new Error("Cannot create group using nodes from different groups")
|
throw new Error(RED._("group.errors.cannotCreateDiffGroups"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The nodes are already in a group. The assumption is they should be
|
// The nodes are already in a group. The assumption is they should be
|
||||||
@ -495,7 +495,6 @@ RED.group = (function() {
|
|||||||
markDirty(group);
|
markDirty(group);
|
||||||
}
|
}
|
||||||
function removeFromGroup(group, nodes, reparent) {
|
function removeFromGroup(group, nodes, reparent) {
|
||||||
console.log('rfg',group,nodes);
|
|
||||||
if (!Array.isArray(nodes)) {
|
if (!Array.isArray(nodes)) {
|
||||||
nodes = [nodes];
|
nodes = [nodes];
|
||||||
}
|
}
|
||||||
@ -504,7 +503,6 @@ RED.group = (function() {
|
|||||||
// TODO: DRY mergeSelection,removeSelection,...
|
// TODO: DRY mergeSelection,removeSelection,...
|
||||||
for (var i=0; i<nodes.length; i++) {
|
for (var i=0; i<nodes.length; i++) {
|
||||||
if (nodes[i].g !== group.id) {
|
if (nodes[i].g !== group.id) {
|
||||||
RED.notify("Cannot remove node "+nodes[i].id+" from group it isn't in");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user