From 295b340f991a8d60601ab1f8763fce627207286c Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Fri, 29 Mar 2024 14:52:41 +0100 Subject: [PATCH 01/11] feat: make translation system key based --- src/layer/gutter.js | 14 +++++++------- src/lib/app_config.js | 16 +++++++++++----- src/lib/default_english_messages.js | 7 +++++++ 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 src/lib/default_english_messages.js diff --git a/src/layer/gutter.js b/src/layer/gutter.js index 4b87b803bf1..65408a9cad8 100644 --- a/src/layer/gutter.js +++ b/src/layer/gutter.js @@ -409,21 +409,21 @@ class Gutter{ // getFoldWidgetRange is optional to be implemented by fold modes, if not available we fall-back. if (foldRange) - foldWidget.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-range.aria-label", "Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1])); else { if (fold) - foldWidget.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-end.aria-label", "Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1])); else - foldWidget.setAttribute("aria-label", nls("Toggle code folding, row $0", [row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-start.aria-label", "Toggle code folding, row $0", [row + 1])); } if (isClosedFold) { foldWidget.setAttribute("aria-expanded", "false"); - foldWidget.setAttribute("title", nls("Unfold code")); + foldWidget.setAttribute("title", nls("gutter.code-folding.fold-end.title", "Unfold code")); } else { foldWidget.setAttribute("aria-expanded", "true"); - foldWidget.setAttribute("title", nls("Fold code")); + foldWidget.setAttribute("title", nls("gutter.code-folding.fold-start.title", "Fold code")); } } else { if (foldWidget) { @@ -442,7 +442,7 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); - annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText])); + annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } @@ -458,7 +458,7 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); - annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText])); + annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } diff --git a/src/lib/app_config.js b/src/lib/app_config.js index 3ca8dfb5725..8cdd4bc2f47 100644 --- a/src/lib/app_config.js +++ b/src/lib/app_config.js @@ -2,6 +2,7 @@ var oop = require("./oop"); var EventEmitter = require("./event_emitter").EventEmitter; const reportError = require("./report_error").reportError; +const defaultEnglishMessages = require("./default_english_messages").defaultEnglishMessages; var optionsProvider = { setOptions: function(optList) { @@ -62,6 +63,7 @@ var messages; class AppConfig { constructor() { this.$defaultOptions = {}; + messages = defaultEnglishMessages; } /** @@ -142,14 +144,18 @@ class AppConfig { } /** - * @param {string} string + * @param {string} key + * @param {string} defaultString * @param {{ [x: string]: any; }} [params] */ - nls(string, params) { - if (messages && !messages[string]) { - warn("No message found for '" + string + "' in the provided messages, falling back to default English message."); + nls(key, defaultString, params) { + if (messages && !messages[key]) { + warn("No message found for the key '" + key + "' in the provided messages, trying to find a translation for the default string '" + defaultString + "'."); + } else if (messages && !messages[defaultString]) { + warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); } - var translated = messages && messages[string] || string; + + var translated = messages && messages[key] || messages && messages[defaultString] || defaultString; if (params) { translated = translated.replace(/\$(\$|[\d]+)/g, function(_, name) { if (name == "$") return "$"; diff --git a/src/lib/default_english_messages.js b/src/lib/default_english_messages.js new file mode 100644 index 00000000000..f595bfcbb50 --- /dev/null +++ b/src/lib/default_english_messages.js @@ -0,0 +1,7 @@ +var defaultEnglishMessages = { + "gutter.annotation.aria-label.ace_error": "Error, Read annotations row $0", + "gutter.annotation.aria-label.ace_warning": "Warning, Read annotations row $0", + "gutter.annotation.aria-label.ace_info": "Info, Read annotations row $0" +} + +exports.defaultEnglishMessages = defaultEnglishMessages; \ No newline at end of file From c1c69e7a5531f376e02e217b6da20c9ded8f899b Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Fri, 29 Mar 2024 14:52:41 +0100 Subject: [PATCH 02/11] feat: make translation system key based --- Makefile.dryice.js | 22 +++++++++------ src/autocomplete.js | 2 +- src/autocomplete/popup.js | 6 ++-- src/config_test.js | 15 ++++++---- src/editor.js | 8 +++--- src/ext/error_marker.js | 2 +- src/ext/prompt.js | 6 ++-- src/ext/searchbox.js | 22 +++++++-------- src/keyboard/textinput.js | 4 +-- src/layer/gutter.js | 32 +++++++++++++++++++++ src/layer/text.js | 2 +- src/lib/app_config.js | 17 ++++++------ src/lib/default_english_messages.js | 43 +++++++++++++++++++++++++++++ src/mouse/default_gutter_handler.js | 15 ++++++++-- translations/am.json | 42 +++++++++++++++++++++++++++- translations/es.json | 42 +++++++++++++++++++++++++++- translations/ru.json | 42 +++++++++++++++++++++++++++- 17 files changed, 268 insertions(+), 54 deletions(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 734423fc83f..7ac4d0cb023 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -654,16 +654,23 @@ function extractCss(callback) { } function extractNls() { - var allMessages = {}; + var defaultData = require(__dirname + "/src/lib/default_english_messages").defaultEnglishMessages; + searchFiles(__dirname + "/src", function(path) { if (/_test/.test(path)) return; var text = fs.readFileSync(path, "utf8"); - var matches = text.match(/nls\s*\(\s*("([^"\\]|\\.)+"|'([^'\\]|\\.)+')/g); + var matches = text.match(/nls\s*\(\s*("([^"\\]|\\.)+"|'([^'\\]|\\.)+'),\s*("([^"\\]|\\.)+"|'([^'\\]|\\.)+')/g); matches && matches.forEach(function(m) { - var eng = m.replace(/^nls\s*\(\s*["']|["']$/g, ""); - allMessages[eng] = ""; + var match = m.match(/("([^"\\]|\\.)+"|'([^'\\]|\\.)+)/g); + var key = match[0].replace(/["']|["']$/g, ""); + var defaultString = match[1].replace(/["']|["']$/g, ""); + + // If the key not yet in the default file, add it: + if (defaultData[key] !== undefined) return; + defaultData[key] = defaultString; }); }); + fs.writeFileSync(__dirname + "/src/lib/default_english_messages.js", "var defaultEnglishMessages = " + JSON.stringify(defaultData, null, 4) + "\n\nexports.defaultEnglishMessages = defaultEnglishMessages;", "utf8"); fs.readdirSync(__dirname + "/translations").forEach(function(x) { if (!/\.json$/.test(x)) return; @@ -671,11 +678,10 @@ function extractNls() { var existingStr = fs.readFileSync(path, "utf8"); var existing = JSON.parse(existingStr); - var newData = {$id: existing.$id}; - for (var i in allMessages) { - newData[i] = existing[i] || ""; + for (var i in defaultData) { + existing[i] = existing[i] || ""; } - fs.writeFileSync(path, JSON.stringify(newData, null, 4), "utf8"); + fs.writeFileSync(path, JSON.stringify(existing, null, 4), "utf8"); console.log("Saved " + x); }); } diff --git a/src/autocomplete.js b/src/autocomplete.js index 1ee896d390c..99e2ebf806b 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -121,7 +121,7 @@ class Autocomplete { } static get completionsForLoading() { return [{ - caption: config.nls("Loading..."), + caption: config.nls("autocomplete.loading", "Loading..."), value: "" }]; } diff --git a/src/autocomplete/popup.js b/src/autocomplete/popup.js index 1211922e57d..99afd326ac9 100644 --- a/src/autocomplete/popup.js +++ b/src/autocomplete/popup.js @@ -62,8 +62,8 @@ class AcePopup { // Set aria attributes for the popup popup.renderer.$textLayer.element.setAttribute("role", popupAriaRole); - popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("Autocomplete suggestions")); - popup.renderer.$textLayer.element.setAttribute("aria-label", nls("Autocomplete suggestions")); + popup.renderer.$textLayer.element.setAttribute("aria-roledescription", nls("autocomplete.popup.aria-roledescription", "Autocomplete suggestions")); + popup.renderer.$textLayer.element.setAttribute("aria-label", nls("autocomplete.popup.aria-label", "Autocomplete suggestions")); popup.renderer.textarea.setAttribute("aria-hidden", "true"); popup.setOption("displayIndentGuides", false); @@ -152,7 +152,7 @@ class AcePopup { t.element.setAttribute("aria-activedescendant", ariaId); el.setAttribute("aria-activedescendant", ariaId); selected.setAttribute("role", optionAriaRole); - selected.setAttribute("aria-roledescription", nls("item")); + selected.setAttribute("aria-roledescription", nls("autocomplete.popup.item.aria-roledescription", "item")); selected.setAttribute("aria-label", popup.getData(row).caption || popup.getData(row).value); selected.setAttribute("aria-setsize", popup.data.length); selected.setAttribute("aria-posinset", row + 1); diff --git a/src/config_test.js b/src/config_test.js index 34e89f7b0a1..5305705d88b 100644 --- a/src/config_test.js +++ b/src/config_test.js @@ -52,13 +52,16 @@ module.exports = { "test: nls": function() { var nls = config.nls; config.setMessages({ - foo: "hello world of $1" + foo: "hello world of $1", + test_key: "hello world for test key" }); - assert.equal(nls("bar $1"), "bar $1"); - assert.equal(nls("bar"), "bar"); - assert.equal(nls("foo"), "hello world of $1"); - assert.equal(nls("foo", {1: "goo"}), "hello world of goo"); - assert.equal(nls("$0B is $1$$", [0.11, 22]), "0.11B is 22$"); + assert.equal(nls("untranslated_key","bar $1"), "bar $1"); + assert.equal(nls("untranslated_key", "bar"), "bar"); + assert.equal(nls("untranslated_key_but_translated_default_string", "foo"), "hello world of $1"); + assert.equal(nls("untranslated_key_but_translated_default_string", "foo", {1: "goo"}), "hello world of goo"); + assert.equal(nls("untranslated_key", "$0B is $1$$", [0.11, 22]), "0.11B is 22$"); + assert.equal(nls("untranslated_key_but_translated_default_string", "foo", {1: "goo"}), "hello world of goo"); + assert.equal(nls("test_key", "this text should not appear"), "hello world for test key"); }, "test: define options" : function() { var o = {}; diff --git a/src/editor.js b/src/editor.js index 5501f622526..9ab9e7b076a 100644 --- a/src/editor.js +++ b/src/editor.js @@ -2944,10 +2944,10 @@ config.defineOptions(Editor.prototype, "editor", { this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0); this.renderer.scroller.setAttribute("tabindex", 0); this.renderer.scroller.setAttribute("role", "group"); - this.renderer.scroller.setAttribute("aria-roledescription", nls("editor")); + this.renderer.scroller.setAttribute("aria-roledescription", nls("editor.scroller.aria-roledescription", "editor")); this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName); this.renderer.scroller.setAttribute("aria-label", - nls("Editor content, press Enter to start editing, press Escape to exit") + nls("editor.scroller.aria-label", "Editor content, press Enter to start editing, press Escape to exit") ); this.renderer.scroller.addEventListener("keyup", focusOnEnterKeyup.bind(this)); @@ -2956,9 +2956,9 @@ config.defineOptions(Editor.prototype, "editor", { this.renderer.$gutter.setAttribute("tabindex", 0); this.renderer.$gutter.setAttribute("aria-hidden", false); this.renderer.$gutter.setAttribute("role", "group"); - this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor")); + this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-role-description", "editor")); this.renderer.$gutter.setAttribute("aria-label", - nls("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit") + nls("editor.gutter.aria-label", "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit") ); this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName); diff --git a/src/ext/error_marker.js b/src/ext/error_marker.js index 0fb5705bfe3..cd5052ddc04 100644 --- a/src/ext/error_marker.js +++ b/src/ext/error_marker.js @@ -98,7 +98,7 @@ exports.showErrorMarker = function(editor, dir) { return; } else { gutterAnno = { - text: [nls("Looks good!")], + text: [nls("error-marker.good-state", "Looks good!")], className: "ace_ok" }; } diff --git a/src/ext/prompt.js b/src/ext/prompt.js index 54ba7d8bfae..620fb8c9e69 100644 --- a/src/ext/prompt.js +++ b/src/ext/prompt.js @@ -441,13 +441,13 @@ prompt.commands = function(editor, callback) { otherCommands = getFilteredCompletions(otherCommands, prefix); if (recentlyUsedCommands.length && otherCommands.length) { - recentlyUsedCommands[0].message = nls("Recently used"); - otherCommands[0].message = nls("Other commands"); + recentlyUsedCommands[0].message = nls("prompt.recently-used", "Recently used"); + otherCommands[0].message = nls("prompt.other-commands", "Other commands"); } var completions = recentlyUsedCommands.concat(otherCommands); return completions.length > 0 ? completions : [{ - value: nls("No matching commands"), + value: nls("prompt.no-matching-commands", "No matching commands"), error: 1 }]; } diff --git a/src/ext/searchbox.js b/src/ext/searchbox.js index cfb1c08e3fa..b4131c3d45e 100644 --- a/src/ext/searchbox.js +++ b/src/ext/searchbox.js @@ -27,24 +27,24 @@ class SearchBox { dom.buildDom(["div", {class:"ace_search right"}, ["span", {action: "hide", class: "ace_searchbtn_close"}], ["div", {class: "ace_search_form"}, - ["input", {class: "ace_search_field", placeholder: nls("Search for"), spellcheck: "false"}], + ["input", {class: "ace_search_field", placeholder: nls("search-box.search-for", "Search for"), spellcheck: "false"}], ["span", {action: "findPrev", class: "ace_searchbtn prev"}, "\u200b"], ["span", {action: "findNext", class: "ace_searchbtn next"}, "\u200b"], - ["span", {action: "findAll", class: "ace_searchbtn", title: "Alt-Enter"}, nls("All")] + ["span", {action: "findAll", class: "ace_searchbtn", title: "Alt-Enter"}, nls("search-box.find-all", "All")] ], ["div", {class: "ace_replace_form"}, - ["input", {class: "ace_search_field", placeholder: nls("Replace with"), spellcheck: "false"}], - ["span", {action: "replaceAndFindNext", class: "ace_searchbtn"}, nls("Replace")], - ["span", {action: "replaceAll", class: "ace_searchbtn"}, nls("All")] + ["input", {class: "ace_search_field", placeholder: nls("search-box.replace-with", "Replace with"), spellcheck: "false"}], + ["span", {action: "replaceAndFindNext", class: "ace_searchbtn"}, nls("search-box.replace-next", "Replace")], + ["span", {action: "replaceAll", class: "ace_searchbtn"}, nls("search-box.replace-all", "All")] ], ["div", {class: "ace_search_options"}, - ["span", {action: "toggleReplace", class: "ace_button", title: nls("Toggle Replace mode"), + ["span", {action: "toggleReplace", class: "ace_button", title: nls("search-box.toggle-replace", "Toggle Replace mode"), style: "float:left;margin-top:-2px;padding:0 5px;"}, "+"], ["span", {class: "ace_search_counter"}], - ["span", {action: "toggleRegexpMode", class: "ace_button", title: nls("RegExp Search")}, ".*"], - ["span", {action: "toggleCaseSensitive", class: "ace_button", title: nls("CaseSensitive Search")}, "Aa"], - ["span", {action: "toggleWholeWords", class: "ace_button", title: nls("Whole Word Search")}, "\\b"], - ["span", {action: "searchInSelection", class: "ace_button", title: nls("Search In Selection")}, "S"] + ["span", {action: "toggleRegexpMode", class: "ace_button", title: nls("search-box.toggle-regexp", "RegExp Search")}, ".*"], + ["span", {action: "toggleCaseSensitive", class: "ace_button", title: nls("search-box.toggle-case", "CaseSensitive Search")}, "Aa"], + ["span", {action: "toggleWholeWords", class: "ace_button", title: nls("search-box.toggle-whole-word", "Whole Word Search")}, "\\b"], + ["span", {action: "searchInSelection", class: "ace_button", title: nls("search-box.toggle-in-selection", "Search In Selection")}, "S"] ] ], div); /**@type {any}*/ @@ -234,7 +234,7 @@ class SearchBox { } } } - this.searchCounter.textContent = nls("$0 of $1", [before , (all > MAX_COUNT ? MAX_COUNT + "+" : all)]); + this.searchCounter.textContent = nls("search-box.search-counter", "$0 of $1", [before , (all > MAX_COUNT ? MAX_COUNT + "+" : all)]); } findNext() { this.find(true, false); diff --git a/src/keyboard/textinput.js b/src/keyboard/textinput.js index cb43af223ef..7a316c21ab5 100644 --- a/src/keyboard/textinput.js +++ b/src/keyboard/textinput.js @@ -87,10 +87,10 @@ TextInput= function(parentNode, host) { text.setAttribute("role", options.role); } if (options.setLabel) { - text.setAttribute("aria-roledescription", nls("editor")); + text.setAttribute("aria-roledescription", nls("text-input.aria-roledescription", "editor")); if(host.session) { var row = host.session.selection.cursor.row; - text.setAttribute("aria-label", nls("Cursor at row $0", [row + 1])); + text.setAttribute("aria-label", nls("text-input.aria-label", "Cursor at row $0", [row + 1])); } } }; diff --git a/src/layer/gutter.js b/src/layer/gutter.js index 65408a9cad8..ad12b9e66ee 100644 --- a/src/layer/gutter.js +++ b/src/layer/gutter.js @@ -442,7 +442,21 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); +<<<<<<< HEAD annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); +======= + var ariaLabel; + switch(foldAnnotationClass) { + case " ace_error_fold": + ariaLabel = nls("gutter.annotation.aria-label.error", "Read annotations row $0", [rowText]); + break; + + case " ace_warning_fold": + ariaLabel = nls("gutter.annotation.aria-label.warning", "Read annotations row $0", [rowText]); + break; + } + annotationNode.setAttribute("aria-label", ariaLabel); +>>>>>>> 45213c400 (feat: make translation system key based) annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } @@ -458,7 +472,25 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); +<<<<<<< HEAD annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); +======= + var ariaLabel; + switch(this.$annotations[row].className) { + case " ace_error": + ariaLabel = nls("gutter.annotation.aria-label.error", "Read annotations row $0", [rowText]); + break; + + case " ace_warning": + ariaLabel = nls("gutter.annotation.aria-label.warning", "Read annotations row $0", [rowText]); + break; + + case " ace_info": + ariaLabel = nls("gutter.annotation.aria-label.info", "Read annotations row $0", [rowText]); + break; + } + annotationNode.setAttribute("aria-label", ariaLabel); +>>>>>>> 45213c400 (feat: make translation system key based) annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } diff --git a/src/layer/text.js b/src/layer/text.js index 9d3264af627..060402744d5 100644 --- a/src/layer/text.js +++ b/src/layer/text.js @@ -418,7 +418,7 @@ class Text { var span = this.dom.createElement("span"); if (token.type == "fold"){ span.style.width = (token.value.length * this.config.characterWidth) + "px"; - span.setAttribute("title", nls("Unfold code")); + span.setAttribute("title", nls("inline-fold.toggle", "Unfold code")); } span.className = classes; diff --git a/src/lib/app_config.js b/src/lib/app_config.js index 8cdd4bc2f47..041b32d51ef 100644 --- a/src/lib/app_config.js +++ b/src/lib/app_config.js @@ -62,9 +62,9 @@ var messages; class AppConfig { constructor() { - this.$defaultOptions = {}; - messages = defaultEnglishMessages; - } + this.$defaultOptions = {}; + messages = defaultEnglishMessages; + } /** * @param {Object} obj @@ -149,13 +149,14 @@ class AppConfig { * @param {{ [x: string]: any; }} [params] */ nls(key, defaultString, params) { - if (messages && !messages[key]) { + if (!messages[key]) { warn("No message found for the key '" + key + "' in the provided messages, trying to find a translation for the default string '" + defaultString + "'."); - } else if (messages && !messages[defaultString]) { - warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); - } + if (!messages[defaultString]) { + warn("No message found for the default string '" + defaultString + "' in the provided messages. Falling back to the default English message."); + } + } - var translated = messages && messages[key] || messages && messages[defaultString] || defaultString; + var translated = messages[key] || messages[defaultString] || defaultString; if (params) { translated = translated.replace(/\$(\$|[\d]+)/g, function(_, name) { if (name == "$") return "$"; diff --git a/src/lib/default_english_messages.js b/src/lib/default_english_messages.js index f595bfcbb50..6c9c4ea07b8 100644 --- a/src/lib/default_english_messages.js +++ b/src/lib/default_english_messages.js @@ -1,7 +1,50 @@ var defaultEnglishMessages = { +<<<<<<< HEAD "gutter.annotation.aria-label.ace_error": "Error, Read annotations row $0", "gutter.annotation.aria-label.ace_warning": "Warning, Read annotations row $0", "gutter.annotation.aria-label.ace_info": "Info, Read annotations row $0" +======= + "autocomplete.popup.aria-roledescription": "Autocomplete suggestions", + "autocomplete.popup.aria-label": "Autocomplete suggestions", + "autocomplete.popup.item.aria-roledescription": "item", + "autocomplete.loading": "Loading...", + "editor.scroller.aria-roledescription": "editor", + "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit", + "editor.gutter.aria-role-description": "editor", + "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit", + "error-marker.good-state": "Looks good!", + "prompt.recently-used": "Recently used", + "prompt.other-commands": "Other commands", + "prompt.no-matching-commands": "No matching commands", + "search-box.search-for": "Search for", + "search-box.find-all": "All", + "search-box.replace-with": "Replace with", + "search-box.replace-next": "Replace", + "search-box.replace-all": "All", + "search-box.toggle-replace": "Toggle Replace mode", + "search-box.toggle-regexp": "RegExp Search", + "search-box.toggle-case": "CaseSensitive Search", + "search-box.toggle-whole-word": "Whole Word Search", + "search-box.toggle-in-selection": "Search In Selection", + "search-box.search-counter": "$0 of $1", + "text-input.aria-roledescription": "editor", + "text-input.aria-label": "Cursor at row $0", + "gutter.code-folding.fold-range.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.fold-end.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.fold-start.aria-label": "Toggle code folding, row $0", + "gutter.code-folding.fold-end.title": "Unfold code", + "gutter.code-folding.fold-start.title": "Fold code", + "gutter.annotation.aria-label.error": "Error, read annotations row $0", + "gutter.annotation.aria-label.warning": "Warning, read annotations row $0", + "gutter.annotation.aria-label.info": "Info, read annotations row $0", + "inline-fold.toggle": "Unfold code", + "gutter-tooltip.label.error.singular": "error", + "gutter-tooltip.label.error.plural": "errors", + "gutter-tooltip.label.warning.singular": "warning", + "gutter-tooltip.label.warning.plural": "warnings", + "gutter-tooltip.label.info.singular": "information message", + "gutter-tooltip.label.info.plural": "information messages" +>>>>>>> 45213c400 (feat: make translation system key based) } exports.defaultEnglishMessages = defaultEnglishMessages; \ No newline at end of file diff --git a/src/mouse/default_gutter_handler.js b/src/mouse/default_gutter_handler.js index e3b07646853..2b461088b72 100644 --- a/src/mouse/default_gutter_handler.js +++ b/src/mouse/default_gutter_handler.js @@ -151,9 +151,18 @@ class GutterTooltip extends Tooltip { } static get annotationLabels() { return { - error: {singular: nls("error"), plural: nls("errors")}, - warning: {singular: nls("warning"), plural: nls("warnings")}, - info: {singular: nls("information message"), plural: nls("information messages")} + error: { + singular: nls("gutter-tooltip.label.error.singular","error"), + plural: nls("gutter-tooltip.label.error.plural", "errors") + }, + warning: { + singular: nls("gutter-tooltip.label.warning.singular", "warning"), + plural: nls("gutter-tooltip.label.warning.plural", "warnings") + }, + info: { + singular: nls("gutter-tooltip.label.info.singular", "information message"), + plural: nls("gutter-tooltip.label.info.plural", "information messages") + } }; } diff --git a/translations/am.json b/translations/am.json index 4c54ef434f3..771451f5f09 100644 --- a/translations/am.json +++ b/translations/am.json @@ -30,5 +30,45 @@ "warning": "նախազգուշացում", "warnings": "նախազգուշացումներ", "information message": "տեղեկատվություն", - "information messages": "տեղեկատվություններ" + "information messages": "տեղեկատվություններ", + "autocomplete.popup.aria-roledescription": "", + "autocomplete.popup.aria-label": "", + "autocomplete.popup.item.aria-roledescription": "", + "autocomplete.loading": "", + "editor.scroller.aria-roledescription": "", + "editor.scroller.aria-label": "", + "editor.gutter.aria-role-description": "", + "editor.gutter.aria-label": "", + "error-marker.good-state": "", + "prompt.recently-used": "", + "prompt.other-commands": "", + "prompt.no-matching-commands": "", + "search-box.search-for": "", + "search-box.find-all": "", + "search-box.replace-with": "", + "search-box.replace-next": "", + "search-box.replace-all": "", + "search-box.toggle-replace": "", + "search-box.toggle-regexp": "", + "search-box.toggle-case": "", + "search-box.toggle-whole-word": "", + "search-box.toggle-in-selection": "", + "search-box.search-counter": "", + "text-input.aria-roledescription": "", + "text-input.aria-label": "", + "gutter.code-folding.fold-range.aria-label": "", + "gutter.code-folding.fold-end.aria-label": "", + "gutter.code-folding.fold-start.aria-label": "", + "gutter.code-folding.fold-end.title": "", + "gutter.code-folding.fold-start.title": "", + "gutter.annotation.aria-label.error": "", + "gutter.annotation.aria-label.warning": "", + "gutter.annotation.aria-label.info": "", + "inline-fold.toggle": "", + "gutter-tooltip.label.error.singular": "", + "gutter-tooltip.label.error.plural": "", + "gutter-tooltip.label.warning.singular": "", + "gutter-tooltip.label.warning.plural": "", + "gutter-tooltip.label.info.singular": "", + "gutter-tooltip.label.info.plural": "" } \ No newline at end of file diff --git a/translations/es.json b/translations/es.json index 1a1e3a6416d..b055dc11370 100644 --- a/translations/es.json +++ b/translations/es.json @@ -30,5 +30,45 @@ "warning": "advertencia", "warnings": "advertencias", "information message": "mensaje de informacion", - "information messages": "mensajes de informacion" + "information messages": "mensajes de informacion", + "autocomplete.popup.aria-roledescription": "", + "autocomplete.popup.aria-label": "", + "autocomplete.popup.item.aria-roledescription": "", + "autocomplete.loading": "", + "editor.scroller.aria-roledescription": "", + "editor.scroller.aria-label": "", + "editor.gutter.aria-role-description": "", + "editor.gutter.aria-label": "", + "error-marker.good-state": "", + "prompt.recently-used": "", + "prompt.other-commands": "", + "prompt.no-matching-commands": "", + "search-box.search-for": "", + "search-box.find-all": "", + "search-box.replace-with": "", + "search-box.replace-next": "", + "search-box.replace-all": "", + "search-box.toggle-replace": "", + "search-box.toggle-regexp": "", + "search-box.toggle-case": "", + "search-box.toggle-whole-word": "", + "search-box.toggle-in-selection": "", + "search-box.search-counter": "", + "text-input.aria-roledescription": "", + "text-input.aria-label": "", + "gutter.code-folding.fold-range.aria-label": "", + "gutter.code-folding.fold-end.aria-label": "", + "gutter.code-folding.fold-start.aria-label": "", + "gutter.code-folding.fold-end.title": "", + "gutter.code-folding.fold-start.title": "", + "gutter.annotation.aria-label.error": "", + "gutter.annotation.aria-label.warning": "", + "gutter.annotation.aria-label.info": "", + "inline-fold.toggle": "", + "gutter-tooltip.label.error.singular": "", + "gutter-tooltip.label.error.plural": "", + "gutter-tooltip.label.warning.singular": "", + "gutter-tooltip.label.warning.plural": "", + "gutter-tooltip.label.info.singular": "", + "gutter-tooltip.label.info.plural": "" } \ No newline at end of file diff --git a/translations/ru.json b/translations/ru.json index 6df6c8d2dce..ab941714009 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -30,5 +30,45 @@ "warning": "предупреждение", "warnings": "предупреждения", "information message": "информационное сообщение", - "information messages": "информационные сообщения" + "information messages": "информационные сообщения", + "autocomplete.popup.aria-roledescription": "", + "autocomplete.popup.aria-label": "", + "autocomplete.popup.item.aria-roledescription": "", + "autocomplete.loading": "", + "editor.scroller.aria-roledescription": "", + "editor.scroller.aria-label": "", + "editor.gutter.aria-role-description": "", + "editor.gutter.aria-label": "", + "error-marker.good-state": "", + "prompt.recently-used": "", + "prompt.other-commands": "", + "prompt.no-matching-commands": "", + "search-box.search-for": "", + "search-box.find-all": "", + "search-box.replace-with": "", + "search-box.replace-next": "", + "search-box.replace-all": "", + "search-box.toggle-replace": "", + "search-box.toggle-regexp": "", + "search-box.toggle-case": "", + "search-box.toggle-whole-word": "", + "search-box.toggle-in-selection": "", + "search-box.search-counter": "", + "text-input.aria-roledescription": "", + "text-input.aria-label": "", + "gutter.code-folding.fold-range.aria-label": "", + "gutter.code-folding.fold-end.aria-label": "", + "gutter.code-folding.fold-start.aria-label": "", + "gutter.code-folding.fold-end.title": "", + "gutter.code-folding.fold-start.title": "", + "gutter.annotation.aria-label.error": "", + "gutter.annotation.aria-label.warning": "", + "gutter.annotation.aria-label.info": "", + "inline-fold.toggle": "", + "gutter-tooltip.label.error.singular": "", + "gutter-tooltip.label.error.plural": "", + "gutter-tooltip.label.warning.singular": "", + "gutter-tooltip.label.warning.plural": "", + "gutter-tooltip.label.info.singular": "", + "gutter-tooltip.label.info.plural": "" } \ No newline at end of file From 960feed72906c3fe90aa6a22ea2b655583deb3bc Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Mon, 1 Apr 2024 18:24:40 +0200 Subject: [PATCH 03/11] fix: update language files to new syntax --- translations/Readme.md | 3 ++ translations/am.json | 71 ++++++++-------------------- translations/es.json | 103 ++++++++++++++--------------------------- translations/ru.json | 71 ++++++++-------------------- 4 files changed, 79 insertions(+), 169 deletions(-) create mode 100644 translations/Readme.md diff --git a/translations/Readme.md b/translations/Readme.md new file mode 100644 index 00000000000..68f3eb93212 --- /dev/null +++ b/translations/Readme.md @@ -0,0 +1,3 @@ +### Generating new translation file +- Create a `JSON` file in this folder named `.json`. +- Run `node Makefile.dryice.js nls` in the root of the repository. \ No newline at end of file diff --git a/translations/am.json b/translations/am.json index 771451f5f09..abe55bd206a 100644 --- a/translations/am.json +++ b/translations/am.json @@ -1,59 +1,28 @@ { "$id": "am", - "Autocomplete suggestions": "Ավտոմատ լրացման առաջարկներ", - "Loading...": "Բեռնվում է...", - "editor": "", - "Editor content, press Enter to start editing, press Escape to exit": "", - "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit": "", - "Looks good!": "Սխալ չկա", - "Recently used": "Վերջերս օգտագործված", - "Other commands": "Այլ հրամաններ", - "No matching commands": "Չկան համապատասխան հրամաններ", - "Search for": "Փնտրել", - "All": "Բոլորը", - "Replace with": "Փոխարինել", - "Replace": "Փոխարինել", - "Toggle Replace mode": "", - "RegExp Search": "Փնտրել ռեգեքսպով", - "CaseSensitive Search": "", - "Whole Word Search": "Ամբողջ բառեր", - "Search In Selection": "Փնտրել նշվածում", - "$0 of $1": "$1-ից $0", - "Cursor at row $0": "", - "Toggle code folding, rows $0 through $1": "", - "Toggle code folding, row $0": "", - "Unfold code": "", - "Fold code": "", - "Read annotations row $0": "", - "error": "սխալ", - "errors": "սխալներ", - "warning": "նախազգուշացում", - "warnings": "նախազգուշացումներ", - "information message": "տեղեկատվություն", - "information messages": "տեղեկատվություններ", - "autocomplete.popup.aria-roledescription": "", + "autocomplete.popup.aria-roledescription": "Ավտոմատ լրացման առաջարկներ", "autocomplete.popup.aria-label": "", "autocomplete.popup.item.aria-roledescription": "", - "autocomplete.loading": "", + "autocomplete.loading": "Բեռնվում է...", "editor.scroller.aria-roledescription": "", "editor.scroller.aria-label": "", "editor.gutter.aria-role-description": "", "editor.gutter.aria-label": "", - "error-marker.good-state": "", - "prompt.recently-used": "", - "prompt.other-commands": "", - "prompt.no-matching-commands": "", - "search-box.search-for": "", - "search-box.find-all": "", - "search-box.replace-with": "", - "search-box.replace-next": "", + "error-marker.good-state": "Սխալ չկա", + "prompt.recently-used": "Վերջերս օգտագործված", + "prompt.other-commands": "Այլ հրամաններ", + "prompt.no-matching-commands": "Չկան համապատասխան հրամաններ", + "search-box.search-for": "Փնտրել", + "search-box.find-all": "Բոլորը", + "search-box.replace-with": "Փոխարինել", + "search-box.replace-next": "Փոխարինել", "search-box.replace-all": "", "search-box.toggle-replace": "", - "search-box.toggle-regexp": "", + "search-box.toggle-regexp": "Փնտրել ռեգեքսպով", "search-box.toggle-case": "", - "search-box.toggle-whole-word": "", - "search-box.toggle-in-selection": "", - "search-box.search-counter": "", + "search-box.toggle-whole-word": "Ամբողջ բառեր", + "search-box.toggle-in-selection": "Փնտրել նշվածում", + "search-box.search-counter": "$1-ից $0", "text-input.aria-roledescription": "", "text-input.aria-label": "", "gutter.code-folding.fold-range.aria-label": "", @@ -65,10 +34,10 @@ "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", "inline-fold.toggle": "", - "gutter-tooltip.label.error.singular": "", - "gutter-tooltip.label.error.plural": "", - "gutter-tooltip.label.warning.singular": "", - "gutter-tooltip.label.warning.plural": "", - "gutter-tooltip.label.info.singular": "", - "gutter-tooltip.label.info.plural": "" + "gutter-tooltip.label.error.singular": "սխալ", + "gutter-tooltip.label.error.plural": "սխալներ", + "gutter-tooltip.label.warning.singular": "նախազգուշացում", + "gutter-tooltip.label.warning.plural": "նախազգուշացումներ", + "gutter-tooltip.label.info.singular": "տեղեկատվություն", + "gutter-tooltip.label.info.plural": "տեղեկատվություններ" } \ No newline at end of file diff --git a/translations/es.json b/translations/es.json index b055dc11370..4d337d487e5 100644 --- a/translations/es.json +++ b/translations/es.json @@ -1,74 +1,43 @@ { "$id": "es", - "Autocomplete suggestions": "Sugerencias de autocompletar", - "Loading...": "Cargando...", - "editor": "editor", - "Editor content, press Enter to start editing, press Escape to exit": "Contenido del editor, presiona Entrar para empezar a editar, presiona Escape para salir", - "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit": "Canaleta de editor, presiona Entrar para por, presiona Escape para salir", - "Looks good!": "¡Parece bien!", - "Recently used": "Usado recientemente", - "Other commands": "Otros mandos", - "No matching commands": "No hay mandos que hacen juego", - "Search for": "Buscar", - "All": "Todo", - "Replace with": "Reemplazar con", - "Replace": "Reemplazar", - "Toggle Replace mode": "Pasar el modo de reemplazar", - "RegExp Search": "Búsqueda de RegExp", - "CaseSensitive Search": "Búsqueda sensible a mayúsculas y minúsculas", - "Whole Word Search": "Búsqueda de palabras enteras", - "Search In Selection": "Buscar en la selección", - "$0 of $1": "$0 de $1", - "Cursor at row $0": "Cursor en row $0", - "Unfold code": "Desplegar el codigo", - "Toggle code folding, rows $0 through $1": "", - "Toggle code folding, row $0": "", - "Fold code": "Plegar el codigo", - "Read annotations row $0": "Leer anotaciones fila $0", - "error": "error", - "errors": "errores", - "warning": "advertencia", - "warnings": "advertencias", - "information message": "mensaje de informacion", - "information messages": "mensajes de informacion", - "autocomplete.popup.aria-roledescription": "", - "autocomplete.popup.aria-label": "", + "autocomplete.popup.aria-roledescription": "Sugerencias de autocompletar", + "autocomplete.popup.aria-label": "Sugerencias de autocompletar", "autocomplete.popup.item.aria-roledescription": "", - "autocomplete.loading": "", - "editor.scroller.aria-roledescription": "", - "editor.scroller.aria-label": "", - "editor.gutter.aria-role-description": "", - "editor.gutter.aria-label": "", - "error-marker.good-state": "", - "prompt.recently-used": "", - "prompt.other-commands": "", - "prompt.no-matching-commands": "", - "search-box.search-for": "", - "search-box.find-all": "", - "search-box.replace-with": "", - "search-box.replace-next": "", - "search-box.replace-all": "", - "search-box.toggle-replace": "", - "search-box.toggle-regexp": "", - "search-box.toggle-case": "", - "search-box.toggle-whole-word": "", - "search-box.toggle-in-selection": "", - "search-box.search-counter": "", - "text-input.aria-roledescription": "", - "text-input.aria-label": "", + "autocomplete.loading": "Cargando...", + "editor.scroller.aria-roledescription": "editor", + "editor.scroller.aria-label": "Contenido del editor, presiona Entrar para empezar a editar, presiona Escape para salir", + "editor.gutter.aria-role-description": "editor", + "editor.gutter.aria-label": "Canaleta de editor, presiona Entrar para por, presiona Escape para salir", + "error-marker.good-state": "¡Parece bien!", + "prompt.recently-used": "Usado recientemente", + "prompt.other-commands": "Otros mandos", + "prompt.no-matching-commands": "No hay mandos que hacen juego", + "search-box.search-for": "Buscar", + "search-box.find-all": "Todo", + "search-box.replace-with": "Reemplazar con", + "search-box.replace-next": "Reemplazar", + "search-box.replace-all": "Todo", + "search-box.toggle-replace": "Pasar el modo de reemplazar", + "search-box.toggle-regexp": "Búsqueda de RegExp", + "search-box.toggle-case": "Búsqueda sensible a mayúsculas y minúsculas", + "search-box.toggle-whole-word": "Búsqueda de palabras enteras", + "search-box.toggle-in-selection": "Buscar en la selección", + "search-box.search-counter": "$0 de $1", + "text-input.aria-roledescription": "editor", + "text-input.aria-label": "Cursor en row $0", "gutter.code-folding.fold-range.aria-label": "", "gutter.code-folding.fold-end.aria-label": "", "gutter.code-folding.fold-start.aria-label": "", - "gutter.code-folding.fold-end.title": "", - "gutter.code-folding.fold-start.title": "", - "gutter.annotation.aria-label.error": "", - "gutter.annotation.aria-label.warning": "", - "gutter.annotation.aria-label.info": "", - "inline-fold.toggle": "", - "gutter-tooltip.label.error.singular": "", - "gutter-tooltip.label.error.plural": "", - "gutter-tooltip.label.warning.singular": "", - "gutter-tooltip.label.warning.plural": "", - "gutter-tooltip.label.info.singular": "", - "gutter-tooltip.label.info.plural": "" + "gutter.code-folding.fold-end.title": "Desplegar el codigo", + "gutter.code-folding.fold-start.title": "Plegar el codigo", + "gutter.annotation.aria-label.error": "Leer anotaciones fila $0", + "gutter.annotation.aria-label.warning": "Leer anotaciones fila $0", + "gutter.annotation.aria-label.info": "Leer anotaciones fila $0", + "inline-fold.toggle": "Desplegar el codigo", + "gutter-tooltip.label.error.singular": "error", + "gutter-tooltip.label.error.plural": "errores", + "gutter-tooltip.label.warning.singular": "advertencia", + "gutter-tooltip.label.warning.plural": "advertencias", + "gutter-tooltip.label.info.singular": "mensaje de informacion", + "gutter-tooltip.label.info.plural": "mensajes de informacion" } \ No newline at end of file diff --git a/translations/ru.json b/translations/ru.json index ab941714009..0aa5ca38990 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -1,59 +1,28 @@ { "$id": "ru", - "Autocomplete suggestions": "Предложения автозаполнения", - "Loading...": "Загрузка...", - "editor": "", - "Editor content, press Enter to start editing, press Escape to exit": "", - "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit": "", - "Looks good!": "Нет ошибок", - "Recently used": "Недавно использованные", - "Other commands": "Другие команды", - "No matching commands": "Нет подходящих команд", - "Search for": "Найти", - "All": "Все", - "Replace with": "Заменить", - "Replace": "Заменить", - "Toggle Replace mode": "Перейти в режим поиска", - "RegExp Search": "Поиск по регулярному выражению", - "CaseSensitive Search": "", - "Whole Word Search": "", - "Search In Selection": "Искать в выделенном", - "$0 of $1": "$0 из $1", - "Cursor at row $0": "", - "Toggle code folding, rows $0 through $1": "", - "Toggle code folding, row $0": "", - "Unfold code": "", - "Fold code": "", - "Read annotations row $0": "", - "error": "ошибка", - "errors": "ошибки", - "warning": "предупреждение", - "warnings": "предупреждения", - "information message": "информационное сообщение", - "information messages": "информационные сообщения", "autocomplete.popup.aria-roledescription": "", - "autocomplete.popup.aria-label": "", + "autocomplete.popup.aria-label": "Предложения автозаполнения", "autocomplete.popup.item.aria-roledescription": "", - "autocomplete.loading": "", + "autocomplete.loading": "Загрузка...", "editor.scroller.aria-roledescription": "", "editor.scroller.aria-label": "", "editor.gutter.aria-role-description": "", "editor.gutter.aria-label": "", - "error-marker.good-state": "", - "prompt.recently-used": "", - "prompt.other-commands": "", - "prompt.no-matching-commands": "", - "search-box.search-for": "", - "search-box.find-all": "", - "search-box.replace-with": "", - "search-box.replace-next": "", + "error-marker.good-state": "Нет ошибок", + "prompt.recently-used": "Недавно использованные", + "prompt.other-commands": "Другие команды", + "prompt.no-matching-commands": "Нет подходящих команд", + "search-box.search-for": "Найти", + "search-box.find-all": "Все", + "search-box.replace-with": "Заменить", + "search-box.replace-next": "Заменить", "search-box.replace-all": "", - "search-box.toggle-replace": "", - "search-box.toggle-regexp": "", + "search-box.toggle-replace": "Перейти в режим поиска", + "search-box.toggle-regexp": "Поиск по регулярному выражению", "search-box.toggle-case": "", "search-box.toggle-whole-word": "", - "search-box.toggle-in-selection": "", - "search-box.search-counter": "", + "search-box.toggle-in-selection": "Искать в выделенном", + "search-box.search-counter": "$0 из $1", "text-input.aria-roledescription": "", "text-input.aria-label": "", "gutter.code-folding.fold-range.aria-label": "", @@ -65,10 +34,10 @@ "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", "inline-fold.toggle": "", - "gutter-tooltip.label.error.singular": "", - "gutter-tooltip.label.error.plural": "", - "gutter-tooltip.label.warning.singular": "", - "gutter-tooltip.label.warning.plural": "", - "gutter-tooltip.label.info.singular": "", - "gutter-tooltip.label.info.plural": "" + "gutter-tooltip.label.error.singular": "ошибка", + "gutter-tooltip.label.error.plural": "ошибки", + "gutter-tooltip.label.warning.singular": "предупреждение", + "gutter-tooltip.label.warning.plural": "предупреждения", + "gutter-tooltip.label.info.singular": "информационное сообщение", + "gutter-tooltip.label.info.plural": "информационные сообщения" } \ No newline at end of file From bc9d5429d78f6875dce7b18e6f174696888e9285 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Mon, 1 Apr 2024 18:27:16 +0200 Subject: [PATCH 04/11] fix: update translation readme --- src/lib/default_english_messages.js | 6 ------ translations/Readme.md | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/lib/default_english_messages.js b/src/lib/default_english_messages.js index 6c9c4ea07b8..b206c037bbe 100644 --- a/src/lib/default_english_messages.js +++ b/src/lib/default_english_messages.js @@ -1,9 +1,4 @@ var defaultEnglishMessages = { -<<<<<<< HEAD - "gutter.annotation.aria-label.ace_error": "Error, Read annotations row $0", - "gutter.annotation.aria-label.ace_warning": "Warning, Read annotations row $0", - "gutter.annotation.aria-label.ace_info": "Info, Read annotations row $0" -======= "autocomplete.popup.aria-roledescription": "Autocomplete suggestions", "autocomplete.popup.aria-label": "Autocomplete suggestions", "autocomplete.popup.item.aria-roledescription": "item", @@ -44,7 +39,6 @@ var defaultEnglishMessages = { "gutter-tooltip.label.warning.plural": "warnings", "gutter-tooltip.label.info.singular": "information message", "gutter-tooltip.label.info.plural": "information messages" ->>>>>>> 45213c400 (feat: make translation system key based) } exports.defaultEnglishMessages = defaultEnglishMessages; \ No newline at end of file diff --git a/translations/Readme.md b/translations/Readme.md index 68f3eb93212..5bc47dd6d82 100644 --- a/translations/Readme.md +++ b/translations/Readme.md @@ -1,3 +1,4 @@ ### Generating new translation file -- Create a `JSON` file in this folder named `.json`. -- Run `node Makefile.dryice.js nls` in the root of the repository. \ No newline at end of file +- Create a `JSON` file in this folder named `.json`. +- Add `{"$id": ""}` to the empty file. +- Run `node Makefile.dryice.js nls` in the root of the repository to generate empty translation file. \ No newline at end of file From c37bd9dc1669e3d49738b4dab64f4b8b7e76a661 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Mon, 1 Apr 2024 21:59:20 +0200 Subject: [PATCH 05/11] chore: remove comitted git tokens --- src/layer/gutter.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/layer/gutter.js b/src/layer/gutter.js index ad12b9e66ee..e491ae05b08 100644 --- a/src/layer/gutter.js +++ b/src/layer/gutter.js @@ -442,9 +442,6 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); -<<<<<<< HEAD - annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); -======= var ariaLabel; switch(foldAnnotationClass) { case " ace_error_fold": @@ -456,7 +453,6 @@ class Gutter{ break; } annotationNode.setAttribute("aria-label", ariaLabel); ->>>>>>> 45213c400 (feat: make translation system key based) annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } @@ -472,9 +468,6 @@ class Gutter{ dom.setStyle(annotationIconNode.style, "height", lineHeight); dom.setStyle(annotationNode.style, "display", "block"); dom.setStyle(annotationNode.style, "height", lineHeight); -<<<<<<< HEAD - annotationNode.setAttribute("aria-label", nls(`gutter.annotation.aria-label.${this.$annotations[row].className.trim()}`, "Read annotations row $0", [rowText])); -======= var ariaLabel; switch(this.$annotations[row].className) { case " ace_error": @@ -490,7 +483,6 @@ class Gutter{ break; } annotationNode.setAttribute("aria-label", ariaLabel); ->>>>>>> 45213c400 (feat: make translation system key based) annotationNode.setAttribute("tabindex", "-1"); annotationNode.setAttribute("role", "button"); } From 66c99f49f8b51f4c54aa230f7132d6ecb16200b0 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Tue, 2 Apr 2024 10:20:45 +0200 Subject: [PATCH 06/11] chore: add english strings file to eslintignore --- .eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintignore b/.eslintignore index c735e410ac3..f06202dbaa1 100644 --- a/.eslintignore +++ b/.eslintignore @@ -9,6 +9,7 @@ lib/ace/mode/xml/* lib/ace/mode/xquery/* lib/ace/mode/xquery.js lib/ace/mode/yaml/* +src/lib/default_english_messages.js **/test/asyncjs/* **/es5-shim.js **/vim*.js From ede6edcdd63d61e684f31d9022f2f39889bb346e Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Tue, 2 Apr 2024 10:50:36 +0200 Subject: [PATCH 07/11] whitespace fix --- src/mouse/default_gutter_handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mouse/default_gutter_handler.js b/src/mouse/default_gutter_handler.js index 2b461088b72..2c64e803844 100644 --- a/src/mouse/default_gutter_handler.js +++ b/src/mouse/default_gutter_handler.js @@ -152,7 +152,7 @@ class GutterTooltip extends Tooltip { static get annotationLabels() { return { error: { - singular: nls("gutter-tooltip.label.error.singular","error"), + singular: nls("gutter-tooltip.label.error.singular", "error"), plural: nls("gutter-tooltip.label.error.plural", "errors") }, warning: { From 7f43e04831170c2832ab2c5a0f42d41846675148 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Wed, 3 Apr 2024 14:42:35 +0200 Subject: [PATCH 08/11] improve key names --- src/editor.js | 2 +- src/layer/gutter.js | 10 +++++----- src/lib/default_english_messages.js | 24 ++++++++++++------------ src/mouse/default_gutter_handler.js | 12 ++++++------ translations/am.json | 24 ++++++++++++------------ translations/es.json | 24 ++++++++++++------------ translations/ru.json | 24 ++++++++++++------------ 7 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/editor.js b/src/editor.js index 9ab9e7b076a..fa99ddf95b9 100644 --- a/src/editor.js +++ b/src/editor.js @@ -2956,7 +2956,7 @@ config.defineOptions(Editor.prototype, "editor", { this.renderer.$gutter.setAttribute("tabindex", 0); this.renderer.$gutter.setAttribute("aria-hidden", false); this.renderer.$gutter.setAttribute("role", "group"); - this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-role-description", "editor")); + this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor.gutter.aria-roledescription", "editor")); this.renderer.$gutter.setAttribute("aria-label", nls("editor.gutter.aria-label", "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit") ); diff --git a/src/layer/gutter.js b/src/layer/gutter.js index e491ae05b08..3f04c4f5f79 100644 --- a/src/layer/gutter.js +++ b/src/layer/gutter.js @@ -409,21 +409,21 @@ class Gutter{ // getFoldWidgetRange is optional to be implemented by fold modes, if not available we fall-back. if (foldRange) - foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-range.aria-label", "Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.range.aria-label", "Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1])); else { if (fold) - foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-end.aria-label", "Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.closed.aria-label", "Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1])); else - foldWidget.setAttribute("aria-label", nls("gutter.code-folding.fold-start.aria-label", "Toggle code folding, row $0", [row + 1])); + foldWidget.setAttribute("aria-label", nls("gutter.code-folding.open.aria-label", "Toggle code folding, row $0", [row + 1])); } if (isClosedFold) { foldWidget.setAttribute("aria-expanded", "false"); - foldWidget.setAttribute("title", nls("gutter.code-folding.fold-end.title", "Unfold code")); + foldWidget.setAttribute("title", nls("gutter.code-folding.closed.title", "Unfold code")); } else { foldWidget.setAttribute("aria-expanded", "true"); - foldWidget.setAttribute("title", nls("gutter.code-folding.fold-start.title", "Fold code")); + foldWidget.setAttribute("title", nls("gutter.code-folding.open.title", "Fold code")); } } else { if (foldWidget) { diff --git a/src/lib/default_english_messages.js b/src/lib/default_english_messages.js index b206c037bbe..41207f62972 100644 --- a/src/lib/default_english_messages.js +++ b/src/lib/default_english_messages.js @@ -5,7 +5,7 @@ var defaultEnglishMessages = { "autocomplete.loading": "Loading...", "editor.scroller.aria-roledescription": "editor", "editor.scroller.aria-label": "Editor content, press Enter to start editing, press Escape to exit", - "editor.gutter.aria-role-description": "editor", + "editor.gutter.aria-roledescription": "editor", "editor.gutter.aria-label": "Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit", "error-marker.good-state": "Looks good!", "prompt.recently-used": "Recently used", @@ -24,21 +24,21 @@ var defaultEnglishMessages = { "search-box.search-counter": "$0 of $1", "text-input.aria-roledescription": "editor", "text-input.aria-label": "Cursor at row $0", - "gutter.code-folding.fold-range.aria-label": "Toggle code folding, rows $0 through $1", - "gutter.code-folding.fold-end.aria-label": "Toggle code folding, rows $0 through $1", - "gutter.code-folding.fold-start.aria-label": "Toggle code folding, row $0", - "gutter.code-folding.fold-end.title": "Unfold code", - "gutter.code-folding.fold-start.title": "Fold code", + "gutter.code-folding.range.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.closed.aria-label": "Toggle code folding, rows $0 through $1", + "gutter.code-folding.open.aria-label": "Toggle code folding, row $0", + "gutter.code-folding.closed.title": "Unfold code", + "gutter.code-folding.open.title": "Fold code", "gutter.annotation.aria-label.error": "Error, read annotations row $0", "gutter.annotation.aria-label.warning": "Warning, read annotations row $0", "gutter.annotation.aria-label.info": "Info, read annotations row $0", "inline-fold.toggle": "Unfold code", - "gutter-tooltip.label.error.singular": "error", - "gutter-tooltip.label.error.plural": "errors", - "gutter-tooltip.label.warning.singular": "warning", - "gutter-tooltip.label.warning.plural": "warnings", - "gutter-tooltip.label.info.singular": "information message", - "gutter-tooltip.label.info.plural": "information messages" + "gutter-tooltip.aria-label.error.singular": "error", + "gutter-tooltip.aria-label.error.plural": "errors", + "gutter-tooltip.aria-label.warning.singular": "warning", + "gutter-tooltip.aria-label.warning.plural": "warnings", + "gutter-tooltip.aria-label.info.singular": "information message", + "gutter-tooltip.aria-label.info.plural": "information messages" } exports.defaultEnglishMessages = defaultEnglishMessages; \ No newline at end of file diff --git a/src/mouse/default_gutter_handler.js b/src/mouse/default_gutter_handler.js index 2c64e803844..3d705eca22b 100644 --- a/src/mouse/default_gutter_handler.js +++ b/src/mouse/default_gutter_handler.js @@ -152,16 +152,16 @@ class GutterTooltip extends Tooltip { static get annotationLabels() { return { error: { - singular: nls("gutter-tooltip.label.error.singular", "error"), - plural: nls("gutter-tooltip.label.error.plural", "errors") + singular: nls("gutter-tooltip.aria-label.error.singular", "error"), + plural: nls("gutter-tooltip.aria-label.error.plural", "errors") }, warning: { - singular: nls("gutter-tooltip.label.warning.singular", "warning"), - plural: nls("gutter-tooltip.label.warning.plural", "warnings") + singular: nls("gutter-tooltip.aria-label.warning.singular", "warning"), + plural: nls("gutter-tooltip.aria-label.warning.plural", "warnings") }, info: { - singular: nls("gutter-tooltip.label.info.singular", "information message"), - plural: nls("gutter-tooltip.label.info.plural", "information messages") + singular: nls("gutter-tooltip.aria-label.info.singular", "information message"), + plural: nls("gutter-tooltip.aria-label.info.plural", "information messages") } }; } diff --git a/translations/am.json b/translations/am.json index abe55bd206a..3c9718a5439 100644 --- a/translations/am.json +++ b/translations/am.json @@ -6,7 +6,7 @@ "autocomplete.loading": "Բեռնվում է...", "editor.scroller.aria-roledescription": "", "editor.scroller.aria-label": "", - "editor.gutter.aria-role-description": "", + "editor.gutter.aria-roledescription": "", "editor.gutter.aria-label": "", "error-marker.good-state": "Սխալ չկա", "prompt.recently-used": "Վերջերս օգտագործված", @@ -25,19 +25,19 @@ "search-box.search-counter": "$1-ից $0", "text-input.aria-roledescription": "", "text-input.aria-label": "", - "gutter.code-folding.fold-range.aria-label": "", - "gutter.code-folding.fold-end.aria-label": "", - "gutter.code-folding.fold-start.aria-label": "", - "gutter.code-folding.fold-end.title": "", - "gutter.code-folding.fold-start.title": "", + "gutter.code-folding.range.aria-label": "", + "gutter.code-folding.closed.aria-label": "", + "gutter.code-folding.open.aria-label": "", + "gutter.code-folding.closed.title": "", + "gutter.code-folding.open.title": "", "gutter.annotation.aria-label.error": "", "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", "inline-fold.toggle": "", - "gutter-tooltip.label.error.singular": "սխալ", - "gutter-tooltip.label.error.plural": "սխալներ", - "gutter-tooltip.label.warning.singular": "նախազգուշացում", - "gutter-tooltip.label.warning.plural": "նախազգուշացումներ", - "gutter-tooltip.label.info.singular": "տեղեկատվություն", - "gutter-tooltip.label.info.plural": "տեղեկատվություններ" + "gutter-tooltip.aria-label.error.singular": "սխալ", + "gutter-tooltip.aria-label.error.plural": "սխալներ", + "gutter-tooltip.aria-label.warning.singular": "նախազգուշացում", + "gutter-tooltip.aria-label.warning.plural": "նախազգուշացումներ", + "gutter-tooltip.aria-label.info.singular": "տեղեկատվություն", + "gutter-tooltip.aria-label.info.plural": "տեղեկատվություններ" } \ No newline at end of file diff --git a/translations/es.json b/translations/es.json index 4d337d487e5..f99e4c8b37e 100644 --- a/translations/es.json +++ b/translations/es.json @@ -6,7 +6,7 @@ "autocomplete.loading": "Cargando...", "editor.scroller.aria-roledescription": "editor", "editor.scroller.aria-label": "Contenido del editor, presiona Entrar para empezar a editar, presiona Escape para salir", - "editor.gutter.aria-role-description": "editor", + "editor.gutter.aria-roledescription": "editor", "editor.gutter.aria-label": "Canaleta de editor, presiona Entrar para por, presiona Escape para salir", "error-marker.good-state": "¡Parece bien!", "prompt.recently-used": "Usado recientemente", @@ -25,19 +25,19 @@ "search-box.search-counter": "$0 de $1", "text-input.aria-roledescription": "editor", "text-input.aria-label": "Cursor en row $0", - "gutter.code-folding.fold-range.aria-label": "", - "gutter.code-folding.fold-end.aria-label": "", - "gutter.code-folding.fold-start.aria-label": "", - "gutter.code-folding.fold-end.title": "Desplegar el codigo", - "gutter.code-folding.fold-start.title": "Plegar el codigo", + "gutter.code-folding.range.aria-label": "", + "gutter.code-folding.closed.aria-label": "", + "gutter.code-folding.open.aria-label": "", + "gutter.code-folding.closed.title": "Desplegar el codigo", + "gutter.code-folding.open.title": "Plegar el codigo", "gutter.annotation.aria-label.error": "Leer anotaciones fila $0", "gutter.annotation.aria-label.warning": "Leer anotaciones fila $0", "gutter.annotation.aria-label.info": "Leer anotaciones fila $0", "inline-fold.toggle": "Desplegar el codigo", - "gutter-tooltip.label.error.singular": "error", - "gutter-tooltip.label.error.plural": "errores", - "gutter-tooltip.label.warning.singular": "advertencia", - "gutter-tooltip.label.warning.plural": "advertencias", - "gutter-tooltip.label.info.singular": "mensaje de informacion", - "gutter-tooltip.label.info.plural": "mensajes de informacion" + "gutter-tooltip.aria-label.error.singular": "error", + "gutter-tooltip.aria-label.error.plural": "errores", + "gutter-tooltip.aria-label.warning.singular": "advertencia", + "gutter-tooltip.aria-label.warning.plural": "advertencias", + "gutter-tooltip.aria-label.info.singular": "mensaje de informacion", + "gutter-tooltip.aria-label.info.plural": "mensajes de informacion" } \ No newline at end of file diff --git a/translations/ru.json b/translations/ru.json index 0aa5ca38990..93dfead92d4 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -6,7 +6,7 @@ "autocomplete.loading": "Загрузка...", "editor.scroller.aria-roledescription": "", "editor.scroller.aria-label": "", - "editor.gutter.aria-role-description": "", + "editor.gutter.aria-roledescription": "", "editor.gutter.aria-label": "", "error-marker.good-state": "Нет ошибок", "prompt.recently-used": "Недавно использованные", @@ -25,19 +25,19 @@ "search-box.search-counter": "$0 из $1", "text-input.aria-roledescription": "", "text-input.aria-label": "", - "gutter.code-folding.fold-range.aria-label": "", - "gutter.code-folding.fold-end.aria-label": "", - "gutter.code-folding.fold-start.aria-label": "", - "gutter.code-folding.fold-end.title": "", - "gutter.code-folding.fold-start.title": "", + "gutter.code-folding.range.aria-label": "", + "gutter.code-folding.closed.aria-label": "", + "gutter.code-folding.open.aria-label": "", + "gutter.code-folding.closed.title": "", + "gutter.code-folding.open.title": "", "gutter.annotation.aria-label.error": "", "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", "inline-fold.toggle": "", - "gutter-tooltip.label.error.singular": "ошибка", - "gutter-tooltip.label.error.plural": "ошибки", - "gutter-tooltip.label.warning.singular": "предупреждение", - "gutter-tooltip.label.warning.plural": "предупреждения", - "gutter-tooltip.label.info.singular": "информационное сообщение", - "gutter-tooltip.label.info.plural": "информационные сообщения" + "gutter-tooltip.aria-label.error.singular": "ошибка", + "gutter-tooltip.aria-label.error.plural": "ошибки", + "gutter-tooltip.aria-label.warning.singular": "предупреждение", + "gutter-tooltip.aria-label.warning.plural": "предупреждения", + "gutter-tooltip.aria-label.info.singular": "информационное сообщение", + "gutter-tooltip.aria-label.info.plural": "информационные сообщения" } \ No newline at end of file From 66a88a72d4b216517ccca2cd303379aecce6fdaf Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Wed, 3 Apr 2024 14:58:06 +0200 Subject: [PATCH 09/11] key updates --- src/ext/searchbox.js | 20 ++++++++++---------- src/layer/text.js | 2 +- src/lib/default_english_messages.js | 22 +++++++++++----------- translations/am.json | 22 +++++++++++----------- translations/es.json | 22 +++++++++++----------- translations/ru.json | 22 +++++++++++----------- 6 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/ext/searchbox.js b/src/ext/searchbox.js index b4131c3d45e..f676da50803 100644 --- a/src/ext/searchbox.js +++ b/src/ext/searchbox.js @@ -27,24 +27,24 @@ class SearchBox { dom.buildDom(["div", {class:"ace_search right"}, ["span", {action: "hide", class: "ace_searchbtn_close"}], ["div", {class: "ace_search_form"}, - ["input", {class: "ace_search_field", placeholder: nls("search-box.search-for", "Search for"), spellcheck: "false"}], + ["input", {class: "ace_search_field", placeholder: nls("search-box.find.placeholder", "Search for"), spellcheck: "false"}], ["span", {action: "findPrev", class: "ace_searchbtn prev"}, "\u200b"], ["span", {action: "findNext", class: "ace_searchbtn next"}, "\u200b"], - ["span", {action: "findAll", class: "ace_searchbtn", title: "Alt-Enter"}, nls("search-box.find-all", "All")] + ["span", {action: "findAll", class: "ace_searchbtn", title: "Alt-Enter"}, nls("search-box.find-all.text", "All")] ], ["div", {class: "ace_replace_form"}, - ["input", {class: "ace_search_field", placeholder: nls("search-box.replace-with", "Replace with"), spellcheck: "false"}], - ["span", {action: "replaceAndFindNext", class: "ace_searchbtn"}, nls("search-box.replace-next", "Replace")], - ["span", {action: "replaceAll", class: "ace_searchbtn"}, nls("search-box.replace-all", "All")] + ["input", {class: "ace_search_field", placeholder: nls("search-box.replace.placeholder", "Replace with"), spellcheck: "false"}], + ["span", {action: "replaceAndFindNext", class: "ace_searchbtn"}, nls("search-box.replace-next.text", "Replace")], + ["span", {action: "replaceAll", class: "ace_searchbtn"}, nls("search-box.replace-all.text", "All")] ], ["div", {class: "ace_search_options"}, - ["span", {action: "toggleReplace", class: "ace_button", title: nls("search-box.toggle-replace", "Toggle Replace mode"), + ["span", {action: "toggleReplace", class: "ace_button", title: nls("search-box.toggle-replace.title", "Toggle Replace mode"), style: "float:left;margin-top:-2px;padding:0 5px;"}, "+"], ["span", {class: "ace_search_counter"}], - ["span", {action: "toggleRegexpMode", class: "ace_button", title: nls("search-box.toggle-regexp", "RegExp Search")}, ".*"], - ["span", {action: "toggleCaseSensitive", class: "ace_button", title: nls("search-box.toggle-case", "CaseSensitive Search")}, "Aa"], - ["span", {action: "toggleWholeWords", class: "ace_button", title: nls("search-box.toggle-whole-word", "Whole Word Search")}, "\\b"], - ["span", {action: "searchInSelection", class: "ace_button", title: nls("search-box.toggle-in-selection", "Search In Selection")}, "S"] + ["span", {action: "toggleRegexpMode", class: "ace_button", title: nls("search-box.toggle-regexp.title", "RegExp Search")}, ".*"], + ["span", {action: "toggleCaseSensitive", class: "ace_button", title: nls("search-box.toggle-case.title", "CaseSensitive Search")}, "Aa"], + ["span", {action: "toggleWholeWords", class: "ace_button", title: nls("search-box.toggle-whole-word.title", "Whole Word Search")}, "\\b"], + ["span", {action: "searchInSelection", class: "ace_button", title: nls("search-box.toggle-in-selection.title", "Search In Selection")}, "S"] ] ], div); /**@type {any}*/ diff --git a/src/layer/text.js b/src/layer/text.js index 060402744d5..20cc1194316 100644 --- a/src/layer/text.js +++ b/src/layer/text.js @@ -418,7 +418,7 @@ class Text { var span = this.dom.createElement("span"); if (token.type == "fold"){ span.style.width = (token.value.length * this.config.characterWidth) + "px"; - span.setAttribute("title", nls("inline-fold.toggle", "Unfold code")); + span.setAttribute("title", nls("inline-fold.closed.title", "Unfold code")); } span.className = classes; diff --git a/src/lib/default_english_messages.js b/src/lib/default_english_messages.js index 41207f62972..c112868f8b5 100644 --- a/src/lib/default_english_messages.js +++ b/src/lib/default_english_messages.js @@ -11,16 +11,16 @@ var defaultEnglishMessages = { "prompt.recently-used": "Recently used", "prompt.other-commands": "Other commands", "prompt.no-matching-commands": "No matching commands", - "search-box.search-for": "Search for", - "search-box.find-all": "All", - "search-box.replace-with": "Replace with", - "search-box.replace-next": "Replace", - "search-box.replace-all": "All", - "search-box.toggle-replace": "Toggle Replace mode", - "search-box.toggle-regexp": "RegExp Search", - "search-box.toggle-case": "CaseSensitive Search", - "search-box.toggle-whole-word": "Whole Word Search", - "search-box.toggle-in-selection": "Search In Selection", + "search-box.find.placeholder": "Search for", + "search-box.find-all.text": "All", + "search-box.replace.placeholder": "Replace with", + "search-box.replace-next.text": "Replace", + "search-box.replace-all.text": "All", + "search-box.toggle-replace.title": "Toggle Replace mode", + "search-box.toggle-regexp.title": "RegExp Search", + "search-box.toggle-case.title": "CaseSensitive Search", + "search-box.toggle-whole-word.title": "Whole Word Search", + "search-box.toggle-in-selection.title": "Search In Selection", "search-box.search-counter": "$0 of $1", "text-input.aria-roledescription": "editor", "text-input.aria-label": "Cursor at row $0", @@ -32,7 +32,7 @@ var defaultEnglishMessages = { "gutter.annotation.aria-label.error": "Error, read annotations row $0", "gutter.annotation.aria-label.warning": "Warning, read annotations row $0", "gutter.annotation.aria-label.info": "Info, read annotations row $0", - "inline-fold.toggle": "Unfold code", + "inline-fold.closed.title": "Unfold code", "gutter-tooltip.aria-label.error.singular": "error", "gutter-tooltip.aria-label.error.plural": "errors", "gutter-tooltip.aria-label.warning.singular": "warning", diff --git a/translations/am.json b/translations/am.json index 3c9718a5439..ebfb6b29b55 100644 --- a/translations/am.json +++ b/translations/am.json @@ -12,16 +12,16 @@ "prompt.recently-used": "Վերջերս օգտագործված", "prompt.other-commands": "Այլ հրամաններ", "prompt.no-matching-commands": "Չկան համապատասխան հրամաններ", - "search-box.search-for": "Փնտրել", - "search-box.find-all": "Բոլորը", - "search-box.replace-with": "Փոխարինել", - "search-box.replace-next": "Փոխարինել", - "search-box.replace-all": "", - "search-box.toggle-replace": "", - "search-box.toggle-regexp": "Փնտրել ռեգեքսպով", - "search-box.toggle-case": "", - "search-box.toggle-whole-word": "Ամբողջ բառեր", - "search-box.toggle-in-selection": "Փնտրել նշվածում", + "search-box.find.placeholder": "Փնտրել", + "search-box.find-all.text": "Բոլորը", + "search-box.replace.placeholder": "Փոխարինել", + "search-box.replace-next.text": "Փոխարինել", + "search-box.replace-all.text": "", + "search-box.toggle-replace.title": "", + "search-box.toggle-regexp.title": "Փնտրել ռեգեքսպով", + "search-box.toggle-case.title": "", + "search-box.toggle-whole-word.title": "Ամբողջ բառեր", + "search-box.toggle-in-selection.title": "Փնտրել նշվածում", "search-box.search-counter": "$1-ից $0", "text-input.aria-roledescription": "", "text-input.aria-label": "", @@ -33,7 +33,7 @@ "gutter.annotation.aria-label.error": "", "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", - "inline-fold.toggle": "", + "inline-fold.closed.title": "", "gutter-tooltip.aria-label.error.singular": "սխալ", "gutter-tooltip.aria-label.error.plural": "սխալներ", "gutter-tooltip.aria-label.warning.singular": "նախազգուշացում", diff --git a/translations/es.json b/translations/es.json index f99e4c8b37e..7d17260e75e 100644 --- a/translations/es.json +++ b/translations/es.json @@ -12,16 +12,16 @@ "prompt.recently-used": "Usado recientemente", "prompt.other-commands": "Otros mandos", "prompt.no-matching-commands": "No hay mandos que hacen juego", - "search-box.search-for": "Buscar", - "search-box.find-all": "Todo", - "search-box.replace-with": "Reemplazar con", - "search-box.replace-next": "Reemplazar", - "search-box.replace-all": "Todo", - "search-box.toggle-replace": "Pasar el modo de reemplazar", - "search-box.toggle-regexp": "Búsqueda de RegExp", - "search-box.toggle-case": "Búsqueda sensible a mayúsculas y minúsculas", - "search-box.toggle-whole-word": "Búsqueda de palabras enteras", - "search-box.toggle-in-selection": "Buscar en la selección", + "search-box.find.placeholder": "Todo", + "search-box.find-all.text": "", + "search-box.replace.placeholder": "Reemplazar con", + "search-box.replace-next.text": "Reemplazar", + "search-box.replace-all.text": "Todo", + "search-box.toggle-replace.title": "Pasar el modo de reemplazar", + "search-box.toggle-regexp.title": "Búsqueda de RegExp", + "search-box.toggle-case.title": "Búsqueda sensible a mayúsculas y minúsculas", + "search-box.toggle-whole-word.title": "Búsqueda de palabras enteras", + "search-box.toggle-in-selection.title": "Buscar en la selección", "search-box.search-counter": "$0 de $1", "text-input.aria-roledescription": "editor", "text-input.aria-label": "Cursor en row $0", @@ -33,7 +33,7 @@ "gutter.annotation.aria-label.error": "Leer anotaciones fila $0", "gutter.annotation.aria-label.warning": "Leer anotaciones fila $0", "gutter.annotation.aria-label.info": "Leer anotaciones fila $0", - "inline-fold.toggle": "Desplegar el codigo", + "inline-fold.closed.title": "Desplegar el codigo", "gutter-tooltip.aria-label.error.singular": "error", "gutter-tooltip.aria-label.error.plural": "errores", "gutter-tooltip.aria-label.warning.singular": "advertencia", diff --git a/translations/ru.json b/translations/ru.json index 93dfead92d4..d807d9ff303 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -12,16 +12,16 @@ "prompt.recently-used": "Недавно использованные", "prompt.other-commands": "Другие команды", "prompt.no-matching-commands": "Нет подходящих команд", - "search-box.search-for": "Найти", - "search-box.find-all": "Все", - "search-box.replace-with": "Заменить", - "search-box.replace-next": "Заменить", - "search-box.replace-all": "", - "search-box.toggle-replace": "Перейти в режим поиска", - "search-box.toggle-regexp": "Поиск по регулярному выражению", - "search-box.toggle-case": "", - "search-box.toggle-whole-word": "", - "search-box.toggle-in-selection": "Искать в выделенном", + "search-box.find.placeholder": "Найти", + "search-box.find-all.text": "Все", + "search-box.replace.placeholder": "Заменить", + "search-box.replace-next.text": "Заменить", + "search-box.replace-all.text": "", + "search-box.toggle-replace.title": "Перейти в режим поиска", + "search-box.toggle-regexp.title": "Поиск по регулярному выражению", + "search-box.toggle-case.title": "", + "search-box.toggle-whole-word.title": "", + "search-box.toggle-in-selection.title": "Искать в выделенном", "search-box.search-counter": "$0 из $1", "text-input.aria-roledescription": "", "text-input.aria-label": "", @@ -33,7 +33,7 @@ "gutter.annotation.aria-label.error": "", "gutter.annotation.aria-label.warning": "", "gutter.annotation.aria-label.info": "", - "inline-fold.toggle": "", + "inline-fold.closed.title": "", "gutter-tooltip.aria-label.error.singular": "ошибка", "gutter-tooltip.aria-label.error.plural": "ошибки", "gutter-tooltip.aria-label.warning.singular": "предупреждение", From 40c9e6b481fe711b81eaabed76b9d5235d098df0 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Tue, 23 Apr 2024 11:09:11 +0200 Subject: [PATCH 10/11] fix: account for popup being potentially undefined is mousewheel listener --- src/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autocomplete.js b/src/autocomplete.js index e921caa9c50..410e2ff0cd9 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -431,7 +431,7 @@ class Autocomplete { } mousewheelListener(e) { - if (!this.popup.isMouseOver) + if (!this.popup?.isMouseOver) this.detach(); } From 01abcfa6c43e89700f2f5f1cfb4bbf66fb7aaae2 Mon Sep 17 00:00:00 2001 From: Alice Koreman Date: Tue, 23 Apr 2024 11:35:26 +0200 Subject: [PATCH 11/11] switch to different syntax --- src/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autocomplete.js b/src/autocomplete.js index 410e2ff0cd9..520c74ec070 100644 --- a/src/autocomplete.js +++ b/src/autocomplete.js @@ -431,7 +431,7 @@ class Autocomplete { } mousewheelListener(e) { - if (!this.popup?.isMouseOver) + if (this.popup && !this.popup.isMouseOver) this.detach(); }