m-reimer / languageswitch Goto Github PK
View Code? Open in Web Editor NEWLanguage Switch Add-on for Firefox
License: GNU General Public License v3.0
Language Switch Add-on for Firefox
License: GNU General Public License v3.0
Many thanks for the extension.
Is it possible to add something like a language overlay to the icon, so that you see, which language is selected?
I have allowed languageswitch to run in private windows, but when I try to select an entry in the language list, nothing happens. The click is ignored and the list stays open.
Switching languages works as expected in normal windows.
Firefox: 77.0.1
languageswitch: 2.0.0
Hi,
I noticed an issue on the following website https://www.thetrainline.com/fr It may affect other websites.
When logged in on the website with the addon activated, the top menu is no more visible.
As the addon is deactivated and the page reloaded (CTRL F5), the menu is visible again
Would you consider adding an auto-refresh feature upon language switch?
Hi.
This add-on no more work with firefox 87.0 !
I'm on Fedora Linux 32 X64 bit Cinnamon edition, & my firefox installed from official Fedora repositories ....
Best.
Updated translations for 'da': Danish (dansk):
{
"extensionDescription": {
"message": "Giver mulighed for at ændre sprogidentiteten der sendes til webservere",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "Standard",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "engelsk",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "fransk",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "tysk",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "japansk",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "spansk",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"menuentries_headline": {
"message": "Elementer i Sprogmenuen",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "Felt",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "Værdi",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
"__WET_LOCALE__": { "message": "da" }
}
Hi!
I just tested your extension and after installing it on Firefox 125.0.3 (64 bits - Windows) from https://addons.mozilla.org/fr/firefox/addon/languageswitch/, nothing happened, no new icon appeared.
I tried to "customize the toolbar" but the icon of this extension is not listed.
I tried to restart the browser but nothing chenged.
The addon is correctly listed among the installed & active addons in my browser:
Thanks for the nice simple addon.
It would be good if you could also have different settings depending on the site you are visiting.
For most sites I would like to keep the default language, but some I'd like to read in a different language.
I'm not sure if it would be within scope of this addon, it's just a suggestion. :-)
Your translation have been copied to your clipboard. Paste it here:
Updated translations for 'fr': French (français, langue française):
{
"extensionDescription": {
"message": "Permet de changer l'identifiant de langue envoyé aux serveurs web",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "Defaut",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "Anglais",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "Français",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "Allemand",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "Japonais",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "Espagnol",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"general_headline": {
"message": "Général",
"description": "Headline above the general configuration options",
"hash": "e90d858c95232c95e34b4bb2f25b69e4"
},
"autoreload_label": {
"message": "Rechargement automatique de la page courante",
"description": "Label for the checkbox for enabling autoreload",
"hash": "26802ad9917a0ade59319025480aa5cf"
},
"menuentries_headline": {
"message": "Entrées du menu des langages",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "Etiquette",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "Valeur",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
"__WET_LOCALE__": { "message": "fr" }
}
First, I am no web or addon developer so if this is all nonsense, feel free
to ignore it :-).
I am using 2.9.0 with esr-91. While debugging some other stuff, I noted the
following error in the Browser Console for each request:
Invalid header array: [{name:"Host", value:"www"}, {name:"User-Agent", value:"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0"}, {name:"Accept", value:"image/webp,/"}, {name:"Accept-Language", value:(void 0)}, {name:"Accept-Encoding", value:"gzip, deflate"}, {name:"DNT", value:"1"}, {name:"Connection", value:"keep-alive"}, {name:"Referer", value:"http://www/"}]
Please note the: name:"Accept-Language", value:(void 0)
I tracked it down to this extension. It happens if no specific language is
selected ("Default") and also never had been during the browser session.
As soon as you select any language and go back to "Default" the problem
is gone.
This reason might be that gAcceptLanguage is undefined (until it once
got set and possibly reset) but RewriteAcceptLanguage() only tests
if it's empty (and not if it is undefined). I fixed it here with:
--- background.js.ORI 2021-12-24 09:05:11.000000000 +0100
+++ background.js 2021-12-31 11:28:28.000000000 +0100
@@ -100,7 +100,7 @@
// Header rewrite handler. Rewrites "Accept-Language".
function RewriteAcceptLanguage(e) {
- if (gAcceptLanguage != "") {
+ if (typeof gAcceptLanguage !== 'undefined' && gAcceptLanguage != "") {
e.requestHeaders.forEach(function(header){
if (header.name.toLowerCase() == "accept-language")
header.value = gAcceptLanguage;
Another fix might be:
--- background.js.ORI 2021-12-24 09:05:11.000000000 +0100
+++ background.js 2021-12-31 11:58:38.386200000 +0100
@@ -1,5 +1,5 @@
// Holds the current Accept-Language value
-let gAcceptLanguage;
+let gAcceptLanguage = "";
but I don't know if it might get undefined somewhere else...
Your translation have been copied to your clipboard. Paste it here:
Updated translations for 'nl': Dutch (Nederlands, Vlaams):
{
"extensionDescription": {
"message": "Maakt het mogelijk om de taalidentificatie te veranderen die naar webservers wordt gestuurd",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "Standaard",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "Engels",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "Frans",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "Duits",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "Japans",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "Spaans",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"general_headline": {
"message": "Algemeen",
"description": "Headline above the general configuration options",
"hash": "e90d858c95232c95e34b4bb2f25b69e4"
},
"autoreload_label": {
"message": "Automatisch herladen van huidige pagina bij wisselen",
"description": "Label for the checkbox for enabling autoreload",
"hash": "26802ad9917a0ade59319025480aa5cf"
},
"menuentries_headline": {
"message": "Taal menu opties",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "Label",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "Waarde",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
"__WET_LOCALE__": { "message": "nl" }
}
In the description for this cool add-on I see has avability to override navigator.language but in doesn't work.
Might be this is because https://addons.mozilla.org/ru/firefox/addon/languageswitch/ has only 1.0.3 version but not 1.1?
I added this plugin yesterday. I tried it on many different site but it didn't change language of any site.Help me how to use this extension in mozilla.
Updated translations for 'ru': Russian (Русский):
{
"extensionDescription": {
"message": "Позволяет менять языковой идентификатор отправляемый серверам",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "По умолчанию",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "Английский",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "Французкий",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "Немецкий",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "Японский",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "Испанский",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"general_headline": {
"message": "Основные настройки",
"description": "Headline above the general configuration options",
"hash": "e90d858c95232c95e34b4bb2f25b69e4"
},
"autoreload_label": {
"message": "Автоматически перезагрузить страницу под выбранный язык",
"description": "Label for the checkbox for enabling autoreload",
"hash": "26802ad9917a0ade59319025480aa5cf"
},
"menuentries_headline": {
"message": "Меню значений для подмены",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "Язык",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "Значение",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
"__WET_LOCALE__": { "message": "ru" }
}
Your translation have been copied to your clipboard. Paste it here:
Updated translations for 'id': Indonesian (Bahasa Indonesia):
{
"extensionDescription": {
"message": "Memungkinkan untuk mengubah pengenal bahasa yang dikirim ke server web",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "Default",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "Inggris",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "Perancis",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "Jerman",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "Jepang",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "Spanyol",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"general_headline": {
"message": "Umum",
"description": "Headline above the general configuration options",
"hash": "e90d858c95232c95e34b4bb2f25b69e4"
},
"autoreload_label": {
"message": "Memuat ulang halaman saat ini secara otomatis",
"description": "Label for the checkbox for enabling autoreload",
"hash": "26802ad9917a0ade59319025480aa5cf"
},
"menuentries_headline": {
"message": "Entri menu bahasa",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "Label",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "Nilai",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
"__WET_LOCALE__": { "message": "id" }
}
Like #4, but instead of saving settings per website and adding a configuration widget, feature a checkbox at the bottom of the menu that applies the change to the current tab only.
Changing the preferred language with Language Switch doesn't lead to any languagechange
event.
From the HTML standard: «Fired at the global scope object when the user's preferred languages change.»
It is therefore necessary to set Language Switch language to "default", and then to change the "real" NavigatorLanguage
via intl.accept_languages
in Firefox to test this kind of feature.
I never contributed to a Firefox extension, but I would be happy to help implement this feature.
navigator.languages order is not changed (some websites are not working properly).
Your translation have been copied to your clipboard. Paste it here:
{
"extensionDescription": {
"message": "웹 서버로 보내는 언어 식별자를 변경할 수 있습니다.",
"description": "Description of the extension",
"hash": "098663c971e4d0add100963aa184d584"
},
"menuentryDefault": {
"message": "기본값",
"description": "Menu entry to use browser default setting",
"hash": "229c53203d001a81c6535deec232da82"
},
"menuentryEnglish": {
"message": "영어",
"description": "Menu entry for the English language",
"hash": "648e324401faf8ae90395ce21e894596"
},
"menuentryFrench": {
"message": "프랑스어",
"description": "Menu entry for the French language",
"hash": "09a22929e52b1a0c2d830c4415f09290"
},
"menuentryGerman": {
"message": "독일어",
"description": "Menu entry for the German language",
"hash": "730e124165ee254c3f3c34c40acc10dc"
},
"menuentryJapanese": {
"message": "일본어",
"description": "Menu entry for the Japanese language",
"hash": "ed0730b295dca59e5a09fa843eb87c8d"
},
"menuentrySpanish": {
"message": "에스파냐어",
"description": "Menu entry for the Spanish language",
"hash": "c58ca0cfe7f76c9bef2da8033fd644eb"
},
"general_headline": {
"message": "일반",
"description": "Headline above the general configuration options",
"hash": "e90d858c95232c95e34b4bb2f25b69e4"
},
"autoreload_label": {
"message": "페이지가 변경될 때 자동으로 새로 고침",
"description": "Label for the checkbox for enabling autoreload",
"hash": "26802ad9917a0ade59319025480aa5cf"
},
"menuentries_headline": {
"message": "언어 메뉴 항목",
"description": "Headline above the language entries configuration list",
"hash": "90fd7720b2260141221ab9a175d4d805"
},
"menuitem_label_label": {
"message": "표시 이름",
"description": "Header for the label column in config list",
"hash": "6af54e4f44a97d7e4a804e2e9a2536e5"
},
"menuitem_value_label": {
"message": "값",
"description": "Header for the value column in config list",
"hash": "44e8c8817b22394520de33b6e522a806"
},
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.