Why doesn't my i18n work?

So I’m having an interesting issue. I set up i18n on my add-on and it’s working for Chrome, but not on Firefox. When I first set it up, it was working when I tested on Firefox.

I’m trying to test Dutch, since it’s the only localization I currently have for the add-on. I’ve set the intl.locale.requested preference in about:config and restart Firefox, but it doesn’t want to work. I’ve also checked and the preference to use the OS language is set to false.

The add-on is displaying in English, even though I added nl to the front of the preference. Interestingly, if I run browser.i18n.getAcceptedLanguages() in the debugger, nl is the first item in the array. I’ve even tried removing all of the other locales from the preference.

Since it’s working in Chrome and was previously working on Firefox, I’m inclined to believe it’s a settings issue, although I’ve tried on two different versions of Firefox running two different profiles and it still didn’t work.

Repo: https://github.com/WesleyBranton/Custom-Scrollbar/tree/master/src

For me it works if I change the language of whole Firefox in the settings:

It’s weird because it does indeed show up in Dutch if I set my interface language to Dutch. When I add Dutch to the top of the list in the Webpage Language Settings option but leave the interface as English, it does not translate.

Interestingly, I actually does translate the short add-on description on the about:addons page when I have the intl.locale.requested preference set, but it doesn’t translate the options page.

I checked the sample project that’s on the MDN page and it seems to have the same behaviour.

Maybe this is a case of i18n not working properly in Firefox or maybe the MDN documentation for internationalization is no longer correct? I do see bug 1475876 says that JavaScript files will not use the intl.locale.requested preference, but surely that’s not the expected behaviour for add-ons.

Yeah, the behavior was changing over time and I wouldn’t be surprised to see outdated MDN. Especially considering i18n being not exactly “sexy” topic :slight_smile:.

I was using some “about:config” hack before as well, but it got broken and I was unable to find a solution.
So I’ve just installed Firefox ESR version and I test the languages there (plus that way I test also ESR compatibility :slight_smile: ).