Pier Angelo Vendrame pushed to branch maint-12.0 at The Tor Project / Applications / tor-browser-build
Commits: 68b589f8 by Pier Angelo Vendrame at 2023-01-12T08:53:32+01:00 Bug 40713: Inject torbutton translations during the build
Co-authored-by: Nicolas Vigier <boklm@torproject.org>
- - - - -
12 changed files:
- projects/fenix/build - projects/fenix/config - projects/firefox/build - projects/firefox/config - − projects/tba-translation/config - − projects/translation-base-browser-fluent/build - − projects/translation-base-browser-fluent/config - − projects/translation-base-browser/build - − projects/translation-base-browser/config - projects/tba-translation/build → projects/translation/build - + projects/translation/config - + tools/get-translation-hashes
Changes:
===================================== projects/fenix/build ===================================== @@ -32,7 +32,7 @@ EOF nimbusdir=$builddir-[% c("version") %]/app/build/bin/nimbus mkdir -p $nimbusdir cp $distdir/application-services/nimbus-fml $nimbusdir/ - tar -C $distdir -xf $rootdir/[% c('input_files_by_name/tba-translation') %] + tar -C $distdir -xf $rootdir/[% c('input_files_by_name/translation-fenix') %] [% END %] tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
@@ -60,7 +60,7 @@ v=[% c("variant") %] [% FOREACH lang = c('var/locales_mobile'); SET lang = tmpl(lang); %] # Copy our torbrowser_strings.xml at the right place - cp /var/tmp/dist/tba-translation/[% lang %]/torbrowser_strings.xml app/src/main/res/values-[% lang %]/ + cp /var/tmp/dist/translation-fenix/[% lang %]/torbrowser_strings.xml app/src/main/res/values-[% lang %]/ [% END %]
# Prepare Glean dependencies for offline build
===================================== projects/fenix/config ===================================== @@ -46,8 +46,9 @@ input_files: project: geckoview pkg_type: merge_aars enable: '[% !c("var/android_single_arch") %]' - - name: tba-translation - project: tba-translation + - name: translation-fenix + project: translation + pkg_type: fenix - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]' name: gradle-dependencies exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
===================================== projects/firefox/build ===================================== @@ -62,6 +62,10 @@ mkdir -p $distdir/[% IF ! c("var/macos") %]Browser[% END %]
tar -xf $rootdir/[% c('input_files_by_name/translation-base-browser') %] transl_base_browser=$rootdir/translation-base-browser +[% IF c("var/tor-browser") -%] + tar -xf $rootdir/[% c('input_files_by_name/translation-tor-browser') %] + transl_tor_browser=$rootdir/translation-tor-browser +[% END -%]
cd /var/tmp/build/[% project %]-[% c("version") %] cat > .mozconfig << 'MOZCONFIG_EOF' @@ -108,11 +112,6 @@ add_translation () { component=$2 lang=$3 filename=$4 - [% IF c("var/macos") -%] - if [ "$lang" == "ja-JP-mac" ]; then - lang="ja" - fi - [% END-%]
mkdir "browser/components/$component/locale/$lang" cp "$transl_dir/$lang/$filename" "browser/components/$component/locale/$lang/" @@ -121,9 +120,25 @@ add_translation () { }
supported_locales="[% tmpl(c('var/locales').join(' ')) %]" +[% IF c("var/tor-browser") -%] + torbutton_locales="toolkit/torbutton/chrome/locale/" + torbutton_jar="toolkit/torbutton/jar.mn" +[% END -%] for lang in $supported_locales; do + [% IF c("var/macos") -%] + if [ "$lang" == "ja-JP-mac" ]; then + lang="ja" + fi + [% END-%] + add_translation $transl_base_browser newidentity $lang newIdentity.properties add_translation $transl_base_browser securitylevel $lang securityLevel.properties + + [% IF c("var/tor-browser") -%] + mv "$transl_tor_browser/$lang" "$torbutton_locales/" + echo "% locale torbutton $lang %locale/$lang/" >> "$torbutton_jar" + echo " locale/$lang (chrome/locale/$lang/*)" >> "$torbutton_jar" + [% END -%] done
rm -f configure
===================================== projects/firefox/config ===================================== @@ -181,11 +181,17 @@ input_files: enable: '[% c("var/linux") %]' - filename: start-firefox enable: '[% c("var/linux") %]' - - project: translation-base-browser + - project: translation name: translation-base-browser - - project: translation-base-browser-fluent + pkg_type: base-browser + - project: translation name: translation-base-browser-fluent + pkg_type: base-browser-fluent enable: '[% !c("var/testbuild") %]' + - project: translation + name: translation-tor-browser + pkg_type: tor-browser + enable: '[% c("var/tor-browser") %]' - filename: namecoin-torbutton.patch enable: '[% c("var/namecoin") %]' # TorButton patch authored by Arthur Edelstein, from https://github.com/arthuredelstein/torbutton/ branch 2.1.10-namecoin
===================================== projects/tba-translation/config deleted ===================================== @@ -1,7 +0,0 @@ -# vim: filetype=yaml sw=2 -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' -git_url: https://gitlab.torproject.org/tpo/translation.git -# We need to bump the commit before releasing but just pointing to a branch -# might cause too much rebuidling of the Firefox part. -git_hash: 34fb5d37834db13ec656e43d2fe7cee41d90ec35 -version: '[% c("abbrev") %]'
===================================== projects/translation-base-browser-fluent/build deleted ===================================== @@ -1,10 +0,0 @@ -#!/bin/bash -[% c("var/set_default_env") -%] -tar xf [% project %]-[% c("version") %].tar.gz -mv [% project %]-[% c("version") %] [% project %] -# We do not need new identity for now, only languageNotification.ftl -find [% project %] -name new-identity.ftl -delete -[% c('tar', { - tar_src => [ project ], - tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), - }) %]
===================================== projects/translation-base-browser-fluent/config deleted ===================================== @@ -1,9 +0,0 @@ -# vim: filetype=yaml sw=2 -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' -git_url: https://gitlab.torproject.org/tpo/translation.git -git_hash: e1bb5278668e71317ccbf1fdd21cf25c4d56b95c -version: '[% c("abbrev") %]' - -targets: - nightly: - git_hash: 'basebrowser-newidentityftl'
===================================== projects/translation-base-browser/build deleted ===================================== @@ -1,8 +0,0 @@ -#!/bin/bash -[% c("var/set_default_env") -%] -tar xf [% project %]-[% c("version") %].tar.gz -mv [% project %]-[% c("version") %] [% project %] -[% c('tar', { - tar_src => [ project ], - tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), - }) %]
===================================== projects/translation-base-browser/config deleted ===================================== @@ -1,5 +0,0 @@ -# vim: filetype=yaml sw=2 -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' -git_url: https://gitlab.torproject.org/tpo/translation.git -git_hash: f3c816f0fde87471f98e46515482a493c4eb57dc -version: '[% c("abbrev") %]'
===================================== projects/tba-translation/build → projects/translation/build ===================================== @@ -1,8 +1,9 @@ #!/bin/bash [% c("var/set_default_env") -%] tar xf [% project %]-[% c("version") %].tar.gz -mv [% project %]-[% c("version") %] [% project %] +mv [% project %]-[% c("version") %] [% project %]-[% c("step") %] +[% SET tar_source = project _ '-' _ c('step') -%] [% c('tar', { - tar_src => [ project ], + tar_src => [ tar_source ], tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'), }) %]
===================================== projects/translation/config ===================================== @@ -0,0 +1,32 @@ +# vim: filetype=yaml sw=2 +filename: '[% project %]-[% c("step") %]-[% c("version") %]-[% c("var/build_id") %].tar.gz' +git_url: https://gitlab.torproject.org/tpo/translation.git +version: '[% c("abbrev") %]' + +steps: + base-browser: + base-browser: '[% INCLUDE build %]' + git_hash: d1aa584f3da4c2fc6bfe5d289e2783705ee7e015 + targets: + nightly: + git_hash: 'base-browser' + base-browser-fluent: + base-browser-fluent: '[% INCLUDE build %]' + git_hash: d771fd689978f52053e8a14bb622c936aa938769 + targets: + nightly: + git_hash: 'basebrowser-newidentityftl' + tor-browser: + tor-browser: '[% INCLUDE build %]' + git_hash: a73ed9756f5d9a753fb7c3c7676174e4d9b68dee + targets: + nightly: + git_hash: 'tor-browser' + fenix: + fenix: '[% INCLUDE build %]' + # We need to bump the commit before releasing but just pointing to a branch + # might cause too much rebuidling of the Firefox part. + git_hash: 5e1d058123f3a5d34a59799bd6f80db5d71e563e + targets: + nightly: + git_hash: 'fenix-torbrowserstringsxml'
===================================== tools/get-translation-hashes ===================================== @@ -0,0 +1,13 @@ +#!/bin/bash + +cd "$(dirname "$0")/../git_clones/translation" +git fetch > /dev/null 2>&1 + +echo -n "base-browser: " +git rev-parse origin/base-browser +echo -n "base-browser-fluent: " +git rev-parse origin/basebrowser-newidentityftl +echo -n "tor-browser: " +git rev-parse origin/tor-browser +echo -n "fenix: " +git rev-parse origin/fenix-torbrowserstringsxml
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/68...
tbb-commits@lists.torproject.org