# Changing language of add-on

**URL:** <https://discourse.mozilla.org/t/changing-language-of-add-on/25872>\
**Category:** Development\
**Created:** [February 21, 2018, 7:41pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872 "2018-02-21T19:41:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [February 21, 2018, 7:41pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/1 "2018-02-21T19:41:45Z")

</div>

Hello,

I have trouble changing the language for my add-on [GroupSpeedDial](https://addons.mozilla.org/en-US/firefox/addon/groupspeeddial/).  
I’ve changed `general.useragent.locale` value in `about:config` page to “sk” (for Slovak) but after restarting Firefox only addon short description in `about:addons` page is in Slovak, all other labels are still English.

**I’ve read:**

> **[Internationalization - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization)**
>
> The WebExtensions API has a rather handy module available for internationalizing extensions — i18n. In this article we'll explore its features and provide a practical example of how it works. The i18n system for extensions built using WebExtension...

[https://support.mozilla.org/en-US/questions/1190204](https://support.mozilla.org/en-US/questions/1190204)

> **[Use Firefox in another language | Firefox Help](https://support.mozilla.org/en-US/kb/use-firefox-another-language?redirectslug=use-firefox-interface-other-languages-language-pack&redirectlocale=en-US)**
>
> How to display Firefox in a different language.

I’ve even created new `intl.locale.requested` property with “sk” value and make sure `intl.locale.matchOS` is set to `false`

I’m using 58.0.2 (64-bit). I have also second profile with Firefox Nightly Slovak edition where the Slovak language works fine (in browser and the add-on).

**Is this a bug or I’m doing something wrong?**

---

<div class="post-metadata">

**Author:** ![Pike](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/pike/32/20587_2.png) [@Pike](https://discourse.mozilla.org/u/Pike)\
**Post date:** [February 22, 2018, 12:04pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/2 "2018-02-22T12:04:33Z")

</div>

@zbraniecki is working on that. Let’s see if this sends a ping.

---

<div class="post-metadata">

**Author:** ![Pike](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/pike/32/20587_2.png) [@Pike](https://discourse.mozilla.org/u/Pike)\
**Post date:** [February 23, 2018, 3:20pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/3 "2018-02-23T15:20:05Z")

</div>

Probably didn’t. But then, also, [bugmail flew by](https://bugzilla.mozilla.org/show_bug.cgi?id=1358653#c8).

Does that comment help? Won’t do much good on 58, but on 60?

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [February 23, 2018, 4:35pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/4 "2018-02-23T16:35:27Z")

</div>

Thank you for the link. However that bug seems to be a bit unrelated to the issue I have.

Also I don’t want a new feature, I want the existing feature that is officially documented to be working 🙂

One more question - can I implement switching language in my add-on if I’m using `i18n`? Because I don’t see any method to get a message in specified language or to set a different language.

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [February 23, 2018, 5:26pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/5 "2018-02-23T17:26:40Z")

</div>

> [@juraj.masiar](#):
>
> However that bug seems to be a bit unrelated to the issue I have.

The second paragraph of the linked comment explains how to switch the UI language.

> [@juraj.masiar](#):
>
> Also I don’t want a new feature, I want the existing feature that is officially documented to be working

That official feature is no longer a feature and documentation hasn’t been updated.

> [@juraj.masiar](#):
>
> One more question - can I implement switching language in my add-on if I’m using i18n? Because I don’t see any method to get a message in specified language or to set a different language.

No, all you could do is manually reading the `messages.json` files in your extension and get the strings from there. Shouldn’t be too hard.

---

<div class="post-metadata">

**Author:** ![Baptistou](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@Baptistou](https://discourse.mozilla.org/u/Baptistou)\
**Post date:** [February 24, 2018, 12:53pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/6 "2018-02-24T12:53:12Z")

</div>

> [@juraj.masiar](#):
>
> One more question - can I implement switching language in my add-on if I’m using i18n? Because I don’t see any method to get a message in specified language or to set a different language.

I was also looking for a method to switch language with i18n. Maybe this discussion can help you :

> [@Debug i18n internationalization](https://discourse.mozilla.org/t/debug-i18n-internationalization/22862):
>
> Hello, I am currently adding translations to my addon thanks to [i18n](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/i18n) and sometimes it requires some CSS adjustments because of the variation of phrase and word lengths. For now, if I want to switch the language, I have to rename subfolders inside \_locales each time. Is there an easier way to switch between the different languages? An option to change inside Firefox settings or a variable to modify in JavaScript?

---

<div class="post-metadata">

**Author:** ![laghee](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@laghee](https://discourse.mozilla.org/u/laghee)\
**Post date:** [May 21, 2018, 2:29pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/7 "2018-05-21T14:29:37Z")

</div>

> [@freaktechnik](#):
>
> That official feature is no longer a feature and documentation hasn’t been updated.

This makes it sound like the [documentation here about “Testing out your extension”](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization) is out of date, but I’m not sure that’s what was meant. At any rate, the bugzilla link supplied doesn’t address how to switch locales in the case of testing an extension as a temporary add-on in the browser.

I had the same issue as the OP. When I created a new `intl.locale.requested` property and changed it to “de” for the [notify-link-clicks-i18n](https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n) example, the only strings that were affected were the extension name and description as defined by ` __MSG_extensionName__ ` and ` __MSG_extensionDescription__ `. The `browser.i18n.getMessage` calls to set the pop-up text remained in the default language.

Installing the DE language pack fixed this problem for me, but it took me a while to try that. Maybe this should have been mentioned explicitly in the actual testing steps? Currently it’s mentioned only as a couple of notes:

 ![15](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/5/e/5eaf050bf2923a472399a013a979fc3291a0cc38.png)

The fact that the `getMessage()` calls won’t set the text correctly in the target language if the tester is missing the language pack seems more appropriate as essential information than an aside. Developers less familiar with how locales are resolved may not catch on immediately. (Or maybe it’s just me?? 😊)

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 26, 2018, 7:30am UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/8 "2018-08-26T07:30:29Z")

</div>

How did you found and install language pack? [All language packs](https://addons.mozilla.org/en-US/firefox/language-tools/) seems to be not compatible anymore:  
[https://addons.mozilla.org/en-US/firefox/addon/deutsch-de-language-pack/](https://addons.mozilla.org/en-US/firefox/addon/deutsch-de-language-pack/)

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [August 26, 2018, 12:43pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/9 "2018-08-26T12:43:14Z")

</div>

You can install it in the current release version (61), but it doesn’t seem to do anything:

 ![image](https://us1.discourse-cdn.com/flex001/uploads/mozilla/original/3X/0/9/09e29cea78b3f7e21b4994f42dd64b18ab211555.png)  
The UI is obviously still English (after a restart).

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 26, 2018, 12:58pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/10 "2018-08-26T12:58:50Z")

</div>

That’s odd. Is the 61 last supported version? Because in 62 beta and 63 alpha it says not compatible. Or is the compatibility always only latest stable release?

Anyway when you install the missing language pack, you can then use the `intl.locale.requested` property in `about:config` page to change the language of your add-on (including the UI of the Firefox). Which is what I was looking for in the place!

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [August 26, 2018, 1:14pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/11 "2018-08-26T13:14:29Z")

</div>

Ah, Just activating the language pack (like a theme) should do that …

And it looks loke the language pack is released just-in-time for the current release version, or something: [https://addons.mozilla.org/en-US/firefox/addon/deutsch-de-language-pack/versions/](https://addons.mozilla.org/en-US/firefox/addon/deutsch-de-language-pack/versions/)

---

<div class="post-metadata">

**Author:** ![juraj.masiar](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/juraj.masiar/32/30587_2.png) [@juraj.masiar](https://discourse.mozilla.org/u/juraj.masiar)\
**Post date:** [August 26, 2018, 4:37pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/12 "2018-08-26T16:37:58Z")

</div>

> [@NilkasG](#):
>
> Ah, Just activating the language pack (like a theme) should do that …

Maybe I already screwed my `about:config` 😃 , because it doesn’t work for me unless I set “intl.locale.requested” to “de”.

Regarding the compatibility - why would they use such a restriction for a language pack:

This is from the manifest file:

```
"gecko": {
  "strict_min_version": "61.0", 
  "id": "langpack-de@firefox.mozilla.org", 
  "strict_max_version": "61.*"
}

```

Is there a reason to prevent alpha and beta users to use the language packs? Also now I see what is the source of the bad reviews for the language packs 😃 . Someone should definitely fix that.

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [August 26, 2018, 4:46pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/13 "2018-08-26T16:46:21Z")

</div>

I guess each version needs a specific set of translated strings, so the restriction of one language pack (with one set of strings) to exactly the version it is made for does make sense.  
**But** the language packs should be released earlier, at least for the beta version. It’s not like there usually are tons of strings changing between versions (and I’d hope that missing strings in a pack are handled gracefully anyway).

And the profile I took the screenshot in is a pretty fresh one. Nothing happened there, so you probably _do_ have to use that pref even if you didn’t change it before.

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [August 26, 2018, 5:47pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/14 "2018-08-26T17:47:17Z")

</div>

The pre-release language packs are available on [archive.mozilla.org](http://archive.mozilla.org)

Check out [https://firefox-source-docs.mozilla.org/intl/locale.html#locale-management](https://firefox-source-docs.mozilla.org/intl/locale.html#locale-management) for an in-depth explanation of how languages are chosen for the Firefox UI and why it sometimes just changes and sometimes doesn’t. I also think I’ve heard of some UI being planned for that, but not entirely sure.

Edit: or when nowhere to be found on [archive.mozilla.org](http://archive.mozilla.org) there probably are some langpacks hidden in taskcluster: [https://tools.taskcluster.net/index/gecko.v2](https://tools.taskcluster.net/index/gecko.v2)

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [August 26, 2018, 6:21pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/15 "2018-08-26T18:21:12Z")

</div>

Thanks for the information.

I personally don’t care much about localization. We should all just speak one damn language, use one alphabet, one way to write numbers and dates and use one set of units. Everything else is just a huge waste of resources.  
Bit until everyone agrees with that and realizes it, this UX really isn’t good.

---

<div class="post-metadata">

**Author:** ![Pike](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/pike/32/20587_2.png) [@Pike](https://discourse.mozilla.org/u/Pike)\
**Post date:** [August 28, 2018, 12:44pm UTC](https://discourse.mozilla.org/t/changing-language-of-add-on/25872/16 "2018-08-28T12:44:42Z")

</div>

[https://bugzilla.mozilla.org/show\_bug.cgi?id=1425941](https://bugzilla.mozilla.org/show_bug.cgi?id=1425941) is about changing the UX of changing languages and installing new ones.

Compatibility of language packs is an independent problem, which would require quite some changes to how we build them. Not sure when we’ll get to that.
