-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated advice on testing localizations #11381
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -392,21 +392,11 @@ padding-left: 1.5em; | |
|
||
## Testing out your extension | ||
|
||
Starting in Firefox 45, you can [install extensions temporarily from disk](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox). Do this, and then try testing out our [notify-link-clicks-i18n](https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n) extension. Go to one of your favorite websites and click a link to see if a notification appears reporting the URL of the clicked link. | ||
To test your extension's localization, you use the public release of Firefox or [Firefox beta](https://www.mozilla.org/en-US/firefox/channel/desktop/), the versions of Firefox in which you can install language packs. | ||
|
||
Next, change Firefox's locale to one supported in the extension that you want to test. | ||
Then, for each language you want to test, follow the instructions to [Use Firefox in another language](https://support.mozilla.org/en-US/kb/use-firefox-another-language) to switch the Firefox UI language. (If you know your way around Settings, under Language, use Set Alternatives.) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, updated |
||
|
||
1. Open "about:config" in Firefox, and search for the `intl.locale.requested` preference (bear in mind that before Firefox 59, this pref is called `general.useragent.locale`). | ||
2. If the preference exists, double-click it (or press Return/Enter) to select it, enter the language code for the locale you want to test, then click "OK" (or press Return/Enter). For example in our example extension, "en" (English), "de" (German), "nl" (Dutch), and "ja" (Japanese) are supported. You can also set the value to an empty string (`""`), which will cause the browser to use the OS default locale. | ||
3. If the `intl.locale.requested` preference does not exist, right-click the list of preferences (or activate the context menu using the keyboard), and choose "New" followed by "String". Enter `intl.locale.requested` for the preference name and, "de", or "nl", etc. for the preference value, as described in step 2 above. | ||
4. Search for `intl.locale.matchOS` and, if the preference exists and has the value `true`, double-click it so that it is set to `false`. | ||
5. Restart your browser to complete the change. | ||
Once Firefox is running in your test language, [install the extension temporarily](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox). If you've set up your extension correctly, you see the extension listed with its icon, name, and description in the chosen language. Now exercise the extension's features to ensure the translations you need are in place. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's mention about:addons and about:debugging as two places that the developer can easily and quickly check that the localized manifest properties are being localized as expected in the Firefox UI. |
||
|
||
> **Note:** This works to change the browser's locale, even if you haven't got the [language pack](https://addons.mozilla.org/en-US/firefox/language-tools/) installed for that language. You'll just get the browser UI in your default language if this is the case. | ||
If you'd like to try this process out, you can use the [notify-link-clicks-i18n](https://github.com/mdn/webextensions-examples/tree/master/notify-link-clicks-i18n) extension. Set up Firefox to display one of the languages supported in this example (German, Dutch, or Japanese). Load the extension and go to a website. Click a link to see the translated version of the notification reporting the link's URL. | ||
|
||
> **Note:** To change the result of `getUILanguage` the language pack is required, since it reflects the browser UI language and not the language used for extension messages. | ||
|
||
Load the extension temporarily from disk again, then test your new locale: | ||
|
||
- Visit "about:addons" again — you should now see the extension listed, with its icon, plus name and description in the chosen language. | ||
- Test your extension again. In our example, you'd go to another website and click a link, to see if the notification now appears in the chosen language. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that "public release of Firefox" is how we usually refer to those release channels, an alternative rewording that I can think of right now is:
We may also link Firefox to https://www.mozilla.org/en-US/firefox/new/ (mainly for consistency with linking Firefox Beta to https://www.mozilla.org/en-US/firefox/channel/desktop/).
Similarly "versions of Firefox" makes me think to the version number (95, 96 etc), while in this case we refer to release channels more than versions.
How about:
Or maybe just omit that part and just proceed with the next paragraph that describes how to switch language in this builds.
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point with regard to the reference to versions. I do, however, think it's useful to mention the reason for testing in these builds, so I think it's worth retaining the mention of language packs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, sgtm, let's keep a mention to the motivations.