diff --git a/editor/js/ui/diff.js b/editor/js/ui/diff.js index 4a305eb6c..eb822df1e 100644 --- a/editor/js/ui/diff.js +++ b/editor/js/ui/diff.js @@ -1233,7 +1233,7 @@ RED.diff = (function() { // currentDiff = diff; var trayOptions = { - title: options.title||"Review Changes", //TODO: nls + title: options.title||RED._("diff.reviewChanges"), width: Infinity, overlay: true, buttons: [ @@ -1416,7 +1416,7 @@ RED.diff = (function() { function showTextDiff(textA,textB) { var trayOptions = { - title: "Compare Changes", //TODO: nls + title: RED._("diff.compareChanges"), width: Infinity, overlay: true, buttons: [ @@ -1747,7 +1747,7 @@ RED.diff = (function() { try { commonFlow = JSON.parse(commonVersion.content||"[]"); } catch(err) { - console.log("Common Version doesn't contain valid JSON:",commonVersionUrl); + console.log(RED._("diff.commonVersionError"),commonVersionUrl); console.log(err); return; } @@ -1755,7 +1755,7 @@ RED.diff = (function() { try { oldFlow = JSON.parse(oldVersion.content||"[]"); } catch(err) { - console.log("Old Version doesn't contain valid JSON:",oldVersionUrl); + console.log(RED._("diff.oldVersionError"),oldVersionUrl); console.log(err); return; } @@ -1765,7 +1765,7 @@ RED.diff = (function() { try { newFlow = JSON.parse(newVersion.content||"[]"); } catch(err) { - console.log("New Version doesn't contain valid JSON:",newFlow); + console.log(RED._("diff.newVersionError"),newFlow); console.log(err); return; } @@ -1797,11 +1797,11 @@ RED.diff = (function() { if (isBinary) { var diffBinaryRow = $('').appendTo(codeBody); var binaryContent = $('').appendTo(diffBinaryRow); - $('').text("Cannot show binary file contents").appendTo(binaryContent); + $('').text(RED._("diff.noBinaryFileShowed")).appendTo(binaryContent); } else { if (commitOptions.unmerged) { - conflictHeader = $(''+resolvedConflicts+' of '+unresolvedConflicts+' conflicts resolved').appendTo(content); + conflictHeader = $(''+RED._("diff.conflictHeader",{resolved:resolvedConflicts, unresolved:unresolvedConflicts})+'').appendTo(content); } hunks.forEach(function(hunk) { var diffRow = $('').appendTo(codeBody); @@ -1914,7 +1914,7 @@ RED.diff = (function() { diffRow.remove(); addedRows.find(".linetext").addClass('added'); conflictHeader.empty(); - $(''+resolvedConflicts+' of '+unresolvedConflicts+' conflicts resolved').appendTo(conflictHeader); + $(''+RED._("diff.conflictHeader",{resolved:resolvedConflicts, unresolved:unresolvedConflicts})+'').appendTo(conflictHeader); conflictResolutions[file.file] = conflictResolutions[file.file] || {}; conflictResolutions[file.file][hunk.localChangeStart] = { @@ -1946,7 +1946,7 @@ RED.diff = (function() { function showCommitDiff(options) { var commit = parseCommitDiff(options.commit); var trayOptions = { - title: "View Commit Changes", //TODO: nls + title: RED._("diff.viewCommitDiff"), width: Infinity, overlay: true, buttons: [ @@ -2008,7 +2008,7 @@ RED.diff = (function() { } var trayOptions = { - title: title||"Compare Changes", //TODO: nls + title: title|| RED._("diff.compareChanges"), width: Infinity, overlay: true, buttons: [ @@ -2041,7 +2041,7 @@ RED.diff = (function() { trayOptions.buttons.push( { id: "node-diff-view-resolve-diff", - text: "Save conflict resolution", + text: RED._("diff.saveConflict"), class: "primary disabled", click: function() { if (!$("#node-diff-view-resolve-diff").hasClass('disabled')) { diff --git a/red/api/editor/locales/en-US/editor.json b/red/api/editor/locales/en-US/editor.json index 06878ff69..b2285f566 100644 --- a/red/api/editor/locales/en-US/editor.json +++ b/red/api/editor/locales/en-US/editor.json @@ -219,8 +219,16 @@ "nodeCount": "__count__ node", "nodeCount_plural": "__count__ nodes", "local":"Local changes", - "remote":"Remote changes" - + "remote":"Remote changes", + "reviewChanges": "Review Changes", + "noBinaryFileShowed": "Cannot show binary file contents", + "viewCommitDiff": "View Commit Changes", + "compareChanges": "Compare Changes", + "saveConflict": "Save conflict resolution", + "conflictHeader": "__resolved__ of __unresolved__ conflicts resolved", + "commonVersionError": "Common Version doesn't contain valid JSON:", + "oldVersionError": "Old Version doesn't contain valid JSON:", + "newVersionError": "New Version doesn't contain valid JSON:" }, "subflow": { "editSubflow": "Edit flow template: __name__", diff --git a/red/api/editor/locales/ja/editor.json b/red/api/editor/locales/ja/editor.json index eb563a68f..d24dcc711 100644 --- a/red/api/editor/locales/ja/editor.json +++ b/red/api/editor/locales/ja/editor.json @@ -215,7 +215,16 @@ "nodeCount": "__count__ 個のノード", "nodeCount_plural": "__count__ 個のノード", "local": "ローカルの変更", - "remote": "リモートの変更" + "remote": "リモートの変更", + "reviewChanges": "変更を表示", + "noBinaryFileShowed": "バイナリファイルの中身は表示することができません", + "viewCommitDiff": "コミットの内容を表示", + "compareChanges": "変更を比較", + "saveConflict": "解決して保存", + "conflictHeader": "__unresolved__ 個中 __resolved__ 個のコンフリクトを解決", + "commonVersionError": "共通バージョンは正しいJSON形式ではありません:", + "oldVersionError": "古いバージョンは正しいJSON形式ではありません:", + "newVersionError": "新しいバージョンは正しいJSON形式ではありません:" }, "subflow": { "editSubflow": "フローのテンプレートを編集: __name__",