From f9214d27fb3d30071f5cac0ef45bf106ec43d779 Mon Sep 17 00:00:00 2001 From: Ray Lothian Date: Mon, 28 Sep 2020 16:02:45 +0200 Subject: [PATCH] fixes #101 --- extension/_locales/en/messages.json | 12 ++++++++++++ extension/data/options/index.html | 2 +- extension/data/options/index.js | 7 +++++++ extension/data/popup/index.html | 4 ++-- extension/data/popup/index.js | 10 ++++++++-- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/extension/_locales/en/messages.json b/extension/_locales/en/messages.json index 05cd82b..cfa1c59 100644 --- a/extension/_locales/en/messages.json +++ b/extension/_locales/en/messages.json @@ -70,6 +70,9 @@ "exportSettings": { "message": "Export Settings" }, + "exportSettingsTitle": { + "message": "To generate minified version, press Shift key while pressing this button" + }, "help": { "message": "FAQs Page (Help)" }, @@ -172,6 +175,15 @@ "uaPlaceholder": { "message": "Your preferred user-agent string" }, + "ztoa": { + "message": "Z to A" + }, + "atoz": { + "message": "A to Z" + }, + "filterAmong": { + "message": "Filter among $1" + }, "msgDefaultUA": { "message": "Default UA, press the reset button instead" }, diff --git a/extension/data/options/index.html b/extension/data/options/index.html index 4613ab9..2450e64 100644 --- a/extension/data/options/index.html +++ b/extension/data/options/index.html @@ -66,7 +66,7 @@
This extension supports managed storage. All the preferences can be pre-configured by the domain administrator
- +
diff --git a/extension/data/options/index.js b/extension/data/options/index.js index 81e722e..15950b7 100644 --- a/extension/data/options/index.js +++ b/extension/data/options/index.js @@ -8,6 +8,13 @@ document.querySelectorAll('[data-localize]').forEach(e => { e.textContent = translated; } }); +document.querySelectorAll('[data-localized-title]').forEach(e => { + const ref = e.dataset.localizedTitle; + const translated = chrome.i18n.getMessage(ref); + if (translated) { + e.title = translated; + } +}); function notify(msg, period = 750) { // Update status to let user know options were saved. diff --git a/extension/data/popup/index.html b/extension/data/popup/index.html index 4f4f172..2786af5 100644 --- a/extension/data/popup/index.html +++ b/extension/data/popup/index.html @@ -40,8 +40,8 @@   diff --git a/extension/data/popup/index.js b/extension/data/popup/index.js index f259e15..24c174c 100644 --- a/extension/data/popup/index.js +++ b/extension/data/popup/index.js @@ -8,7 +8,6 @@ document.querySelectorAll('[data-localized-value]').forEach(e => { e.value = translated; } }); - document.querySelectorAll('[data-localized-title]').forEach(e => { const ref = e.dataset.localizedTitle; const translated = chrome.i18n.getMessage(ref); @@ -16,6 +15,13 @@ document.querySelectorAll('[data-localized-title]').forEach(e => { e.title = translated; } }); +document.querySelectorAll('[data-localize]').forEach(e => { + const ref = e.dataset.localize; + const translated = chrome.i18n.getMessage(ref); + if (translated) { + e.textContent = translated; + } +}); const DCSI = 'firefox-default'; @@ -155,7 +161,7 @@ function update(ua) { inline: 'nearest' }); } - document.getElementById('custom').placeholder = `Filter among ${list.length}`; + document.getElementById('custom').placeholder = chrome.i18n.getMessage('filterAmong', [list.length]); [...document.getElementById('os').querySelectorAll('option')].forEach(option => { option.disabled = (map.matching[browser.toLowerCase()] || []).indexOf(option.value.toLowerCase()) === -1; });