commit 524a9364ead98593507f8f881cc1aa9764945324 Author: Georg Koppen gk@torproject.org Date: Wed Dec 5 10:14:05 2018 +0000
Bug 26843: Adding multi-locale support for Tor Browser for Android --- projects/firefox/build | 12 +++++++++++- projects/firefox/config | 3 +++ projects/firefox/mozconfig-android-armv7 | 1 + projects/tor-browser/build.android | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/projects/firefox/build b/projects/firefox/build index e81ecfe..f631ec5 100644 --- a/projects/firefox/build +++ b/projects/firefox/build @@ -3,6 +3,9 @@ [% c("var/set_default_env") -%] [% IF c("var/android") %] export GRADLE_MAVEN_REPOSITORIES="file://$rootdir/[% c('input_files_by_name/gradle-dependencies') %]" + # Prepare building the multi-locale .apk + mkdir -p /var/tmp/dist/locales + tar -C /var/tmp/dist/locales -xf $rootdir/[% c('input_files_by_name/firefox-locale-bundle') %] [% END -%]
[% IF c("var/windows") -%] @@ -154,7 +157,14 @@ rm -f js/src/configure ./mach build --verbose
[% IF c("var/android") %] - ./mach package + # Building a multi-locale .apk + [% FOREACH lang = c('var/locales') %] + [% SET lang = tmpl(lang) %] + ./mach build chrome-[% lang %]; + [% END %] + export MOZ_CHROME_MULTILOCALE='[% tmpl(c('var/locales').join(' ')) %]' + AB_CD=multi ./mach package + # Copy the result over and return. There is nothing more to do for mobile. cp obj-*/dist/*unsigned-unaligned.apk [% dest_dir _ '/' _ c('filename') %]/tor-browser-unsigned-unaligned.apk [% RETURN %] [% END %] diff --git a/projects/firefox/config b/projects/firefox/config index 81416a2..314326f 100644 --- a/projects/firefox/config +++ b/projects/firefox/config @@ -135,3 +135,6 @@ input_files: - project: orbot name: orbot enable: '[% c("var/android") %]' + - project: firefox-locale-bundle + name: firefox-locale-bundle + enable: '[% c("var/android") %]' diff --git a/projects/firefox/mozconfig-android-armv7 b/projects/firefox/mozconfig-android-armv7 index 0098ea1..8cfcc60 100644 --- a/projects/firefox/mozconfig-android-armv7 +++ b/projects/firefox/mozconfig-android-armv7 @@ -18,6 +18,7 @@ ac_add_options --with-libclang-path=/var/tmp/dist/android-toolchain/android-ndk/ ac_add_options --with-clang-path=/var/tmp/dist/android-toolchain/android-ndk/arm/bin/clang
ac_add_options --with-android-distribution-directory=@TOPSRCDIR@/mobile/android/torbrowser +ac_add_options --with-l10n-base=/var/tmp/dist/locales
if [ -z "${TB_BUILD_WITH_UPDATER}" ]; then # Because Google Play will likely be the primary distribution medium, diff --git a/projects/tor-browser/build.android b/projects/tor-browser/build.android index 24bdc70..b623466 100644 --- a/projects/tor-browser/build.android +++ b/projects/tor-browser/build.android @@ -1,7 +1,7 @@ #!/bin/bash [% c("var/set_default_env") -%] ext_dir=assets/distribution/extensions -qa_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-qa.apk +qa_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk apk=$rootdir/[% c('input_files_by_name/firefox') %]/tor-browser-unsigned-unaligned.apk
mkdir -p /var/tmp/build/$ext_dir [% dest_dir _ '/' _ c('filename') %]