diff --git a/editor/js/ui/projects/projects.js b/editor/js/ui/projects/projects.js index d7c2787d8..71a19d661 100644 --- a/editor/js/ui/projects/projects.js +++ b/editor/js/ui/projects/projects.js @@ -22,18 +22,18 @@ RED.projects = (function() { function reportUnexpectedError(error) { var notification; if (error.error === 'git_missing_user') { - notification = RED.notify("
You Git client is not configured with a username/email.
",{ + notification = RED.notify(""+RED._("projects.errors.no-username-email")+"
",{ fixed: true, type:'error', buttons: [ { - text: "Cancel", + text: RED._("common.label.cancel"), click: function() { notification.close(); } }, { - text: "Configure Git client", + text: RED._("projects.config-git"), click: function() { RED.userSettings.show('gitconfig'); notification.close(); @@ -43,13 +43,13 @@ RED.projects = (function() { }) } else { console.log(error); - notification = RED.notify("An unexpected error occurred:
"+error.message+"
code: "+error.error+"",{ + notification = RED.notify(""+RED._("projects.errors.unexpected")+":
"+error.message+"
"+RED._("projects.errors.code")+": "+error.error+"",{ fixed: true, modal: true, type: 'error', buttons: [ { - text: "Close", + text: RED._("common.label.close"), click: function() { notification.close(); } @@ -75,14 +75,14 @@ RED.projects = (function() { migrateProjectHeader.appendTo(container); var body = $('').appendTo(container); - $('').text("Hello! We have introduced 'projects' to Node-RED.").appendTo(body); - $('
').text("This is a new way for you to manage your flow files and includes version control of your flows.").appendTo(body); - $('
').text("To get started you can create your first project or clone an existing project from a git repository.").appendTo(body); - $('
').text("If you are not sure, you can skip this for now. You will still be able to create your first project from the 'Projects' menu at any time.").appendTo(body); + $('
').text(RED._("projects.welcome.hello")).appendTo(body); + $('
').text(RED._("projects.welcome.desc0")).appendTo(body); + $('
').text(RED._("projects.welcome.desc1")).appendTo(body); + $('
').text(RED._("projects.welcome.desc2")).appendTo(body); var row = $('
').appendTo(body); - var createAsEmpty = $('').appendTo(row); - var createAsClone = $('').appendTo(row); + var createAsEmpty = $('').appendTo(row); + var createAsClone = $('').appendTo(row); createAsEmpty.click(function(e) { e.preventDefault(); @@ -105,7 +105,7 @@ RED.projects = (function() { buttons: [ { // id: "clipboard-dialog-cancel", - text: "Not right now", + text: RED._("projects.welcome.not-right-now"), click: function() { createProjectOptions = {}; $( this ).dialog( "close" ); @@ -139,23 +139,23 @@ RED.projects = (function() { migrateProjectHeader.appendTo(container); var body = $('').appendTo(container); - $('').text("Setup your version control client").appendTo(body); - $('
').text("Node-RED uses the open source tool Git for version control. It tracks changes to your project files and lets you push them to remote repositories.").appendTo(body); - $('
').text("When you commit a set of changes, Git records who made the changes with a username and email address. The Username can be anything you want - it does not need to be your real name.").appendTo(body); + $('
').text(RED._("projects.git-config.setup")).appendTo(body); + $('
').text(RED._("projects.git-config.desc0")).appendTo(body); + $('
').text(RED._("projects.git-config.desc1")).appendTo(body); if (isGlobalConfig) { - $('
').text("Your Git client is already configured with the details below.").appendTo(body); + $('
').text(RED._("projects.git-config.desc2")).appendTo(body); } - $('
').text("You can change these settings later under the 'Git config' tab of the settings dialog.").appendTo(body); + $('
').text(RED._("projects.git-config.desc3")).appendTo(body); var row = $('
').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); gitUsernameInput = $('').val((existingGitSettings&&existingGitSettings.name)||"").appendTo(row); // $('').text("This does not need to be your real name").appendTo(row); gitUsernameInput.on("change keyup paste",validateForm); row = $('').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); gitEmailInput = $('').val((existingGitSettings&&existingGitSettings.email)||"").appendTo(row); gitEmailInput.on("change keyup paste",validateForm); // $('').text("Something something email").appendTo(row); @@ -168,14 +168,14 @@ RED.projects = (function() { buttons: [ { // id: "clipboard-dialog-cancel", - text: "Back", + text: RED._("common.label.back"), click: function() { show('welcome'); } }, { id: "projects-dialog-git-config", - text: "Next", // TODO: nls + text: RED._("common.label.next"), class: "primary", click: function() { var currentGitSettings = RED.settings.get('git') || {}; @@ -216,10 +216,10 @@ RED.projects = (function() { migrateProjectHeader.appendTo(container); var body = $('').appendTo(container); - $('').text("Create your project").appendTo(body); - $('
').text("A project is maintained as a Git repository. It makes it much easier to share your flows with others and to collaborate on them.").appendTo(body); - $('
').text("You can create multiple projects and quickly switch between them from the editor.").appendTo(body); - $('
').text("To begin, your project needs a name and an optional description.").appendTo(body); + $('
').text(RED._("projects.project-details.create")).appendTo(body); + $('
').text(RED._("projects.project-details.desc0")).appendTo(body); + $('
').text(RED._("projects.project-details.desc1")).appendTo(body); + $('
').text(RED._("projects.project-details.desc2")).appendTo(body); var validateForm = function() { var projectName = projectNameInput.val(); @@ -236,14 +236,14 @@ RED.projects = (function() { projectNameValid = false; valid = false; if (projectList[projectName]) { - projectNameSublabel.text("Project already exists"); + projectNameSublabel.text(RED._("projects.project-details.already-exists")); } else { - projectNameSublabel.text("Must contain only A-Z 0-9 _ -"); + projectNameSublabel.text(RED._("projects.project-details.must-contain")); } } else { projectNameInput.removeClass("input-error"); $('').appendTo(projectNameStatus); - projectNameSublabel.text("Must contain only A-Z 0-9 _ -"); + projectNameSublabel.text(RED._("projects.project-details.must-contain")); projectNameValid = true; } projectNameLastChecked = projectName; @@ -253,7 +253,7 @@ RED.projects = (function() { } var row = $('
').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); var subrow = $('').appendTo(row); projectNameInput = $('').val(createProjectOptions.name||"").appendTo(subrow); @@ -283,13 +283,13 @@ RED.projects = (function() { checkProjectName = null; },300) }); - projectNameSublabel = $('').appendTo(row).find("small"); + projectNameSublabel = $('').appendTo(row).find("small"); // Empty Project row = $('').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); projectSummaryInput = $('').val(createProjectOptions.summary||"").appendTo(row); - $('').appendTo(row); + $('').appendTo(row); setTimeout(function() { projectNameInput.focus(); @@ -300,7 +300,7 @@ RED.projects = (function() { buttons: function(options) { return [ { - text: "Back", + text: RED._("common.label.back"), click: function() { show('git-config'); } @@ -308,7 +308,7 @@ RED.projects = (function() { { id: "projects-dialog-create-name", disabled: true, - text: "Next", // TODO: nls + text: RED._("common.label.next"), class: "primary disabled", click: function() { createProjectOptions.name = projectNameInput.val(); @@ -344,8 +344,8 @@ RED.projects = (function() { var container = $(''); migrateProjectHeader.appendTo(container); var body = $('').appendTo(container); - $('').text("Clone a project").appendTo(body); - $('
').text("If you already have a git repository containing a project, you can clone it to get started.").appendTo(body); + $('
').text(RED._("projects.clone-project.clone")).appendTo(body); + $('
').text(RED._("projects.clone-project.desc0")).appendTo(body); var projectList = null; var pendingFormValidation = false; @@ -376,14 +376,14 @@ RED.projects = (function() { projectNameValid = false; valid = false; if (projectList[projectName]) { - projectNameSublabel.text("Project already exists"); + projectNameSublabel.text(RED._("projects.clone-project.already-exists")); } else { - projectNameSublabel.text("Must contain only A-Z 0-9 _ -"); + projectNameSublabel.text(RED._("projects.clone-project.must-contain")); } } else { projectNameInput.removeClass("input-error"); $('').appendTo(projectNameStatus); - projectNameSublabel.text("Must contain only A-Z 0-9 _ -"); + projectNameSublabel.text(RED._("projects.clone-project.must-contain")); projectNameValid = true; } projectNameLastChecked = projectName; @@ -395,7 +395,7 @@ RED.projects = (function() { // var validRepo = /^(?:file|git|ssh|https?|[\d\w\.\-_]+@[\w\.]+):(?:\/\/)?[\w\.@:\/~_-]+(?:\/?|\#[\d\w\.\-_]+?)$/.test(repo); var validRepo = repo.length > 0 && !/\s/.test(repo); if (/^https?:\/\/[^/]+@/i.test(repo)) { - $("#projects-dialog-screen-create-project-repo-label small").text("Do not include the username/password in the url"); + $("#projects-dialog-screen-create-project-repo-label small").text(RED._("projects.clone-project.no-info-in-url")); validRepo = false; } if (!validRepo) { @@ -426,7 +426,7 @@ RED.projects = (function() { var row; row = $('
').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); var subrow = $('').appendTo(row); projectNameInput = $('').appendTo(subrow); @@ -456,19 +456,19 @@ RED.projects = (function() { checkProjectName = null; },300) }); - projectNameSublabel = $('').appendTo(row).find("small"); + projectNameSublabel = $('').appendTo(row).find("small"); row = $('').appendTo(body); - $('').appendTo(row); + $('').appendTo(row); projectRepoInput = $('').appendTo(row); - $('').appendTo(row); + $('').appendTo(row); var projectRepoChanged = false; var lastProjectRepo = ""; projectRepoInput.on("change keyup paste",function() { projectRepoChanged = true; var repo = $(this).val(); if (lastProjectRepo !== repo) { - $("#projects-dialog-screen-create-project-repo-label small").text("https://, ssh:// or file://"); + $("#projects-dialog-screen-create-project-repo-label small").text(RED._("projects.clone-project.protocols")); } lastProjectRepo = repo; @@ -486,24 +486,24 @@ RED.projects = (function() { var cloneAuthRows = $('').appendTo(body); row = $('').hide().appendTo(cloneAuthRows); - $('