The majority of the work has already been completed when setting up Nightly builds. There are a few prerequisites before adding a new locale to Beta and Release:
- Localization should have reached a good level of completion, especially for user facing parts of the UI.
- Localization team has demonstrated a consistent effort, being able to keep up for at least a couple of cycles with the incoming flow of new strings.
- L10n-drivers have performed testing of the builds on different operative systems without identifying critical issues.
- There is a relevant number of users on the Nightly channel. This number varies based on the language, for minority languages 10-20 users is a good result. Also, a trend showing growth is important as well.
- Set up searchplugins, if configuration was not completed before enabling Nightly builds.
- Make sure that
toolkit/defines.inchas the correct value, since it’s used to set up the language pack on AMO.
To track this work, you need to file a bug in Firefox::Build Config (like this example), blocking the original tracking bug for the locale (
The language name associated to the locale code is displayed in a few places in Firefox interface (language settings for web content, contextual menu for dictionaries). The language name needs to be defined in:
- languageNames.ftl: ID with structure
language-name-LOCALECODE = (name of the language in English). Note that the locale code can only be a 2/3 letter code, locales like
ca-valenciaare not valid.
- mozIntl.jsm: add the locale code in the
- language.properties: add a value in the form
LOCALECODE.accept = true. This is needed to list the language in the language settings dialog for web content.
First of all make sure that your environment is correctly set up, update your local mozilla-unified clone and make sure it’s on the
$ cd ~/mozilla/mercurial/mozilla-unified $ hg pull -u $ hg up central
The file to modify is in
browser/locales/shipped-locales, open it with your text editor of choice.
$ atom browser/locales/shipped-locales
And add the new locale to the list. With Atom and the Sort Lines package installed, you can press
F5 to make sure that the list is in alphabetical order.
After you’ve finished editing the file, check the status of the repository, and the diff. Let’s consider for example the task of adding Urdu (ur).
$ hg status M browser/locales/shipped-locales $ hg diff --- a/browser/locales/shipped-locales +++ b/browser/locales/shipped-locales @@ -83,14 +84,13 @@ son te th tr uk +ur uz vi xh zh-CN
hg status indicates that the file has been modified,
hg diff that the line has been added. Follow the instructions available in this document to create a patch, submit it for review, and land it.
You also need to set the
relnote-firefox flag to
? in the bug, the suggested comment is
Suggested for release notes: "Locale added: LANGUAGE_NAME (LOCALE_CODE)".
The language pack for the new locale will be uploaded automatically by release automation on addons.mozilla.org (starting with the Beta version). A few follow-up manual steps are needed:
Mozillaaccount needs to be added as author for the language pack.
target_localefield needs to be set for the language pack (via Django admin UI).
For the first two steps, an email needs to be sent to AMO administrators (amo-admins(at)mozilla.com).
These steps will make the language pack available in both the Language Tools page and the API used by Firefox to add new languages from preferences.