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

Updated editor ui NLS strings

This commit is contained in:
Allen Boone 2015-05-21 19:40:27 -04:00 committed by Nick O'Leary
parent 0017074d38
commit 4a318553f7
13 changed files with 424 additions and 100 deletions

View File

@ -16,7 +16,7 @@
RED.clipboard = (function() {
// TODO: Fix issue where text outside an inner function cannot be NLS-enabled since RED._ is not available yet when that code is run
var dialog = $('<div id="clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
.appendTo("body")
.dialog({
@ -27,7 +27,7 @@ RED.clipboard = (function() {
buttons: [
{
id: "clipboard-dialog-ok",
text: "Ok",
text: "Ok", //RED._("dialog.ok"),
click: function() {
if (/Import/.test(dialog.dialog("option","title"))) {
RED.view.importNodes($("#clipboard-import").val());
@ -37,14 +37,14 @@ RED.clipboard = (function() {
},
{
id: "clipboard-dialog-cancel",
text: "Cancel",
text: "Cancel", //RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
},
{
id: "clipboard-dialog-close",
text: "Close",
text: "Close", //RED._("dialog.close"),
click: function() {
$( this ).dialog( "close" );
}
@ -62,15 +62,16 @@ RED.clipboard = (function() {
var dialogContainer = dialog.children(".dialog-form");
var exportNodesDialog = '<div class="form-row">'+
'<label for="node-input-export" style="display: block; width:100%;"><i class="fa fa-clipboard"></i> Nodes:</label>'+
'<label for="node-input-export" style="display: block; width:100%;"><i class="fa fa-clipboard"></i>'+'Nodes:' /*RED._("dialog.nodes")*/+'</label>'+
'<textarea readonly style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-export" rows="5"></textarea>'+
'</div>'+
'<div class="form-tips">'+
'Select the text above and copy to the clipboard with Ctrl-C.'+
'Select the text above and copy to the clipboard with Ctrl-C.'+
//RED._("dialog.selectToCopy")+
'</div>';
var importNodesDialog = '<div class="form-row">'+
'<textarea style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-import" rows="5" placeholder="Paste nodes here"></textarea>'+
'<textarea style="resize: none; width: 100%; border-radius: 0px;font-family: monospace; font-size: 12px; background:#eee; padding-left: 0.5em; box-sizing:border-box;" id="clipboard-import" rows="5" placeholder="'+'Paste nodes here' /*RED._("dialog.pasteNodesHere")*/+'"></textarea>'+
'</div>';
function validateImport() {
@ -98,7 +99,7 @@ RED.clipboard = (function() {
$("#clipboard-import").keyup(validateImport);
$("#clipboard-import").on('paste',function() { setTimeout(validateImport,10)});
dialog.dialog("option","title","Import nodes").dialog("open");
dialog.dialog("option","title",RED._("dialog.importNodes")).dialog("open");
}
function exportNodes() {
@ -120,7 +121,7 @@ RED.clipboard = (function() {
return false;
})
});
dialog.dialog("option","title","Export nodes to clipboard").dialog( "open" );
dialog.dialog("option","title",RED._("dialog.exportNodesClipboard")).dialog( "open" );
}
}

View File

@ -49,18 +49,18 @@ RED.deploy = (function() {
if (type == "default") {
$('<li><span class="deploy-button-group button-group">'+
'<a id="btn-deploy" class="deploy-button disabled" href="#"><img id="btn-deploy-icon" src="red/images/deploy-full-o.png"> <span>Deploy</span></a>'+
'<a id="btn-deploy" class="deploy-button disabled" href="#"><img id="btn-deploy-icon" src="red/images/deploy-full-o.png"> <span>'+RED._("deploy.deploy")+'</span></a>'+
'<a id="btn-deploy-options" data-toggle="dropdown" class="deploy-button" href="#"><i class="fa fa-caret-down"></i></a>'+
'</span></li>').prependTo(".header-toolbar");
RED.menu.init({id:"btn-deploy-options",
options: [
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.png",label:"Full",sublabel:"Deploys everything in the workspace",selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.png",label:"Modified Flows",sublabel:"Only deploys flows that contain changed nodes", onselect:function(s) {if(s){changeDeploymentType("flows")}}},
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.png",label:"Modified Nodes",sublabel:"Only deploys nodes that have changed",onselect:function(s) { if(s){changeDeploymentType("nodes")}}}
{id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.png",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}},
{id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.png",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}},
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.png",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}}
]
});
} else if (type == "simple") {
var label = options.label || "Deploy";
var label = options.label || RED._("deploy.deploy");
var icon = 'red/images/deploy-full-o.png';
if (options.hasOwnProperty('icon')) {
icon = options.icon;
@ -83,7 +83,7 @@ RED.deploy = (function() {
height: "auto",
buttons: [
{
text: "Confirm deploy",
text: RED._("deploy.confirmDeploy"),
click: function() {
var ignoreChecked = $( "#node-dialog-confirm-deploy-hide" ).prop("checked");
@ -95,7 +95,7 @@ RED.deploy = (function() {
}
},
{
text: "Cancel",
text: RED._("deploy.cancelDeploy"),
click: function() {
$( this ).dialog( "close" );
}
@ -114,7 +114,7 @@ RED.deploy = (function() {
RED.nodes.on('change',function(state) {
if (state.dirty) {
window.onbeforeunload = function() {
return "You have undeployed changes.\n\nLeaving this page will lose these changes.";
return RED._("deploy.undeployedChanges");
}
$("#btn-deploy").removeClass("disabled");
} else {
@ -215,7 +215,7 @@ RED.deploy = (function() {
"Node-RED-Deployment-Type":deploymentType
}
}).done(function(data,textStatus,xhr) {
RED.notify("Successfully deployed","success");
RED.notify(RED._("deploy.successfulDeploy"),"success");
RED.nodes.eachNode(function(node) {
if (node.changed) {
node.dirty = true;
@ -236,9 +236,9 @@ RED.deploy = (function() {
}).fail(function(xhr,textStatus,err) {
RED.nodes.dirty(true);
if (xhr.responseText) {
RED.notify("<strong>Error</strong>: "+xhr.responseJSON.message,"error");
RED.notify(RED._("deploy.error")+xhr.responseJSON.message,"error");
} else {
RED.notify("<strong>Error</strong>: no response from server","error");
RED.notify(RED._("deploy.error")+RED._("deploy.noResponseError"),"error");
}
}).always(function() {
$("#btn-deploy-icon").removeClass('spinner');

View File

@ -178,7 +178,7 @@ RED.editor = (function() {
buttons: [
{
id: "node-dialog-ok",
text: "Ok",
text: "Ok", // RED._("dialog.ok"),
click: function() {
if (editing_node) {
var changes = {};
@ -285,7 +285,7 @@ RED.editor = (function() {
contentType: "application/json; charset=utf-8"
}).done(function() {
RED.library.loadFlowLibrary();
RED.notify("Saved nodes","success");
RED.notify(RED._("editor.savedNodes"),"success");
});
}
}
@ -294,7 +294,7 @@ RED.editor = (function() {
},
{
id: "node-dialog-cancel",
text: "Cancel",
text: "Cancel", // RED._("dialog.cancel"),
click: function() {
if (editing_node && editing_node._def) {
if (editing_node._def.oneditcancel) {
@ -392,9 +392,9 @@ RED.editor = (function() {
input.after(button);
if (node[property]) {
button.text("edit");
button.text(RED._("editor.configEdit"));
} else {
button.text("add");
button.text(RED._("editor.configAdd"));
}
button.click(function(e) {
@ -565,7 +565,7 @@ RED.editor = (function() {
var buttons = $( "#dialog" ).dialog("option","buttons");
buttons.unshift({
class: 'leftButton',
text: "Edit flow",
text: RED._("editor.editFlow"),
click: function() {
RED.workspaces.show(id);
$("#node-dialog-ok").click();
@ -652,7 +652,7 @@ RED.editor = (function() {
if (buttons.length == 2) {
buttons.unshift({
class: 'leftButton',
text: "Delete",
text: RED._("editor.configDelete"),
click: function() {
var configProperty = $(this).dialog('option','node-property');
var configId = $(this).dialog('option','node-id');
@ -684,7 +684,7 @@ RED.editor = (function() {
});
}
buttons[1].text = "Update";
$("#node-config-dialog-user-count").html(configNode.users.length+" node"+(configNode.users.length==1?" uses":"s use")+" this config").show();
$("#node-config-dialog-user-count").html(RED._("editor.nodesUse", {count:configNode.users.length})).show();
}
$( "#node-config-dialog" ).dialog("option","buttons",buttons);
@ -695,7 +695,7 @@ RED.editor = (function() {
.dialog("option","node-property",name)
.dialog("option","node-id",configNode.id)
.dialog("option","node-type",type)
.dialog("option","title",(adding?"Add new ":"Edit ")+type+" config node")
.dialog("option","title",(adding?RED._("editor.addNewConfig", {type:type}):RED._("editor.editConfig", {type:type})))
.dialog( "open" );
}
@ -703,9 +703,9 @@ RED.editor = (function() {
var button = $("#node-input-edit-"+name);
if (button.length) {
if (value) {
button.text("edit");
button.text(RED._("editor.configEdit"));
} else {
button.text("add");
button.text(RED._("editor.configAdd"));
}
$("#node-input-"+name).val(value);
} else {
@ -724,12 +724,12 @@ RED.editor = (function() {
select.append('<option value="'+config.id+'"'+(value==config.id?" selected":"")+'>'+label+'</option>');
}
});
select.append('<option value="_ADD_"'+(value===""?" selected":"")+'>Add new '+type+'...</option>');
select.append('<option value="_ADD_"'+(value===""?" selected":"")+'>'+RED._("editor.addNewType", {type:type})+'</option>');
window.setTimeout(function() { select.change();},50);
}
}
// TODO: Cannot NLS enable until RED._ is exposed
$( "#node-config-dialog" ).dialog({
modal: true,
autoOpen: false,
@ -740,7 +740,7 @@ RED.editor = (function() {
buttons: [
{
id: "node-config-dialog-ok",
text: "Ok",
text: "Ok", // RED._("dialog.ok"),
click: function() {
var configProperty = $(this).dialog('option','node-property');
var configId = $(this).dialog('option','node-id');
@ -800,7 +800,7 @@ RED.editor = (function() {
},
{
id: "node-config-dialog-cancel",
text: "Cancel",
text: "Cancel", // RED._("dialog.cancel"),
click: function() {
var configType = $(this).dialog('option','node-type');
var configId = $(this).dialog('option','node-id');
@ -854,7 +854,7 @@ RED.editor = (function() {
buttons: [
{
id: "subflow-dialog-ok",
text: "Ok",
text: "Ok", // RED._("dialog.ok"),
click: function() {
if (editing_node) {
var i;
@ -868,7 +868,7 @@ RED.editor = (function() {
changes['name'] = editing_node.name;
editing_node.name = newName;
changed = true;
$("#menu-item-workspace-menu-"+editing_node.id.replace(".","-")).text("Subflow: "+newName);
$("#menu-item-workspace-menu-"+editing_node.id.replace(".","-")).text(RED._("editor.subflow")+newName);
}
RED.palette.refresh();
@ -901,7 +901,7 @@ RED.editor = (function() {
},
{
id: "subflow-dialog-cancel",
text: "Cancel",
text: "Cancel", // RED._("dialog.cancel")
click: function() {
$( this ).dialog( "close" );
editing_node = null;
@ -940,9 +940,9 @@ RED.editor = (function() {
userCount++;
}
});
$("#subflow-dialog-user-count").html("There "+(userCount==1?"is":"are")+" "+userCount+" instance"+(userCount==1?" ":"s")+" of this subflow").show();
$("#subflow-dialog").dialog("option","title","Edit flow "+subflow.name).dialog( "open" );
$("#subflow-dialog-user-count").html(RED._("editor.subflowInstances", {count:userCount})).show();
$("#subflow-dialog").dialog("option","title",RED._("editor.editFlow")+subflow.name).dialog( "open" );
}

View File

@ -69,24 +69,24 @@ RED.keyboard = (function() {
dialog = $('<div id="keyboard-help-dialog" class="hide">'+
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
'<table class="keyboard-shortcuts">'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">a</span></td><td>Select all nodes</td></tr>'+
'<tr><td><span class="help-key">Shift</span> + <span class="help-key">Click</span></td><td>Select all connected nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">Click</span></td><td>Add/remove node from selection</td></tr>'+
'<tr><td><span class="help-key">Delete</span></td><td>Delete selected nodes or link</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">a</span></td><td>'+RED._("keyboard.selectAll")+'</td></tr>'+
'<tr><td><span class="help-key">Shift</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.selectAllConnected")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">Click</span></td><td>'+RED._("keyboard.addRemoveNode")+'</td></tr>'+
'<tr><td><span class="help-key">Delete</span></td><td>'+RED._("keyboard.deleteSelected")+'</td></tr>'+
'<tr><td>&nbsp;</td><td></td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">i</span></td><td>Import nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">e</span></td><td>Export selected nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">i</span></td><td>'+RED._("keyboard.importNode")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">e</span></td><td>'+RED._("keyboard.exportNode")+'</td></tr>'+
'</table>'+
'</div>'+
'<div style="vertical-align: top;display:inline-block; box-sizing: border-box; width:50%; padding: 10px;">'+
'<table class="keyboard-shortcuts">'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">Space</span></td><td>Toggle sidebar</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">Space</span></td><td>'+RED._("keyboard.toggleSidebar")+'</td></tr>'+
'<tr><td></td><td></td></tr>'+
'<tr><td><span class="help-key">Delete</span></td><td>Delete selected nodes or link</td></tr>'+
'<tr><td><span class="help-key">Delete</span></td><td>'+RED._("keyboard.deleteNode")+'</td></tr>'+
'<tr><td></td><td></td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">c</span></td><td>Copy selected nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">x</span></td><td>Cut selected nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">v</span></td><td>Paste nodes</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">c</span></td><td>'+RED._("keyboard.copyNode")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">x</span></td><td>'+RED._("keyboard.cutNode")+'</td></tr>'+
'<tr><td><span class="help-key">Ctrl/&#8984;</span> + <span class="help-key">v</span></td><td>'+RED._("keyboard.pasteNode")+'</td></tr>'+
'</table>'+
'</div>'+
'</div>')

View File

@ -146,8 +146,8 @@ RED.library = (function() {
'<div class="btn-group" style="margin-left: 0px;">'+
'<button id="node-input-'+options.type+'-lookup" class="btn input-append-right" data-toggle="dropdown"><i class="fa fa-book"></i> <i class="fa fa-caret-down"></i></button>'+
'<ul class="dropdown-menu pull-right" role="menu">'+
'<li><a id="node-input-'+options.type+'-menu-open-library" tabindex="-1" href="#">Open Library...</a></li>'+
'<li><a id="node-input-'+options.type+'-menu-save-library" tabindex="-1" href="#">Save to Library...</a></li>'+
'<li><a id="node-input-'+options.type+'-menu-open-library" tabindex="-1" href="#">'+RED._("library.openLibrary")+'</a></li>'+
'<li><a id="node-input-'+options.type+'-menu-save-library" tabindex="-1" href="#">'+RED._("library.saveToLibrary")+'</a></li>'+
'</ul></div>'
);
@ -232,14 +232,14 @@ RED.library = (function() {
libraryEditor.$blockScrolling = Infinity;
$( "#node-dialog-library-lookup" ).dialog({
title: options.type+" library",
title: RED._("library.typeLibrary", {type:options.type}),
modal: true,
autoOpen: false,
width: 800,
height: 450,
buttons: [
{
text: "Ok",
text: RED._("dialog.ok"),
click: function() {
if (selectedLibraryItem) {
for (var i=0;i<options.fields.length;i++) {
@ -252,7 +252,7 @@ RED.library = (function() {
}
},
{
text: "Cancel",
text: RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
@ -274,12 +274,12 @@ RED.library = (function() {
function saveToLibrary(overwrite) {
var name = $("#node-input-name").val().replace(/(^\s*)|(\s*$)/g,"");
if (name === "") {
name = "Unnamed "+options.type;
name = RED._("library.unnamedType",{type:options.type});
}
var filename = $("#node-dialog-library-save-filename").val().replace(/(^\s*)|(\s*$)/g,"");
var pathname = $("#node-dialog-library-save-folder").val().replace(/(^\s*)|(\s*$)/g,"");
if (filename === "" || !/.+\.js$/.test(filename)) {
RED.notify("Invalid filename","warning");
RED.notify(RED._("notification.invalidFilename"),"warning");
return;
}
var fullpath = pathname+(pathname===""?"":"/")+filename;
@ -328,27 +328,27 @@ RED.library = (function() {
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8"
}).done(function(data,textStatus,xhr) {
RED.notify("Saved "+options.type,"success");
RED.notify(RED._("notification.savedType", {type:options.type}),"success");
}).fail(function(xhr,textStatus,err) {
RED.notify("Saved failed: "+xhr.responseJSON.message,"error");
RED.notify(RED._("notification.saveFailed")+xhr.responseJSON.message,"error");
});
}
$( "#node-dialog-library-save-confirm" ).dialog({
title: "Save to library",
title: RED._("library.saveToLibrary"),
modal: true,
autoOpen: false,
width: 530,
height: 230,
buttons: [
{
text: "Ok",
text: RED._("dialog.ok"),
click: function() {
saveToLibrary(true);
$( this ).dialog( "close" );
}
},
{
text: "Cancel",
text: RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
@ -356,21 +356,21 @@ RED.library = (function() {
]
});
$( "#node-dialog-library-save" ).dialog({
title: "Save to library",
title: RED._("library.saveToLibrary"),
modal: true,
autoOpen: false,
width: 530,
height: 230,
buttons: [
{
text: "Ok",
text: RED._("dialog.ok"),
click: function() {
saveToLibrary(false);
$( this ).dialog( "close" );
}
},
{
text: "Cancel",
text: RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
@ -385,7 +385,7 @@ RED.library = (function() {
var nns = RED.nodes.createExportableNodeSet(RED.view.selection().nodes);
$("#dialog-form").html($("script[data-template-name='export-library-dialog']").html());
$("#node-input-filename").attr('nodes',JSON.stringify(nns));
$( "#dialog" ).dialog("option","title","Export nodes to library").dialog( "open" );
$( "#dialog" ).dialog("option","title",RED._("library.exportToLibrary")).dialog( "open" );
}
return {

View File

@ -78,15 +78,15 @@ RED.palette = (function() {
l = "<p><b>"+label+"</b><br/><i>"+type+"</i></p>";
}
popOverContent = $(l+($("script[data-help-name|='"+type+"']").html()||"<p>no information available</p>").trim())
popOverContent = $(l+($("script[data-help-name|='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
.filter(function(n) {
return this.nodeType == 1 || (this.nodeType == 3 && this.textContent.trim().length > 0)
}).slice(0,2);
} catch(err) {
// Malformed HTML may cause errors. TODO: need to understand what can break
console.log("Error generating pop-over label for '"+type+"'.");
console.log(RED._("palette.popOverError",{type:type}));
console.log(err.toString());
popOverContent = "<p><b>"+label+"</b></p><p>no information available</p>";
popOverContent = "<p><b>"+label+"</b></p><p>"+RED._("palette.noInfo")+"</p>";
}

View File

@ -216,7 +216,7 @@ RED.subflow = (function() {
function convertToSubflow() {
var selection = RED.view.selection();
if (!selection.nodes) {
RED.notify("<strong>Cannot create subflow</strong>: no nodes selected","error");
RED.notify(RED._("notification.noNodesSelected"),"error");
return;
}
var i;
@ -276,7 +276,7 @@ RED.subflow = (function() {
candidateOutputs.sort(function(a,b) { return a.source.y-b.source.y});
if (candidateInputs.length > 1) {
RED.notify("<strong>Cannot create subflow</strong>: multiple inputs to selection","error");
RED.notify(RED._("notification.multipleInputsToSelection"),"error");
return;
}
//if (candidateInputs.length == 0) {

View File

@ -60,12 +60,12 @@ RED.sidebar.info = (function() {
function refresh(node) {
var table = '<table class="node-info"><tbody>';
table += '<tr class="blank"><td colspan="2">Node</td></tr>';
table += '<tr class="blank"><td colspan="2">'+RED._("tabInfo.node")+'</td></tr>';
if (node.type != "subflow" && node.name) {
table += "<tr><td>Name</td><td>&nbsp;"+node.name+"</td></tr>";
}
table += "<tr><td>Type</td><td>&nbsp;"+node.type+"</td></tr>";
table += "<tr><td>ID</td><td>&nbsp;"+node.id+"</td></tr>";
table += "<tr><td>"+RED._("tabInfo.type")+"</td><td>&nbsp;"+node.type+"</td></tr>";
table += "<tr><td>"+RED._("tabInfo.id")+"</td><td>&nbsp;"+node.id+"</td></tr>";
var m = /^subflow(:(.+))?$/.exec(node.type);
if (m) {
@ -76,7 +76,7 @@ RED.sidebar.info = (function() {
subflowNode = node;
}
table += '<tr class="blank"><td colspan="2">Subflow</td></tr>';
table += '<tr class="blank"><td colspan="2">'+RED._("tabInfo.subflow")+'</td></tr>';
var userCount = 0;
var subflowType = "subflow:"+subflowNode.id;
@ -85,12 +85,12 @@ RED.sidebar.info = (function() {
userCount++;
}
});
table += "<tr><td>name</td><td>"+subflowNode.name+"</td></tr>";
table += "<tr><td>instances</td><td>"+userCount+"</td></tr>";
table += "<tr><td>"+RED._("tabInfo.name")+"</td><td>"+subflowNode.name+"</td></tr>";
table += "<tr><td>"+RED._("tabInfo.instances")+"</td><td>"+userCount+"</td></tr>";
}
if (!m && node.type != "subflow" && node.type != "comment") {
table += '<tr class="blank"><td colspan="2"><a href="#" class="node-info-property-header"><i style="width: 10px; text-align: center;" class="fa fa-caret-'+(propertiesExpanded?"down":"right")+'"></i> Properties</a></td></tr>';
table += '<tr class="blank"><td colspan="2"><a href="#" class="node-info-property-header"><i style="width: 10px; text-align: center;" class="fa fa-caret-'+(propertiesExpanded?"down":"right")+'"></i> '+RED._("tabInfo.properties")+'</a></td></tr>';
if (node._def) {
for (var n in node._def.defaults) {
if (n != "name" && node._def.defaults.hasOwnProperty(n)) {
@ -98,7 +98,7 @@ RED.sidebar.info = (function() {
var type = typeof val;
if (type === "string") {
if (val.length === 0) {
val += '<span style="font-style: italic; color: #ccc;">blank</span>';
val += '<span style="font-style: italic; color: #ccc;">'+RED._("tabInfo.blank")+'</span>';
} else {
if (val.length > 30) {
val = val.substring(0,30)+" ...";

View File

@ -309,11 +309,11 @@ RED.view = (function() {
if (activeSubflow && m) {
var subflowId = m[1];
if (subflowId === activeSubflow.id) {
RED.notify("<strong>Error</strong>: Cannot add subflow to itself","error");
RED.notify(RED._("notification.cannotAddSubflowToItself"),"error");
return;
}
if (RED.nodes.subflowContains(m[1],activeSubflow.id)) {
RED.notify("<strong>Error</strong>: Cannot add subflow - circular reference detected","error");
RED.notify(RED._("notification.cannotAddCircularReference"),"error");
return;
}
@ -856,7 +856,7 @@ RED.view = (function() {
}
}
clipboard = JSON.stringify(nns);
RED.notify(nns.length+" node"+(nns.length>1?"s":"")+" copied");
RED.notify(RED._("notification.nodeCopied",{count:nns.length}));
}
}
@ -1043,9 +1043,9 @@ RED.view = (function() {
redraw();
}
} else if (d.changed) {
RED.notify("<strong>Warning</strong>: node has undeployed changes","warning");
RED.notify(RED._("notification.undeployedChanges"),"warning");
} else {
RED.notify("<strong>Warning</strong>: node actions disabled within subflow","warning");
RED.notify(RED._("notification.nodeActionDisabled"),"warning");
}
d3.event.preventDefault();
}
@ -1754,9 +1754,9 @@ RED.view = (function() {
} catch(error) {
if (error.code != "NODE_RED") {
console.log(error.stack);
RED.notify("<strong>Error</strong>: "+error,"error");
RED.notify(RED._("notification.error")+error,"error");
} else {
RED.notify("<strong>Error</strong>: "+error.message,"error");
RED.notify(RED._("notification.error")+error.message,"error");
}
}
}

View File

@ -122,11 +122,11 @@ RED.workspaces = (function() {
modal: true,
autoOpen: false,
width: 500,
title: "Rename sheet",
title: "Rename sheet", // RED._("dialog.renameSheet"),
buttons: [
{
class: 'leftButton',
text: "Delete",
text: "Delete", // RED._("dialog.delete"),
click: function() {
var workspace = $(this).dialog('option','workspace');
$( this ).dialog( "close" );
@ -134,7 +134,7 @@ RED.workspaces = (function() {
}
},
{
text: "Ok",
text: "Ok", // RED._("dialog.ok"),
click: function() {
var workspace = $(this).dialog('option','workspace');
var label = $( "#node-input-workspace-name" ).val();
@ -148,7 +148,7 @@ RED.workspaces = (function() {
}
},
{
text: "Cancel",
text: "Cancel", // RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
@ -165,10 +165,10 @@ RED.workspaces = (function() {
modal: true,
autoOpen: false,
width: 500,
title: "Confirm delete",
title: "Confirm delete", // RED._("dialog.confirmDelete"),
buttons: [
{
text: "Ok",
text: "Ok", // RED._("dialog.ok"),
click: function() {
var workspace = $(this).dialog('option','workspace');
deleteWorkspace(workspace,true);
@ -176,7 +176,7 @@ RED.workspaces = (function() {
}
},
{
text: "Cancel",
text: "Cancel", // RED._("dialog.cancel"),
click: function() {
$( this ).dialog( "close" );
}
@ -251,7 +251,7 @@ RED.workspaces = (function() {
if (!workspace_tabs.contains(id)) {
var sf = RED.nodes.subflow(id);
if (sf) {
addWorkspace({type:"subflow",id:id,label:"Subflow: "+sf.name, closeable: true});
addWorkspace({type:"subflow",id:id,label:RED._("workspaces.subflow")+sf.name, closeable: true});
}
}
workspace_tabs.activateTab(id);
@ -259,7 +259,7 @@ RED.workspaces = (function() {
refresh: function() {
RED.nodes.eachSubflow(function(sf) {
if (workspace_tabs.contains(sf.id)) {
workspace_tabs.renameTab(sf.id,"Subflow: "+sf.name);
workspace_tabs.renameTab(sf.id,RED._("workspaces.subflow")+sf.name);
}
});
},

View File

@ -36,7 +36,19 @@
"nodeDisabled_plural": "Nodes disabled:",
"lostConnectionError": "<b>Error</b>: Lost connection to server",
"importUnrecognised": "Imported unrecognised ",
"loggedInAs": "Logged in as "
"loggedInAs": "Logged in as ",
"invalidFilename": "Invalid filename",
"savedType": "Saved __type__",
"saveFailed": "Save failed: ",
"noNodesSelected": "<strong>Cannot create subflow</strong>: no nodes selected",
"multipleInputsToSelection": "<strong>Cannot create subflow</strong>: multiple inputs to selection",
"cannotAddSubflowToItself": "<strong>Error</strong>: Cannot add subflow to itself",
"cannotAddCircularReference": "<strong>Error</strong>: Cannot add subflow - circular reference detected",
"nodeCopied": "__count__ node copied",
"nodeCopied_plural": "__count__ nodes copied",
"undeployedChanges": "<strong>Warning</strong>: node has undeployed changes",
"nodeActionDisabled": "<strong>Warning</strong>: node actions disabled within subflow",
"error": "<strong>Error</strong>: "
},
"error": {
"apiSubflowOnly": "this api is subflow only. called with:",
@ -47,6 +59,84 @@
"dialog": {
"cancel": "Cancel",
"login": "Login",
"loginFailed": "Login failed"
"loginFailed": "Login failed",
"ok": "Ok",
"delete": "Delete",
"close": "Close",
"nodes": " Nodes:",
"selectToCopy": "Select the text above and copy to the clipboard with Ctrl-C.",
"pasteNodesHere": "Paste nodes here",
"importNodes": "Import nodes",
"exportNodesClipboard": "Export nodes to clipboard",
"renameSheet": "Rename sheet",
"confirmDelete": "Confirm delete"
},
"deploy": {
"deploy": "Deploy",
"full": "Full",
"modifiedFlows": "Modified Flows",
"modifiedNodes": "Modified Nodes",
"fullDesc": "Deploys everything in the workspace",
"modifiedFlowsDesc": "Only deploys flows that contain changed nodes",
"modifiedNodesDesc": "Only deploys nodes that have changed",
"confirmDeploy": "Confirm deploy",
"cancelDeploy": "Cancel",
"undeployedChanges": "You have undeployed changes.\n\nLeaving this page will lose these changes.",
"successfulDeploy": "Successfully Deployed",
"error": "<strong>Error</strong>: ",
"noResponseError": "no response from server"
},
"editor": {
"savedNodes": "Saved nodes",
"configEdit": "edit",
"configAdd": "add",
"configDelete": "Delete",
"editFlow": "Edit flow ",
"nodesUse": "__count__ node uses this config",
"nodesUse_plural": "__count__ nodes use this config",
"addNewConfig": "Add new __type__ config node",
"editConfig": "Edit __type__ config node",
"addNewType": "Add new __type__...",
"subflow": "Subflow: ",
"subflowInstances": "There is __count__ instance of this subflow",
"subflowInstances_plural": "There are __count__ instances of this subflow"
},
"keyboard": {
"selectAll": "Select all nodes",
"selectAllConnected": "Select all connected nodes",
"addRemoveNode": "Add/remove node from selection",
"deleteSelected": "Delete selected nodes or link",
"importNode": "Import nodes",
"exportNode": "Export selected nodes",
"toggleSidebar": "Toggle sidebar",
"deleteNode": "Delete selected nodes or link",
"copyNode": "Copy selected nodes",
"cutNode": "Cut selected nodes",
"pasteNode": "Paste nodes"
},
"library": {
"openLibrary": "Open Library...",
"saveToLibrary": "Save to Library...",
"typeLibrary": "__type__ library",
"unnamedType": "Unnamed __type__",
"saveToLibrary": "Save to Library",
"exportToLibrary": "Export nodes to library"
},
"palette": {
"noInfo": "no information available",
"popOverError": "Error generating pop-over label for '__type__'."
},
"tabInfo": {
"node": "Node",
"type": "Type",
"id": "ID",
"subflow": "Subflow",
"name": "name",
"instances": "instances",
"properties": "Properties",
"blank": "blank"
},
"workspaces": {
"subflow": "Subflow: "
}
}

142
locales/zz-ZZ/editor.json Normal file
View File

@ -0,0 +1,142 @@
{
"workspace": {
"label": {
"name": "[G'Nameฏูİı]"
}
},
"menu": {
"label": {
"sidebar": "[G'Sidebarฏูİı]",
"displayStatus": "[G'y node statusฏูİı]",
"import": "[G'Importฏูİı]",
"export": "[G'Exportฏูİı]",
"clipboard": "[G'Clipboardฏูİı]",
"library": "[G'Libraryฏูİı]",
"configurationNodes": "[G'uration nodesฏูİı]",
"subflows": "[G'Subflowsฏูİı]",
"createSubflow": "[G'te subflowฏูİı]",
"selectionToSubflow": "[G'on to subflowฏูİı]",
"workspaces": "[G'orkspacesฏูİı]",
"add": "[G'Addฏูİı]",
"rename": "[G'Renameฏูİı]",
"delete": "[G'Deleteฏูİı]",
"keyboardShortcuts": "[G'rd Shortcutsฏูİı]",
"login": "[G'Loginฏูİı]",
"logout": "[G'Logoutฏูİı]"
}
},
"notification": {
"nodeAdded": "[G' d to palette:ฏูİı|]",
"nodeAdded_plural": "[G' ed to paletteฏูİı]",
"nodeRemoved": "[G' ed from palette:ฏูİı|]",
"nodeRemoved_plural": "[G' ved from palette:ฏูİı|]",
"nodeEnabled": "[G'e enabled:ฏูİı|]",
"nodeEnabled_plural": "[G's enabled:ฏูİı|]",
"nodeDisabled": "[G' disabled:ฏูİı|]",
"nodeDisabled_plural": "[G's disabled:ฏูİı|]",
"lostConnectionError": "[G'<b></b>: onnection to serverฏูİı]",
"importUnrecognised": "[G' unrecognised ฏูİı|]",
"loggedInAs": "[G'ged in as ฏูİı|]",
"invalidFilename": "[G'id filenameฏูİı]",
"savedType": "[G'd __type__ฏูİı]",
"saveFailed": "[G'e failed: ฏูİı|]",
"noNodesSelected": "[G'<strong> e subflow</strong>: no nodes selectedฏูİı]",
"multipleInputsToSelection": "[G'<strong> subflow</strong>: multiple inputs to selectionฏูİı]",
"cannotAddSubflowToItself": "[G'<strong></strong>: t add subflow to itselfฏูİı]",
"cannotAddCircularReference": "[G'<strong></strong>: dd subflow - circular reference detectedฏูİı]",
"nodeCopied": "[G'____ de copiedฏูİı]",
"nodeCopied_plural": "[G'____ es copiedฏูİı]",
"undeployedChanges": "[G'<strong></strong>: has undeployed changesฏูİı]",
"nodeActionDisabled": "[G'<strong></strong>: actions disabled within subflowฏูİı]",
"error": "[G'<strong>Error</strong>: ฏูİı|]"
},
"error": {
"apiSubflowOnly": "[G' bflow only. called with:ฏูİı|]",
"invalidFlow": "[G'lid flow: ฏูİı|]",
"cannotAddSubflowToItself": "[G' subflow to itselfฏูİı]",
"cannotAddCircularReference": "[G' bflow - circular reference detectedฏูİı]"
},
"dialog": {
"cancel": "[G'Cancelฏูİı]",
"login": "[G'Loginฏูİı]",
"loginFailed": "[G'gin failedฏูİı]",
"ok": "[G'Okฏูİı]",
"delete": "[G'Deleteฏูİı]",
"close": "[G'Closeฏูİı]",
"nodes": "[G' Nodes:ฏูİı|]",
"selectToCopy": "[G' t above and copy to the clipboard with Ctrl-C.ฏูİı|]",
"pasteNodesHere": "[G' nodes hereฏูİı]",
"importNodes": "[G'port nodesฏูİı]",
"exportNodesClipboard": "[G' es to clipboardฏูİı]",
"renameSheet": "[G'name sheetฏูİı]",
"confirmDelete": "[G'irm deleteฏูİı]"
},
"deploy": {
"deploy": "[G'Deployฏูİı]",
"full": "[G'Fullฏูİı]",
"modifiedFlows": "[G'fied Flowsฏูİı]",
"modifiedNodes": "[G'fied Nodesฏูİı]",
"fullDesc": "[G' rything in the workspaceฏูİı]",
"modifiedFlowsDesc": "[G' flows that contain changed nodesฏูİı]",
"modifiedNodesDesc": "[G' s nodes that have changedฏูİı]",
"confirmDeploy": "[G'irm deployฏูİı]",
"cancelDeploy": "[G'Cancelฏูİı]",
"undeployedChanges": "[G' loyed changes.\n\nLeaving this page will lose these changes.ฏูİı|]",
"successfulDeploy": "[G'fully Deployedฏูİı]",
"error": "[G'<strong>Error</strong>: ฏูİı|]",
"noResponseError": "[G' se from serverฏูİı]"
},
"editor": {
"savedNodes": "[G'ved nodesฏูİı]",
"configEdit": "[G'editฏูİı]",
"configAdd": "[G'addฏูİı]",
"configDelete": "[G'Deleteฏูİı]",
"editFlow": "[G'dit flow ฏูİı|]",
"nodesUse": "[G'____ uses this configฏูİı]",
"nodesUse_plural": "[G'____ s use this configฏูİı]",
"addNewConfig": "[G' __e__ config nodeฏูİı]",
"editConfig": "[G' ____ onfig nodeฏูİı]",
"addNewType": "[G' __type__...ฏูİı|]",
"subflow": "[G'Subflow: ฏูİı|]",
"subflowInstances": "[G' __t__ instance of this subflowฏูİı]",
"subflowInstances_plural": "[G' __nt__ instances of this subflowฏูİı]"
},
"keyboard": {
"selectAll": "[G't all nodesฏูİı]",
"selectAllConnected": "[G' connected nodesฏูİı]",
"addRemoveNode": "[G'/ node from selectionฏูİı]",
"deleteSelected": "[G' ected nodes or linkฏูİı]",
"importNode": "[G'port nodesฏูİı]",
"exportNode": "[G' elected nodesฏูİı]",
"toggleSidebar": "[G'le sidebarฏูİı]",
"deleteNode": "[G' ected nodes or linkฏูİı]",
"copyNode": "[G' lected nodesฏูİı]",
"cutNode": "[G' ected nodesฏูİı]",
"pasteNode": "[G'ste nodesฏูİı]"
},
"library": {
"openLibrary": "[G' Library...ฏูİı|]",
"saveToLibrary": "[G' Library...ฏูİı|]",
"typeLibrary": "[G'____ ibraryฏูİı]",
"unnamedType": "[G'ed __type__ฏูİı]",
"saveToLibrary": "[G' to Libraryฏูİı]",
"exportToLibrary": "[G' des to libraryฏูİı]"
},
"palette": {
"noInfo": "[G' ation availableฏูİı]",
"popOverError": "[G' ting pop-over label for '__type__'.ฏูİı|]"
},
"tabInfo": {
"node": "[G'Nodeฏูİı]",
"type": "[G'Typeฏูİı]",
"id": "[G'IDฏูİı]",
"subflow": "[G'Subflowฏูİı]",
"name": "[G'nameฏูİı]",
"instances": "[G'instancesฏูİı]",
"properties": "[G'ropertiesฏูİı]",
"blank": "[G'blankฏูİı]"
},
"workspaces": {
"subflow": "[G'Subflow: ฏูİı|]"
}
}

View File

@ -0,0 +1,91 @@
{
"runtime": {
"welcome": "[G'e to Node-REDฏูİı]",
"version": "[G'____ ersion: __version__ฏูİı]",
"paths": {
"settings": "[G' ile : __path__ฏูİı]"
}
},
"server": {
"loading": "[G' palette nodesฏูİı]",
"errors": "[G' ister __count__ node typeฏูİı]",
"errors_plural": "[G' ister __count__ node typesฏูİı]",
"errors-help": "[G' - for detailsฏูİı]",
"missing-modules": "[G' node modules:ฏูİı|]",
"removing-modules": "[G' odules from configฏูİı]",
"added-types": "[G' node types:ฏูİı|]",
"removed-types": "[G'd node types:ฏูİı|]",
"install": {
"invalid": "[G'd module nameฏูİı]",
"installing": "[G'g module: __name__ฏูİı]",
"installed": "[G' module: __name__ฏูİı]",
"install-failed": "[G'all failedฏูİı]",
"install-failed-long": "[G'n of module __name__ failed:ฏูİı|]",
"install-failed-not-found": "[G'$(-led-long) module not foundฏูİı]",
"uninstalling": "[G'ing module: __name__ฏูİı]",
"uninstall-failed": "[G'tall failedฏูİı]",
"uninstall-failed-long": "[G' f module __name__ failed:ฏูİı|]",
"uninstalled": "[G'ed module: __name__ฏูİı]"
}
},
"api": {
"flows": {
"error-save": "[G' ng flows: __message__ฏูİı]"
},
"library": {
"error-load-entry": "[G' g library entry '__path__': __message__ฏูİı]",
"error-save-entry": "[G' library entry '__path__': __message__ฏูİı]",
"error-load-flow": "[G' g flow '__path__': __message__ฏูİı]",
"error-save-flow": "[G' flow '__path__': __message__ฏูİı]"
},
"nodes": {
"enabled": "[G'd node types:ฏูİı|]",
"disabled": "[G'd node types:ฏูİı|]",
"error-enable": "[G' enable node:ฏูİı|]"
}
},
"comms": {
"error": "[G'on channel error: __message__ฏูİı]",
"error-server": "[G'on server error: __message__ฏูİı]",
"error-send": "[G'ion send error: __message__ฏูİı]"
},
"nodes": {
"credentials": {
"error":"[G' g credentials: __message__ฏูİı]",
"not-registered": "[G' ype '__type__' is not registeredฏูİı]"
},
"flows": {
"registered-missing": "[G' e registered: __type__ฏูİı]",
"error": "[G' ing flows: __message__ฏูİı]",
"starting-modified-nodes": "[G' modified nodesฏูİı]",
"starting-modified-flows": "[G' modified flowsฏูİı]",
"starting-flows": "[G'ting flowsฏูİı]",
"started-modified-nodes": "[G' odified nodesฏูİı]",
"started-modified-flows": "[G' odified flowsฏูİı]",
"started-flows": "[G'rted flowsฏูİı]",
"stopping-modified-nodes": "[G' modified nodesฏูİı]",
"stopping-modified-flows": "[G' modified flowsฏูİı]",
"stopping-flows": "[G'ping flowsฏูİı]",
"stopped-modified-nodes": "[G' odified nodesฏูİı]",
"stopped-modified-flows": "[G' odified flowsฏูİı]",
"stopped-flows": "[G'pped flowsฏูİı]",
"stopped": "[G'Stoppedฏูİı]",
"missing-types": "[G' issing types to be registered:ฏูİı|]"
}
},
"storage": {
"localfilesystem": {
"user-dir": "[G' tory : __path__ฏูİı]",
"flows-file": "[G' le : __path__ฏูİı]",
"create": "[G' new flow fileฏูİı]"
}
}
}