Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 8dee2fe0 by Pier Angelo Vendrame at 2022-12-20T13:37:39+00:00 Bug 40679: Always use the latest available translations for nightly builds
- - - - - 42660210 by Pier Angelo Vendrame at 2022-12-20T13:37:39+00:00 Bug 40713: Inject torbutton translations during the build
Co-authored-by: Nicolas Vigier <boklm@torproject.org>
- - - - -
12 changed files:
- .gitlab/issue_templates/Release Prep - Alpha.md - 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
Changes:
===================================== .gitlab/issue_templates/Release Prep - Alpha.md ===================================== @@ -125,16 +125,11 @@ Tor Browser Alpha (and Nightly) are on the `main` branch, while Stable lives in - [ ] Update `projects/firefox/config` - [ ] `git_hash` : update the `$(BUILD_N)` section to match `tor-browser` tag - [ ] ***(Optional)*** `var/firefox_platform_version` : update to latest `$(ESR_VERSION)` if rebased - - [ ] Update `projects/translation-base-browser/config` - - [ ] `git_hash` : update with `HEAD` commit of project's `base-browser` branch - - [ ] Update `projects/translation-base-browser-fluent/config` - - [ ] `git_hash` : update with `HEAD` commit of project's `basebrowser-newidentityftl` branch -- [ ] ***(Optional)*** Update Android-specific build configs - - [ ] ***(Optional)*** Update `projects/geckoview/config` - - [ ] `git_hash` : update the `$(BUILD_N)` section to match `tor-browser` tag - - [ ] ***(Optional)*** `var/geckoview_version` : update to latest `$(ESR_VERSION)` if rebased - - [ ] Update `projects/tba-translations/config`: - - [ ] `git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch + - [ ] Update `projects/translation/config`: + - [ ] `steps/base-browser/git_hash` : update with `HEAD` commit of project's `base-browser` branch + - [ ] `steps/base-browser-fluent/git_hash` : update with `HEAD` commit of project's `basebrowser-newidentityftl` branch + - [ ] `steps/tor-browser/git_hash` : update with `HEAD` commit of project's `tor-browser` branch + - [ ] `steps/fenix/git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch - [ ] ***(Optional)*** Update `projects/tor-android-service/config` - [ ] `git_hash` : update with `HEAD` commit of project's `main` branch - [ ] ***(Optional)*** Update `projects/application-services/config`:
===================================== 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: 462686c5f3fc57ba17ea8804c76e425682ed522f -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: 55b370953218b77f3bee6fc7b819bc8c9a7bb699 -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: 7bcd63fc23945231facd75d1316c534c12f08a31 -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: f3c816f0fde87471f98e46515482a493c4eb57dc + 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: 4cd0600f352a6883462dbdc1b59119a0a946be10 + 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: 34fb5d37834db13ec656e43d2fe7cee41d90ec35 + targets: + nightly: + git_hash: 'fenix-torbrowserstringsxml'
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/f...