Closed Bug 1443068 Opened 7 years ago Closed 7 years ago

Unable to test localization of add-on

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1440969

People

(Reporter: birtles, Unassigned)

Details

This is a report that came from our Web Extensions developer meetup in Tokyo last week. According to [1] it should be possible to test an add-on is localized by setting the intl.locale.requested pref (nee general.useragent.locale) and restarting the browser. However, a number of people have tried this and reported that: 1. The title and description of the add-on as reported in about:addons are indeed localized. 2. The text used in the notification of the notify-link-clicks-i18n add-on is not. I have just tried this and can confirm that the notification text is not localized (despite the add-on clearly having the localized string). I'm marking this as a regression since I presume this worked at the point when the MDN page was written. (I should also mention that we need to update that MDN page since it assumes the intl.locale.requested is there, but it's not added by default. Users may need to add that key. I'll make that edit in a moment. Also, intl.locale.matchOS was not there for me so I didn't add it when I tested.) [1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization#Testing_out_your_extension
(In reply to Brian Birtles (:birtles) from comment #0) > I'm marking this as a regression since I presume this worked at the point > when the MDN page was written. No, this has never worked. We choose the add-on locale based on the closest match to the current browser locale. If there isn't a matching browser langpack for the locales listed in intl.locale.requested, it has no effect. That's been the case as long as that pref has existed. Apparently the add-on manager uses a different locale selection method, though.
So the MDN edit that updated the pref name was incorrect and we should just drop that whole section about being able to test localizations?
I'm working on making it easier to test add-on locales independent of Firefox locales. (bug 1440969) and I am documenting locale selection including for testing purposes (bug 1438687)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
(In reply to Kris Maglione [:kmag] (long backlog; ping on IRC if you're blocked) from comment #1) > Apparently the add-on manager uses a different locale selection method, > though. For posterity: https://searchfox.org/mozilla-central/rev/d2b4b40901c15614fad2fa34718eea428774306e/toolkit/mozapps/extensions/internal/XPIProvider.jsm#4868-4873 vs https://searchfox.org/mozilla-central/rev/d2b4b40901c15614fad2fa34718eea428774306e/toolkit/components/extensions/Extension.jsm#1532-1535 It does feel weird that these are so different...
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.