diff --git a/chrome/_locales/en/messages.json b/chrome/_locales/en/messages.json new file mode 100644 index 0000000..1fca4ed --- /dev/null +++ b/chrome/_locales/en/messages.json @@ -0,0 +1,28 @@ +{ + "extDescription": { + "message": "Blocks Ads on Twitch.tv.", + "description": "The extension short description." + }, + "toggleAdblocker": { + "message": "Twitch Adblocker Off / On" + }, + "toggleBlockingAds": { + "message": "\"Blocking Ads\" message Off / On", + "description": "Toggle the 'blocking ads...' banner" + }, + "reloadTabsWarning": { + "message": "Whenever you change a setting, you have to reload the Twitch tab(s)." + }, + "popupReminder": { + "message": "You can access these settings at any time by clicking on the extension icon" + }, + "installThanks": { + "message": "Thank you for installing Twitch Adblock!" + }, + "disableOtherAdblockers": { + "message": "In order to provide full functionality, please make sure that you disable any other Adblocker for Twitch." + }, + "blockingAds":{ + "message": "Blocking ads..." + } +} \ No newline at end of file diff --git a/chrome/_locales/es/messages.json b/chrome/_locales/es/messages.json new file mode 100644 index 0000000..b71d31a --- /dev/null +++ b/chrome/_locales/es/messages.json @@ -0,0 +1,28 @@ +{ + "extDescription": { + "message": "Bloquea los anuncios de Twitch.tv.", + "description": "La descripción de la extensión." + }, + "toggleAdblocker": { + "message": "Bloquear anuncios Off / On" + }, + "toggleBlockingAds": { + "message": "Mensaje de \"Bloqueando anuncios\" Off / On", + "description": "Activa/desactiva el mensaje de 'Bloqueando anuncios...'" + }, + "reloadTabsWarning": { + "message": "Cada vez que cambies alguna configuracion, deberás recargar la(s) pestaña(s) de Twitch." + }, + "popupReminder": { + "message": "Puedes acceder a estas configuraciónes en cualquier momento haciendo clic en el icono de la extensión" + }, + "installThanks": { + "message": "¡Gracias por instalar Twitch Adblock!" + }, + "disableOtherAdblockers": { + "message": "Con el fin de proporcionar una funcionalidad completa, asegúrese de deshabilitar cualquier otro bloqueador de anuncios para Twitch." + }, + "blockingAds":{ + "message": "Bloqueando anuncios..." + } +} \ No newline at end of file diff --git a/chrome/_locales/fr/messages.json b/chrome/_locales/fr/messages.json new file mode 100644 index 0000000..b6d3978 --- /dev/null +++ b/chrome/_locales/fr/messages.json @@ -0,0 +1,28 @@ +{ + "extDescription": { + "message": "Bloque les publicités de Twitch.tv.", + "description": "La description de l'extension." + }, + "toggleAdblocker": { + "message": "Bloquer les publicités Off / On" + }, + "toggleBlockingAds": { + "message": "Message de \"Blocage des publicités\" Off / On", + "description": "Active/désactive le message de 'Blocage des publicités...'" + }, + "reloadTabsWarning": { + "message": "Chaque fois que vous modifiez un paramètre, vous devez recharger le(s) onglet(s) Twitch." + }, + "popupReminder": { + "message": "Vous pouvez accéder à ces paramètres à tout moment en cliquant sur l'icône d'extension" + }, + "installThanks": { + "message": "Merci d'avoir installé Twitch Adblock !" + }, + "disableOtherAdblockers": { + "message": "Afin d'assurer une fonctionnalité complète, veillez à désactiver tout autre bloqueur de publicité pour Twitch." + }, + "blockingAds":{ + "message": "Blocage des publicités..." + } +} \ No newline at end of file diff --git a/chrome/_locales/pt_BR/messages.json b/chrome/_locales/pt_BR/messages.json new file mode 100644 index 0000000..48e5e5e --- /dev/null +++ b/chrome/_locales/pt_BR/messages.json @@ -0,0 +1,28 @@ +{ + "extDescription": { + "message": "Bloquear anúncios nas transmissões da Twitch.tv.", + "description": "A descrição da extensão." + }, + "toggleAdblocker": { + "message": "Bloquear anúncios" + }, + "toggleBlockingAds": { + "message": "Aviso de \"Bloqueando anúncios\"", + "description": "Ativar ou desativar a mensagem 'Bloqueando anúncios...'" + }, + "reloadTabsWarning": { + "message": "Sempre que você alterar uma configuração da extensão, você vai precisar recarregar a(s) guia(s) da Twitch." + }, + "popupReminder": { + "message": "Você pode acessar as configurações a qualquer momento apenas clicando no ícone da extensão" + }, + "installThanks": { + "message": "Obrigado por usar o Twitch Adblock!" + }, + "disableOtherAdblockers": { + "message": "Para a extensão funcionar corretamente, desative outros bloqueadores de anúncio para a Twitch." + }, + "blockingAds":{ + "message": "Bloqueando anúncios..." + } +} \ No newline at end of file diff --git a/chrome/manifest.json b/chrome/manifest.json index 1e67f23..d352179 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -1,5 +1,5 @@ { - "description": "Blocks Ads on Twitch.tv.", + "description": "__MSG_extDescription__", "manifest_version": 3, "name": "Twitch Adblock", "version": "5.4.0", @@ -34,5 +34,6 @@ "web_accessible_resources": [{ "resources": ["remove_video_ads.js"], "matches": ["https://*.twitch.tv/*"] - }] + }], + "default_locale": "en" } diff --git a/chrome/popup/index.html b/chrome/popup/index.html index 4152313..2929043 100644 --- a/chrome/popup/index.html +++ b/chrome/popup/index.html @@ -89,20 +89,21 @@
- Twitch Adblocker Off / On + Twitch Adblocker Off / On
- "Blocking Ads" message Off / On + "Blocking Ads" message Off / On +
-Whenever you change a setting, you have to reload the Twitch tab(s).
+Whenever you change a setting, you have to reload the Twitch tab(s).
diff --git a/chrome/popup/install.html b/chrome/popup/install.html index 181d1ee..63f04eb 100644 --- a/chrome/popup/install.html +++ b/chrome/popup/install.html @@ -88,23 +88,23 @@
Thank you for installing Twitch Adblock!
-In order to provide full functionality, please make sure that you disable any other Adblocker for Twitch.
+Thank you for installing Twitch Adblock!
+In order to provide full functionality, please make sure that you disable any other Adblocker for Twitch.
- Twitch Adblocker Off / On + Twitch Adblocker Off / On
- "Blocking Ads" message Off / On + "Blocking Ads" message Off / On
-You can access these settings at any time by clicking on the extension icon.
+You can access these settings at any time by clicking on the extension icon
diff --git a/chrome/popup/popupjs.js b/chrome/popup/popupjs.js index 1b88dd8..15c7737 100644 --- a/chrome/popup/popupjs.js +++ b/chrome/popup/popupjs.js @@ -50,4 +50,11 @@ function restoreOptions() { }); } -document.addEventListener('DOMContentLoaded', restoreOptions); \ No newline at end of file +document.addEventListener('DOMContentLoaded', restoreOptions); + +// internacionalization (https://stackoverflow.com/questions/25467009/internationalization-of-html-pages-for-my-google-chrome-extension) + +document.querySelectorAll('[data-i18n]').forEach(elem => { + elem.innerText = chrome.i18n.getMessage(elem.dataset.i18n) +}) + \ No newline at end of file diff --git a/chrome/remove_video_ads.js b/chrome/remove_video_ads.js index 0ae1b20..be0f589 100644 --- a/chrome/remove_video_ads.js +++ b/chrome/remove_video_ads.js @@ -135,7 +135,7 @@ window.Worker = class Worker extends oldWorker { if (adBlockDiv == null) { adBlockDiv = getAdBlockDiv(); } - adBlockDiv.P.textContent = 'Blocking ads...'; + adBlockDiv.P.textContent = chrome.i18n.getMessage("blockingAds"); adBlockDiv.style.display = 'block'; } else if (e.data.key == 'HideAdBlockBanner') { if (adBlockDiv == null) {