Mobile/Fennec/Android/Multilocale Builds: Difference between revisions

< Mobile‎ | Fennec‎ | Android
(Created page with "Firefox for Android provides a locale switching system (which allows you to override the system locale). We ship with a large number of locales, however local builds default t...")
 
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Firefox for Android provides a locale switching system (which allows you to override the system locale). We ship with a large number of locales, however local builds default to only including en-US. Here's a guide for building an apk with multiple locales locally. (Nightly and release builds are built with all locales included.)
'''This documentation has moved in-tree''': http://searchfox.org/mozilla-central/source/build/docs/locales.rst. Those docs are owned by the l10n team and should be up-to-date.


A list of all the supported locales can be found at:
Notes (mcomella):
http://hg.mozilla.org/l10n-central
* The other docs don't specify but I wonder if you need to do non-artifact builds.
* gradle builds were failing when I had a multi-locale (and non-artifact) build configured


 
== Archives ==
== Build recipe ==
For older documentation:
* Grab a copy of mozilla-central (or use an existing checkout)
* View revisions of this page older than 2017/10/3
* Decide on the locales you desire, e.g. "ar zh-CN zh-TW pl de" (en-US will be included automatically), for simplicity dump these into a file called "multicocale-langs".
* [http://160.twinql.com/building-and-testing-multi-locale-firefox-for-android/ The original guide on :rnewman's blog]
* Download localisation repos: you can use the following script to do so:
  MOZILLA_CENTRAL=~/moz/hg/mozilla-central # edit to reflect current clone
  L10NBASEDIR=~/moz/hg/l10n # edit to reflect where your l10n checkouts will go
 
  LOCALES=$MOZILLA_CENTRAL/multilocale-conf
  mkdir -P $L10NBASEDIR
  pushd $L10NBASEDIR
  while read loc; do if ! [ -d "$loc" ]; then hg clone "http://hg.mozilla.org/releases/l10n/mozilla-aurora/$loc"; fi; done < $LOCALES
* set up your mozconfig to include the following:
** Note: only full (non-artifact builds are supported)
  mk_add_options 'export MOZ_CHROME_MULTILOCALE=en-US ar zh-CN zh-TW de pl' # start with en-US, and add your desired locales from (2)
  # Use absolute paths.
  mk_add_options 'export L10NBASEDIR=/Users/andrzejhunt/ff/hg/l10n' # should match L10NBASEDIR from earlier
  ac_add_options --with-l10n-base=/Users/andrzejhunt/ff/hg/l10n
* build using |mach build|
* build and merge the localisations:
** edit the list below to include all your desired locales (do NOT include en-US, that was already built during |mach build|)
  for loc in ar pl de zh-TW; do  make -C objdir-frontend/mobile/android/locales merge-$loc LOCALE_MERGEDIR=/Users/andrzejhunt/ff/fx3/objdir-frontend/merge-$loc; make -C objdir-frontend/mobile/android/locales chrome-$loc LOCALE_MERGEDIR=/Users/andrzejhunt/ff/fx3/objdir-frontend/merge-$loc; done && ./mach package
* |mach package| && |mach install| to test
 
== Additional notes ==
* The l10n-central locales can be out of date (i.e. will be missing some strings). The merge-$loc step merges locales with en-US, i.e. en-US strings will be used as a fallback for missing strings.
** Locales that are complete therefore don't require the merge-$loc step, however as of writing only 6 locales were actually complete (missing strings will result in |mach package| failing due to xml errors / missing entities).
** But chrome-$loc is still needed for every locale.
** But aurora/beta/release builds usually won't need merge-$loc
 
The original multilocale guide can be found on Richard Newman's blog at http://160.twinql.com/building-and-testing-multi-locale-firefox-for-android/ . That blog also contains a plethora of other postings discussing multilocale support.

Latest revision as of 18:32, 3 October 2017

This documentation has moved in-tree: http://searchfox.org/mozilla-central/source/build/docs/locales.rst. Those docs are owned by the l10n team and should be up-to-date.

Notes (mcomella):

  • The other docs don't specify but I wonder if you need to do non-artifact builds.
  • gradle builds were failing when I had a multi-locale (and non-artifact) build configured

Archives

For older documentation: