Adding a new locale to the multi-locales build

Android has two different types of builds: a multi-locale build that ships in Google Play Store, and a single-locale build (containing only one locale) that is mostly used for testing.

The list of locales included in the multi-locales build is stored inside a file named maemo-locales within Mozilla’s code repositories. Since the goal is to create Nightly builds, the file will be in mozilla-central:

File a bug to add the new locale

You need to file a bug in Firefox for Android::General requesting the new locale (see for example this bug for Serbian). You can use this bug template to make things faster:

  • Update it with the appropriate locale code and language name.
  • Update the target version for Firefox in comment 0.
  • Set the relnote-firefox flag, e.g.
Release Note Request (optional, but appreciated)
[Why is this notable]: New locale
[Suggested wording]: "Locale added: LANGUAGE (ab-CD)"
[Links (documentation, blog post, etc)]:

Creating a patch for build configuration

First of all make sure that your environment is correctly set up, and update your local mozilla-unified clone:

$ cd ~/mozilla/mercurial/mozilla-unified
$ hg pull -r default -u
$ hg update central

The first file to modify is in mobile/android/locales/maemo-locales, open it with your text editor of choice.

$ atom mobile/android/locales/maemo-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. Let’s say for example that you need to add ab-CD to the list of supported locales.

The second file to modify is mobile/android/locales/l10n.toml. This is the beginning of the file:

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

basepath = "../../.."

locales = [

Identify the locales section, and make sure the locale is already listed under the locales section (it should have been added when enabling single locale builds). In the example above, the locale is represented by ab-CD.

Then locate the exclude-multi-locale section, and remove the locale from this list.

After you’ve finished editing the files, check the status of the repository, and the diff.

$ hg status
M mobile/android/locales/maemo-locales

$ hg diff
--- a/mobile/android/locales/maemo-locales
+++ b/mobile/android/locales/maemo-locales
@@ -1,8 +1,9 @@

 diff --git a/mobile/android/locales/l10n.toml b/mobile/android/locales/l10n.toml
 --- a/mobile/android/locales/l10n.toml
 +++ b/mobile/android/locales/l10n.toml
 @@ -9,8 +9,9 @@ locales = [
@@ -9,8 +9,9 @@ exclude-multi-locale = [
  -    "ab-CD",

M in hg status indicates that the file has been modified, + in hg diff that the line has been added, and - means it was removed. Follow the instructions available in this document to create a patch, submit it for review, and land it.

IMPORTANT: an error in a single locale is going to break the multi-locales build for all locales, English included.