diff --git a/editor/js/ui/projects/tab-versionControl.js b/editor/js/ui/projects/tab-versionControl.js index 4560a56e5..ee8cb98f4 100644 --- a/editor/js/ui/projects/tab-versionControl.js +++ b/editor/js/ui/projects/tab-versionControl.js @@ -52,11 +52,11 @@ RED.sidebar.versionControl = (function() { 200: function(data) { var title; if (state === 'unstaged') { - title = 'Unstaged changes : '+entry.file + title = RED._("sidebar.project.versionControl.unstagedChanges")+' : '+entry.file } else if (state === 'staged') { - title = 'Staged changes : '+entry.file + title = RED._("sidebar.project.versionControl.stagedChanges")+' : '+entry.file } else { - title = 'Resolve conflicts : '+entry.file + title = RED._("sidebar.project.versionControl.resolveConflicts")+' : '+entry.file } var options = { diff: data.diff, @@ -65,18 +65,18 @@ RED.sidebar.versionControl = (function() { project: activeProject } if (state == 'unstaged') { - options.oldRevTitle = entry.indexStatus === " "?"HEAD":"Staged"; - options.newRevTitle = "Unstaged"; + options.oldRevTitle = entry.indexStatus === " "?RED._("sidebar.project.versionControl.head"):RED._("sidebar.project.versionControl.staged"); + options.newRevTitle = RED._("sidebar.project.versionControl.unstaged"); options.oldRev = entry.indexStatus === " "?"@":":0"; options.newRev = "_"; } else if (state === 'staged') { - options.oldRevTitle = "HEAD"; - options.newRevTitle = "Staged"; + options.oldRevTitle = RED._("sidebar.project.versionControl.head"); + options.newRevTitle = RED._("sidebar.project.versionControl.staged"); options.oldRev = "@"; options.newRev = ":0"; } else { - options.oldRevTitle = "Local"; - options.newRevTitle = "Remote"; + options.oldRevTitle = RED._("sidebar.project.versionControl.local"); + options.newRevTitle = RED._("sidebar.project.versionControl.remote"); options.commonRev = ":1"; options.oldRev = ":2"; options.newRev = ":3"; @@ -156,7 +156,7 @@ RED.sidebar.versionControl = (function() { evt.preventDefault(); var spinner = utils.addSpinnerOverlay(container).addClass('projects-dialog-spinner-contain'); - var notification = RED.notify("Are you sure you want to revert the changes to '"+entry.file+"'? This cannot be undone.", { + var notification = RED.notify(RED._("sidebar.project.versionControl.revert",{file:entry.file}), { type: "warning", modal: true, fixed: true, @@ -168,7 +168,7 @@ RED.sidebar.versionControl = (function() { notification.close(); } },{ - text: 'Revert changes', + text: RED._("sidebar.project.versionControl.revertChanges"), click: function() { notification.close(); var activeProject = RED.projects.getActiveProject(); @@ -281,6 +281,8 @@ RED.sidebar.versionControl = (function() { entry["update"+((state==='unstaged')?"Unstaged":"Staged")](entry, status); } var utils; + var emptyStagedItem; + var emptyMergedItem; function init(_utils) { utils = _utils; @@ -312,7 +314,7 @@ RED.sidebar.versionControl = (function() { }); localChanges = sections.add({ - title: "Local Changes", + title: RED._("sidebar.project.versionControl.localChanges"), collapsible: true }); localChanges.expand(); @@ -326,10 +328,12 @@ RED.sidebar.versionControl = (function() { refresh(true); }) + emptyStagedItem = { label: RED._("sidebar.project.versionControl.none") }; + emptyMergedItem = { label: RED._("sidebar.project.versionControl.conflictResolve") }; var unstagedContent = $('
').appendTo(localChanges.content); - var header = $(' ').appendTo(unstagedContent); - stageAllButton = $('') + var header = $(' ').appendTo(unstagedContent); + stageAllButton = $('') .appendTo(header) .click(function(evt) { evt.preventDefault(); @@ -359,9 +363,9 @@ RED.sidebar.versionControl = (function() { unmergedContent = $('').appendTo(localChanges.content); - header = $(' ').appendTo(unmergedContent); + header = $(' ').appendTo(unmergedContent); bg = $('').appendTo(header); - var abortMergeButton = $('') + var abortMergeButton = $('') .appendTo(bg) .click(function(evt) { evt.preventDefault(); @@ -399,7 +403,7 @@ RED.sidebar.versionControl = (function() { addItem: function(row,index,entry) { if (entry === emptyMergedItem) { entry.button = { - label: 'commit', + label: RED._("sidebar.project.versionControl.commit"), click: function(evt) { evt.preventDefault(); evt.stopPropagation(); @@ -423,7 +427,7 @@ RED.sidebar.versionControl = (function() { var stagedContent = $('').appendTo(localChanges.content); - header = $(' ').appendTo(stagedContent); + header = $(' ').appendTo(stagedContent); bg = $('').appendTo(header); var showCommitBox = function() { @@ -446,14 +450,14 @@ RED.sidebar.versionControl = (function() { abortMergeButton.attr("disabled",true); commitMessage.focus(); } - commitButton = $('') + commitButton = $('') .appendTo(bg) .click(function(evt) { evt.preventDefault(); evt.stopPropagation(); showCommitBox(); }); - unstageAllButton = $('') + unstageAllButton = $('') .appendTo(bg) .click(function(evt) { evt.preventDefault(); @@ -480,14 +484,14 @@ RED.sidebar.versionControl = (function() { commitBox = $('').hide().appendTo(localChanges.content); - var commitMessage = $('') + var commitMessage = $('') .appendTo(commitBox) .on("change keyup paste",function() { submitCommitButton.attr('disabled',$(this).val().trim()===""); }); var commitToolbar = $('