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

Add i18n support for projectSettings.js

This commit is contained in:
Kazuhito Yokoi 2018-06-01 12:58:09 +09:00
parent 95b4c8d515
commit ab788bc1e3
3 changed files with 140 additions and 49 deletions

View File

@ -49,7 +49,7 @@ RED.projects.settings = (function() {
var tabContainer; var tabContainer;
var trayOptions = { var trayOptions = {
title: "Project Settings",// RED._("menu.label.userSettings"),, // TODO: nls title: RED._("menu.label.userSettings"),
buttons: [ buttons: [
{ {
id: "node-dialog-ok", id: "node-dialog-ok",
@ -173,14 +173,14 @@ RED.projects.settings = (function() {
container.empty(); container.empty();
var bg = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').appendTo(container); var bg = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').appendTo(container);
var input = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(summary||"").appendTo(container); var input = $('<input type="text" style="width: calc(100% - 150px); margin-right: 10px;">').val(summary||"").appendTo(container);
$('<button class="editor-button">Cancel</button>') $('<button class="editor-button">' + RED._("common.label.cancel") + '</button>')
.appendTo(bg) .appendTo(bg)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
updateProjectSummary(activeProject.summary, container); updateProjectSummary(activeProject.summary, container);
editButton.show(); editButton.show();
}); });
$('<button class="editor-button">Save</button>') $('<button class="editor-button">' + RED._("common.label.save") + '</button>')
.appendTo(bg) .appendTo(bg)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -223,7 +223,7 @@ RED.projects.settings = (function() {
if (summary) { if (summary) {
container.text(summary).removeClass('node-info-node'); container.text(summary).removeClass('node-info-node');
} else { } else {
container.text("No summary available").addClass('node-info-none');// TODO: nls container.text(RED._("sidebar.project.projectSettings.noSummaryAvailable")).addClass('node-info-none');
} }
} }
@ -235,7 +235,8 @@ RED.projects.settings = (function() {
var summaryContent = $('<div></div>',{style:"color: #999"}).appendTo(summary); var summaryContent = $('<div></div>',{style:"color: #999"}).appendTo(summary);
updateProjectSummary(activeProject.summary, summaryContent); updateProjectSummary(activeProject.summary, summaryContent);
if (RED.user.hasPermission("projects.write")) { if (RED.user.hasPermission("projects.write")) {
$('<button class="editor-button editor-button-small" style="float: right;">edit description</button>') $('<button class="editor-button editor-button-small" style="float: right;">'
+ RED._('sidebar.project.editDescription') + '</button>')
.prependTo(summary) .prependTo(summary)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -250,7 +251,8 @@ RED.projects.settings = (function() {
updateProjectDescription(activeProject, descriptionContent); updateProjectDescription(activeProject, descriptionContent);
if (RED.user.hasPermission("projects.write")) { if (RED.user.hasPermission("projects.write")) {
$('<button class="editor-button editor-button-small" style="float: right;">edit README.md</button>') $('<button class="editor-button editor-button-small" style="float: right;">'
+ RED._('sidebar.project.editReadme') + '</button>')
.prependTo(description) .prependTo(description)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -316,7 +318,7 @@ RED.projects.settings = (function() {
// depsList.editableList('addItem',{index:3, label:"Unused dependencies"}); // TODO: nls // depsList.editableList('addItem',{index:3, label:"Unused dependencies"}); // TODO: nls
// } // }
if (totalCount === 0) { if (totalCount === 0) {
depsList.editableList('addItem',{index:0, label:"None"}); // TODO: nls depsList.editableList('addItem',{index:0, label:RED._("sidebar.project.projectSettings.none")});
} }
} }
@ -381,7 +383,8 @@ RED.projects.settings = (function() {
function createDependenciesPane(activeProject) { function createDependenciesPane(activeProject) {
var pane = $('<div id="project-settings-tab-deps" class="project-settings-tab-pane node-help"></div>'); var pane = $('<div id="project-settings-tab-deps" class="project-settings-tab-pane node-help"></div>');
if (RED.user.hasPermission("projects.write")) { if (RED.user.hasPermission("projects.write")) {
$('<button class="editor-button editor-button-small" style="margin-top:10px;float: right;">edit</button>') $('<button class="editor-button editor-button-small" style="margin-top:10px;float: right;">'
+ RED._("sidebar.project.projectSettings.edit") + '</button>')
.appendTo(pane) .appendTo(pane)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -451,7 +454,8 @@ RED.projects.settings = (function() {
var buttons = $('<div class="palette-module-button-group"></div>').appendTo(metaRow); var buttons = $('<div class="palette-module-button-group"></div>').appendTo(metaRow);
if (RED.user.hasPermission("projects.write")) { if (RED.user.hasPermission("projects.write")) {
if (!entry.installed && RED.settings.theme('palette.editable') !== false) { if (!entry.installed && RED.settings.theme('palette.editable') !== false) {
$('<a href="#" class="editor-button editor-button-small">install</a>').appendTo(buttons) $('<a href="#" class="editor-button editor-button-small">'
+ RED._("sidebar.project.projectSettings.install") + '</a>').appendTo(buttons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
RED.palette.editor.install(entry,row,function(err) { RED.palette.editor.install(entry,row,function(err) {
@ -468,7 +472,8 @@ RED.projects.settings = (function() {
}); });
}) })
} else if (entry.known && entry.count === 0) { } else if (entry.known && entry.count === 0) {
$('<a href="#" class="editor-button editor-button-small">remove from project</a>').appendTo(buttons) $('<a href="#" class="editor-button editor-button-small">'
+ RED._("sidebar.project.projectSettings.removeFromProject") + '</a>').appendTo(buttons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
var deps = $.extend(true, {}, activeProject.dependencies); var deps = $.extend(true, {}, activeProject.dependencies);
@ -484,7 +489,8 @@ RED.projects.settings = (function() {
}); });
}); });
} else if (!entry.known) { } else if (!entry.known) {
$('<a href="#" class="editor-button editor-button-small">add to project</a>').appendTo(buttons) $('<a href="#" class="editor-button editor-button-small">'
+ RED._("sidebar.project.projectSettings.addToProject") + '</a>').appendTo(buttons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
var deps = $.extend(true, {}, activeProject.dependencies); var deps = $.extend(true, {}, activeProject.dependencies);
@ -723,10 +729,11 @@ RED.projects.settings = (function() {
// } // }
function createFilesSection(activeProject,pane) { function createFilesSection(activeProject,pane) {
var title = $('<h3></h3>').text("Files").appendTo(pane); var title = $('<h3></h3>').text(RED._("sidebar.project.projectSettings.files")).appendTo(pane);
var filesContainer = $('<div class="user-settings-section"></div>').appendTo(pane); var filesContainer = $('<div class="user-settings-section"></div>').appendTo(pane);
if (RED.user.hasPermission("projects.write")) { if (RED.user.hasPermission("projects.write")) {
var editFilesButton = $('<button class="editor-button editor-button-small" style="float: right;">edit</button>') var editFilesButton = $('<button class="editor-button editor-button-small" style="float: right;">'
+ RED._('sidebar.project.projectSettings.edit') + '</button>')
.appendTo(title) .appendTo(title)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -750,7 +757,7 @@ RED.projects.settings = (function() {
// Flow files // Flow files
row = $('<div class="user-settings-row"></div>').appendTo(filesContainer); row = $('<div class="user-settings-row"></div>').appendTo(filesContainer);
$('<label for=""></label>').text('Flow').appendTo(row); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.flow")).appendTo(row);
var flowFileLabel = $('<div class="uneditable-input" style="padding:0">').appendTo(row); var flowFileLabel = $('<div class="uneditable-input" style="padding:0">').appendTo(row);
var flowFileLabelText = $('<span style="display:inline-block; padding: 6px">').text(activeProject.files.flow).appendTo(flowFileLabel); var flowFileLabelText = $('<span style="display:inline-block; padding: 6px">').text(activeProject.files.flow).appendTo(flowFileLabel);
@ -787,7 +794,7 @@ RED.projects.settings = (function() {
}) })
row = $('<div class="user-settings-row"></div>').appendTo(filesContainer); row = $('<div class="user-settings-row"></div>').appendTo(filesContainer);
$('<label for=""></label>').text('Credentials').appendTo(row); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.credentials")).appendTo(row);
var credFileLabel = $('<div class="uneditable-input">').text(activeProject.files.credentials).appendTo(row); var credFileLabel = $('<div class="uneditable-input">').text(activeProject.files.credentials).appendTo(row);
var credFileInput = $('<div class="uneditable-input">').text(activeProject.files.credentials).hide().insertAfter(credFileLabel); var credFileInput = $('<div class="uneditable-input">').text(activeProject.files.credentials).hide().insertAfter(credFileLabel);
@ -899,12 +906,15 @@ RED.projects.settings = (function() {
var credentialFormRows = $('<div>',{style:"margin-top:10px"}).hide().appendTo(credentialStateLabel); var credentialFormRows = $('<div>',{style:"margin-top:10px"}).hide().appendTo(credentialStateLabel);
var credentialSetLabel = $('<div style="margin: 20px 0 10px 5px;">Set the encryption key:</div>').hide().appendTo(credentialFormRows); var credentialSetLabel = $('<div style="margin: 20px 0 10px 5px;">'
var credentialChangeLabel = $('<div style="margin: 20px 0 10px 5px;">Change the encryption key:</div>').hide().appendTo(credentialFormRows); + RED._("sidebar.project.projectSettings.setTheEncryptionKey") + '</div>').hide().appendTo(credentialFormRows);
var credentialResetLabel = $('<div style="margin: 20px 0 10px 5px;">Reset the encryption key:</div>').hide().appendTo(credentialFormRows); var credentialChangeLabel = $('<div style="margin: 20px 0 10px 5px;">'
+ RED._("sidebar.project.projectSettings.changeTheEncryptionKey") + '</div>').hide().appendTo(credentialFormRows);
var credentialResetLabel = $('<div style="margin: 20px 0 10px 5px;">'
+ RED._("sidebar.project.projectSettings.resetTheEncryptionKey") + '</div>').hide().appendTo(credentialFormRows);
var credentialSecretExistingRow = $('<div class="user-settings-row user-settings-row-credentials"></div>').appendTo(credentialFormRows); var credentialSecretExistingRow = $('<div class="user-settings-row user-settings-row-credentials"></div>').appendTo(credentialFormRows);
$('<label for=""></label>').text('Current key').appendTo(credentialSecretExistingRow); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.currentKey")).appendTo(credentialSecretExistingRow);
var credentialSecretExistingInput = $('<input type="password">').appendTo(credentialSecretExistingRow) var credentialSecretExistingInput = $('<input type="password">').appendTo(credentialSecretExistingRow)
.on("change keyup paste",function() { .on("change keyup paste",function() {
if (popover) { if (popover) {
@ -917,10 +927,11 @@ RED.projects.settings = (function() {
var credentialSecretNewRow = $('<div class="user-settings-row user-settings-row-credentials"></div>').appendTo(credentialFormRows); var credentialSecretNewRow = $('<div class="user-settings-row user-settings-row-credentials"></div>').appendTo(credentialFormRows);
$('<label for=""></label>').text('New key').appendTo(credentialSecretNewRow); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.newKey")).appendTo(credentialSecretNewRow);
var credentialSecretNewInput = $('<input type="password">').appendTo(credentialSecretNewRow).on("change keyup paste",checkFiles); var credentialSecretNewInput = $('<input type="password">').appendTo(credentialSecretNewRow).on("change keyup paste",checkFiles);
var credentialResetWarning = $('<div class="form-tips form-warning" style="margin: 10px;"><i class="fa fa-warning"></i> This will delete all existing credentials</div>').hide().appendTo(credentialFormRows); var credentialResetWarning = $('<div class="form-tips form-warning" style="margin: 10px;"><i class="fa fa-warning"></i>'
+ RED._("sidebar.project.projectSettings.credentialsAlert") + '</div>').hide().appendTo(credentialFormRows);
var hideEditForm = function() { var hideEditForm = function() {
@ -950,13 +961,13 @@ RED.projects.settings = (function() {
} }
var formButtons = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').hide().appendTo(filesContainer); var formButtons = $('<span class="button-row" style="position: relative; float: right; margin-right:0;"></span>').hide().appendTo(filesContainer);
$('<button class="editor-button">Cancel</button>') $('<button class="editor-button">' + RED._("common.label.cancel") + '</button>')
.appendTo(formButtons) .appendTo(formButtons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
hideEditForm(); hideEditForm();
}); });
var saveButton = $('<button class="editor-button">Save</button>') var saveButton = $('<button class="editor-button">' + RED._("common.label.save") + '</button>')
.appendTo(formButtons) .appendTo(formButtons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -1032,13 +1043,13 @@ RED.projects.settings = (function() {
var updateForm = function() { var updateForm = function() {
if (activeProject.settings.credentialSecretInvalid) { if (activeProject.settings.credentialSecretInvalid) {
credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-warning"); credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-warning");
credentialStateLabel.find(".user-settings-credentials-state").text("Invalid encryption key"); credentialStateLabel.find(".user-settings-credentials-state").text(RED._("sidebar.project.projectSettings.invalidEncryptionKey"));
} else if (activeProject.settings.credentialsEncrypted) { } else if (activeProject.settings.credentialsEncrypted) {
credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-lock"); credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-lock");
credentialStateLabel.find(".user-settings-credentials-state").text("Encryption enabled"); credentialStateLabel.find(".user-settings-credentials-state").text(RED._("sidebar.project.projectSettings.encryptionEnabled"));
} else { } else {
credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-unlock"); credentialStateLabel.find(".user-settings-credentials-state-icon").removeClass().addClass("user-settings-credentials-state-icon fa fa-unlock");
credentialStateLabel.find(".user-settings-credentials-state").text("Encryption disabled"); credentialStateLabel.find(".user-settings-credentials-state").text(RED._("sidebar.project.projectSettings.encryptionDisabled"));
} }
credentialSecretResetButton.toggleClass('disabled',!activeProject.settings.credentialSecretInvalid && !activeProject.settings.credentialsEncrypted); credentialSecretResetButton.toggleClass('disabled',!activeProject.settings.credentialSecretInvalid && !activeProject.settings.credentialsEncrypted);
credentialSecretResetButton.prop('disabled',!activeProject.settings.credentialSecretInvalid && !activeProject.settings.credentialsEncrypted); credentialSecretResetButton.prop('disabled',!activeProject.settings.credentialSecretInvalid && !activeProject.settings.credentialsEncrypted);
@ -1050,7 +1061,7 @@ RED.projects.settings = (function() {
function createLocalBranchListSection(activeProject,pane) { function createLocalBranchListSection(activeProject,pane) {
var localBranchContainer = $('<div class="user-settings-section"></div>').appendTo(pane); var localBranchContainer = $('<div class="user-settings-section"></div>').appendTo(pane);
$('<h4></h4>').text("Branches").appendTo(localBranchContainer); $('<h4></h4>').text(RED._("sidebar.project.projectSettings.branches")).appendTo(localBranchContainer);
var row = $('<div class="user-settings-row projects-dialog-list"></div>').appendTo(localBranchContainer); var row = $('<div class="user-settings-row projects-dialog-list"></div>').appendTo(localBranchContainer);
@ -1063,7 +1074,7 @@ RED.projects.settings = (function() {
var container = $('<div class="projects-dialog-list-entry">').appendTo(row); var container = $('<div class="projects-dialog-list-entry">').appendTo(row);
if (entry.empty) { if (entry.empty) {
container.addClass('red-ui-search-empty'); container.addClass('red-ui-search-empty');
container.text("No branches"); container.text(RED._("sidebar.project.projectSettings.noBranches"));
return; return;
} }
if (entry.current) { if (entry.current) {
@ -1095,7 +1106,7 @@ RED.projects.settings = (function() {
.click(function(e) { .click(function(e) {
e.preventDefault(); e.preventDefault();
var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain'); var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain');
var notification = RED.notify("Are you sure you want to delete the local branch '"+entry.name+"'? This cannot be undone.", { var notification = RED.notify(RED._("sidebar.project.projectSettings.deleteConfirm", { name: entry.name }), {
type: "warning", type: "warning",
modal: true, modal: true,
fixed: true, fixed: true,
@ -1123,7 +1134,7 @@ RED.projects.settings = (function() {
}, },
400: { 400: {
'git_delete_branch_unmerged': function(error) { 'git_delete_branch_unmerged': function(error) {
notification = RED.notify("The local branch '"+entry.name+"' has unmerged changes that will be lost. Are you sure you want to delete it?", { notification = RED.notify(RED._("sidebar.project.projectSettings.unmergedConfirm", { name: entry.name }), {
type: "warning", type: "warning",
modal: true, modal: true,
fixed: true, fixed: true,
@ -1135,7 +1146,7 @@ RED.projects.settings = (function() {
notification.close(); notification.close();
} }
},{ },{
text: 'Delete unmerged branch', text: RED._("sidebar.project.projectSettings.deleteUnmergedBranch"),
click: function() { click: function() {
options.url += "?force=true"; options.url += "?force=true";
notification.close(); notification.close();
@ -1183,14 +1194,15 @@ RED.projects.settings = (function() {
} }
function createRemoteRepositorySection(activeProject,pane) { function createRemoteRepositorySection(activeProject,pane) {
$('<h3></h3>').text("Version Control").appendTo(pane); $('<h3></h3>').text(RED._("sidebar.project.projectSettings.versionControl")).appendTo(pane);
createLocalBranchListSection(activeProject,pane); createLocalBranchListSection(activeProject,pane);
var repoContainer = $('<div class="user-settings-section"></div>').appendTo(pane); var repoContainer = $('<div class="user-settings-section"></div>').appendTo(pane);
var title = $('<h4></h4>').text("Git remotes").appendTo(repoContainer); var title = $('<h4></h4>').text(RED._("sidebar.project.projectSettings.gitRemotes")).appendTo(repoContainer);
var editRepoButton = $('<button class="editor-button editor-button-small" style="float: right; margin-right: 10px;">add remote</button>') var editRepoButton = $('<button class="editor-button editor-button-small" style="float: right; margin-right: 10px;">'
+ RED._("sidebar.project.projectSettings.addRemote") + '</button>')
.appendTo(title) .appendTo(title)
.click(function(evt) { .click(function(evt) {
editRepoButton.attr('disabled',true); editRepoButton.attr('disabled',true);
@ -1221,7 +1233,7 @@ RED.projects.settings = (function() {
var container = $('<div class="projects-dialog-list-entry">').appendTo(row); var container = $('<div class="projects-dialog-list-entry">').appendTo(row);
if (entry.empty) { if (entry.empty) {
container.addClass('red-ui-search-empty'); container.addClass('red-ui-search-empty');
container.text("No remotes"); container.text(RED._("sidebar.project.projectSettings.noRemotes"));
return; return;
} else { } else {
$('<span class="entry-icon"><i class="fa fa-globe"></i></span>').appendTo(container); $('<span class="entry-icon"><i class="fa fa-globe"></i></span>').appendTo(container);
@ -1240,7 +1252,7 @@ RED.projects.settings = (function() {
.click(function(e) { .click(function(e) {
e.preventDefault(); e.preventDefault();
var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain'); var spinner = utils.addSpinnerOverlay(row).addClass('projects-dialog-spinner-contain');
var notification = RED.notify("Are you sure you want to delete the remote '"+entry.name+"'?", { var notification = RED.notify(RED._("sidebar.project.projectSettings.deleteRemoteConfrim", { name: entry.name }), {
type: "warning", type: "warning",
modal: true, modal: true,
fixed: true, fixed: true,
@ -1252,7 +1264,7 @@ RED.projects.settings = (function() {
notification.close(); notification.close();
} }
},{ },{
text: 'Delete remote', text: RED._("sidebar.project.projectSettings.deleteRemote"),
click: function() { click: function() {
notification.close(); notification.close();
@ -1315,10 +1327,10 @@ RED.projects.settings = (function() {
// var validRepo = /^(?:file|git|ssh|https?|[\d\w\.\-_]+@[\w\.]+):(?:\/\/)?[\w\.@:\/~_-]+(?:\.git)?(?:\/?|\#[\d\w\.\-_]+?)$/.test(remoteURLInput.val()); // var validRepo = /^(?:file|git|ssh|https?|[\d\w\.\-_]+@[\w\.]+):(?:\/\/)?[\w\.@:\/~_-]+(?:\.git)?(?:\/?|\#[\d\w\.\-_]+?)$/.test(remoteURLInput.val());
var validRepo = repo.length > 0 && !/\s/.test(repo); var validRepo = repo.length > 0 && !/\s/.test(repo);
if (/^https?:\/\/[^/]+@/i.test(repo)) { if (/^https?:\/\/[^/]+@/i.test(repo)) {
remoteURLLabel.text("Do not include the username/password in the url"); remoteURLLabel.text(RED._("sidebar.project.projectSettings.urlRule2"));
validRepo = false; validRepo = false;
} else { } else {
remoteURLLabel.text("https://, ssh:// or file://"); remoteURLLabel.text(RED._("sidebar.project.projectSettings.urlRule"));
} }
saveButton.attr('disabled',(!validName || !validRepo)) saveButton.attr('disabled',(!validName || !validRepo))
remoteNameInput.toggleClass('input-error',remoteNameInputChanged&&!validName); remoteNameInput.toggleClass('input-error',remoteNameInputChanged&&!validName);
@ -1332,22 +1344,24 @@ RED.projects.settings = (function() {
var remoteNameInputChanged = false; var remoteNameInputChanged = false;
var remoteURLInputChanged = false; var remoteURLInputChanged = false;
$('<div class="projects-dialog-list-dialog-header">').text('Add remote').appendTo(addRemoteDialog); $('<div class="projects-dialog-list-dialog-header">').text(RED._('sidebar.project.projectSettings.addRemote2')).appendTo(addRemoteDialog);
row = $('<div class="user-settings-row"></div>').appendTo(addRemoteDialog); row = $('<div class="user-settings-row"></div>').appendTo(addRemoteDialog);
$('<label for=""></label>').text('Remote name').appendTo(row); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.remoteName")).appendTo(row);
var remoteNameInput = $('<input type="text">').appendTo(row).on("change keyup paste",function() { var remoteNameInput = $('<input type="text">').appendTo(row).on("change keyup paste",function() {
remoteNameInputChanged = true; remoteNameInputChanged = true;
validateForm(); validateForm();
}); });
$('<label class="projects-edit-form-sublabel"><small>Must contain only A-Z 0-9 _ -</small></label>').appendTo(row).find("small"); $('<label class="projects-edit-form-sublabel"><small>'
+ RED._("sidebar.project.projectSettings.nameRule") + '</small></label>').appendTo(row).find("small");
row = $('<div class="user-settings-row"></div>').appendTo(addRemoteDialog); row = $('<div class="user-settings-row"></div>').appendTo(addRemoteDialog);
$('<label for=""></label>').text('URL').appendTo(row); $('<label for=""></label>').text(RED._("sidebar.project.projectSettings.url")).appendTo(row);
var remoteURLInput = $('<input type="text">').appendTo(row).on("change keyup paste",function() { var remoteURLInput = $('<input type="text">').appendTo(row).on("change keyup paste",function() {
remoteURLInputChanged = true; remoteURLInputChanged = true;
validateForm() validateForm()
}); });
var remoteURLLabel = $('<label class="projects-edit-form-sublabel"><small>https://, ssh:// or file://</small></label>').appendTo(row).find("small"); var remoteURLLabel = $('<label class="projects-edit-form-sublabel"><small>'
+ RED._("sidebar.project.projectSettings.urlRule") +'</small></label>').appendTo(row).find("small");
var hideEditForm = function() { var hideEditForm = function() {
editRepoButton.attr('disabled',false); editRepoButton.attr('disabled',false);
@ -1361,13 +1375,13 @@ RED.projects.settings = (function() {
} }
var formButtons = $('<span class="button-row" style="position: relative; float: right; margin: 10px;"></span>') var formButtons = $('<span class="button-row" style="position: relative; float: right; margin: 10px;"></span>')
.appendTo(addRemoteDialog); .appendTo(addRemoteDialog);
$('<button class="editor-button">Cancel</button>') $('<button class="editor-button">' + RED._("common.label.cancel") + '</button>')
.appendTo(formButtons) .appendTo(formButtons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
hideEditForm(); hideEditForm();
}); });
var saveButton = $('<button class="editor-button">Add remote</button>') var saveButton = $('<button class="editor-button">' + RED._("sidebar.project.projectSettings.addRemote2") + '</button>')
.appendTo(formButtons) .appendTo(formButtons)
.click(function(evt) { .click(function(evt) {
evt.preventDefault(); evt.preventDefault();
@ -1484,19 +1498,19 @@ RED.projects.settings = (function() {
utils = _utils; utils = _utils;
addPane({ addPane({
id:'main', id:'main',
title: "Project", // TODO: nls title: RED._("sidebar.project.name"),
get: createMainPane, get: createMainPane,
close: function() { } close: function() { }
}); });
addPane({ addPane({
id:'deps', id:'deps',
title: "Dependencies", // TODO: nls title: RED._("sidebar.project.dependencies"),
get: createDependenciesPane, get: createDependenciesPane,
close: function() { } close: function() { }
}); });
addPane({ addPane({
id:'settings', id:'settings',
title: "Settings", // TODO: nls title: RED._("sidebar.project.settings"),
get: createSettingsPane, get: createSettingsPane,
close: function() { close: function() {
if (popover) { if (popover) {

View File

@ -467,8 +467,47 @@
"description": "Description", "description": "Description",
"dependencies": "Dependencies", "dependencies": "Dependencies",
"settings": "Settings", "settings": "Settings",
"noSummaryAvailable": "No summary available",
"editDescription": "Edit project description", "editDescription": "Edit project description",
"editDependencies": "Edit project dependencies", "editDependencies": "Edit project dependencies",
"editReadme": "Edit README.md",
"projectSettings": {
"edit": "edit",
"none": "None",
"install": "install",
"removeFromProject": "remove from project",
"addToProject": "add to project",
"none": "None",
"files": "Files",
"flow": "Flow",
"credentials": "Credentials",
"invalidEncryptionKey": "Invalid encryption key",
"encryptionEnabled": "Encryption enabled",
"encryptionDisabled": "Encryption disabled",
"resetTheEncryptionKey": "Reset the encryption key:",
"setTheEncryptionKey": "Set the encryption key:",
"changeTheEncryptionKey": "Change the encryption key:",
"currentKey": "Current key",
"newKey": "New key",
"credentialsAlert": "This will delete all existing credentials",
"versionControl": "Version Control",
"branches": "Branches",
"noBranches": "No branches",
"deleteConfirm": "Are you sure you want to delete the local branch '__name__'? This cannot be undone.",
"unmergedConfirm": "The local branch '__name__' has unmerged changes that will be lost. Are you sure you want to delete it?",
"deleteUnmergedBranch": "Delete unmerged branch",
"gitRemotes": "Git remotes",
"addRemote": "add remote",
"addRemote2": "Add remote",
"remoteName": "Remote name",
"nameRule": "Must contain only A-Z 0-9 _ -",
"url": "URL",
"urlRule": "https://, ssh:// or file://",
"urlRule2": "Do not include the username/password in the URL",
"noRemotes": "No remotes",
"deleteRemoteConfrim": "Are you sure you want to delete the remote '__name__'?",
"deleteRemote": "Delete remote"
},
"userSettings": { "userSettings": {
"committerDetail": "Committer Details", "committerDetail": "Committer Details",
"committerTip": "Leave blank to use system default", "committerTip": "Leave blank to use system default",

View File

@ -459,8 +459,46 @@
"description": "詳細", "description": "詳細",
"dependencies": "依存関係", "dependencies": "依存関係",
"settings": "設定", "settings": "設定",
"noSummaryAvailable": "サマリが存在しません",
"editDescription": "プロジェクトの詳細を編集", "editDescription": "プロジェクトの詳細を編集",
"editDependencies": "プロジェクトの依存関係を編集", "editDependencies": "プロジェクトの依存関係を編集",
"editReadme": "README.mdを編集",
"projectSettings": {
"edit": "編集",
"none": "なし",
"install": "インストール",
"removeFromProject": "プロジェクトから削除",
"addToProject": "プロジェクトへ追加",
"files": "ファイル",
"flow": "フロー",
"credentials": "認証情報",
"invalidEncryptionKey": "不正な暗号化キー",
"encryptionEnabled": "暗号化が有効になっています",
"encryptionDisabled": "暗号化が無効になっています",
"setTheEncryptionKey": "暗号化キーを設定:",
"resetTheEncryptionKey": "暗号化キーを初期化:",
"changeTheEncryptionKey": "暗号化キーを変更:",
"currentKey": "現在のキー",
"newKey": "新規のキー",
"credentialsAlert": "既存の認証情報は全て削除されます",
"versionControl": "バージョン管理",
"branches": "ブランチ",
"noBranches": "ブランチなし",
"deleteConfirm": "本当にローカルブランチ'__name__'を削除しますか?削除すると元に戻すことはできません。",
"unmergedConfirm": "ローカルブランチ'__name__'にはマージされていない変更があります。この変更は削除されます。本当に削除しますか?",
"deleteUnmergedBranch": "マージされていないブランチを削除",
"gitRemotes": "Gitリモート",
"addRemote": "リモートを追加",
"addRemote2": "リモートを追加",
"remoteName": "リモート名",
"nameRule": "A-Z 0-9 _ - のみを含む",
"url": "URL",
"urlRule": "https://、ssh:// または file://",
"urlRule2": "URLにユーザ名、パスワードを含んではいけません",
"noRemotes": "リモートなし",
"deleteRemoteConfrim": "本当にリモート'__name__'を削除しますか?",
"deleteRemote": "リモートを削除"
},
"userSettings": { "userSettings": {
"committerDetail": "コミッター詳細", "committerDetail": "コミッター詳細",
"committerTip": "システムのデフォルトを使用する場合、空白のままにしてください", "committerTip": "システムのデフォルトを使用する場合、空白のままにしてください",