[tbb-commits] [builders/tor-browser-build] branch main updated: Bug 40686: Add a temporary project to fetch Fluent tranlations for base-browser

gitolite role git at cupani.torproject.org
Wed Nov 16 13:54:45 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch main
in repository builders/tor-browser-build.

The following commit(s) were added to refs/heads/main by this push:
     new 9deed6f8 Bug 40686: Add a temporary project to fetch Fluent tranlations for base-browser
9deed6f8 is described below

commit 9deed6f8b928a9e7debd7d8bb1ae7f379e0c1be4
Author: Pier Angelo Vendrame <pierov at torproject.org>
AuthorDate: Fri Nov 11 11:00:11 2022 +0100

    Bug 40686: Add a temporary project to fetch Fluent tranlations for base-browser
    
    We are adding a notification to tell users they can change their
    language. It needs new strings, and I have decided to use Fluent for
    them, for a series of reasons.
    
    However, it is the first component to use Fluent, and it needs to be
    translated with Weblate, but we are not moving base-browser to Weblate,
    yet.
    So, we are using another branch on translation.git and we need a new
    project to fetch it, which I am adding with this commit.
    
    Also, I have changed how we manage base-browser translations, and
    transformed the TT for to a bash for, to keep the Firefox build script
    shorter, which is helpful for build debugging sessions.
---
 .gitlab/issue_templates/Release Prep - Alpha.md |  2 ++
 projects/firefox/build                          | 30 +++++++++++++++++--------
 projects/firefox/config                         |  3 +++
 projects/translation-base-browser-fluent/build  | 10 +++++++++
 projects/translation-base-browser-fluent/config |  9 ++++++++
 5 files changed, 45 insertions(+), 9 deletions(-)

diff --git a/.gitlab/issue_templates/Release Prep - Alpha.md b/.gitlab/issue_templates/Release Prep - Alpha.md
index 0291960f..71f49783 100644
--- a/.gitlab/issue_templates/Release Prep - Alpha.md	
+++ b/.gitlab/issue_templates/Release Prep - Alpha.md	
@@ -135,6 +135,8 @@ Tor Browser Alpha (and Nightly) are on the `main` branch, while Stable lives in
   - [ ] ***(Optional)*** `var/geckoview_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
 - [ ] Update `projects/tba-translations/config`:
   - [ ]  `git_hash` : update with `HEAD` commit of project's `fenix-torbrowserstringsxml` branch
 - [ ] ***(Optional)*** Update `projects/tor-android-service/config`
diff --git a/projects/firefox/build b/projects/firefox/build
index 9a0a92b9..16b3f752 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -108,6 +108,11 @@ 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/"
@@ -115,16 +120,11 @@ add_translation () {
   echo "    locale/$lang/$filename (locale/$lang/$filename)" >> "browser/components/$component/jar.mn"
 }
 
-[% FOREACH lang = c('var/locales') %]
-  lang='[% tmpl(lang) %]'
-  [% IF c("var/macos") -%]
-  if [ "$lang" == "ja-JP-mac" ]; then
-    lang="ja"
-  fi
-  [% END-%]
+supported_locales="[% tmpl(c('var/locales').join(' ')) %]"
+for lang in $supported_locales; do
   add_translation $transl_base_browser newidentity $lang newIdentity.properties
   add_translation $transl_base_browser securitylevel $lang securityLevel.properties
-[% END %]
+done
 
 rm -f configure
 rm -f js/src/configure
@@ -140,6 +140,18 @@ mkdir "$HOME/.mozbuild"
   for tarball in $rootdir/[% c('input_files_by_name/firefox-l10n') %]/*; do
     tar -C "$l10ncentral" -xf "$tarball"
   done
+
+  tar -C $rootdir -xf $rootdir/[% c('input_files_by_name/translation-base-browser-fluent') %]
+  base_browser_fluent=$rootdir/translation-base-browser-fluent
+  for lang in $supported_locales; do
+    source_lang="$lang"
+    if [ $lang = "ja-JP-mac" ]; then
+      source_lang="ja"
+    elif [ $lang = "es-ES" ]; then
+      source_lang="es"
+    fi
+    cp "$base_browser_fluent/$source_lang/languageNotification.ftl" "$l10ncentral/$lang/browser/browser/"
+  done
 [% END %]
 
 # PyYAML tries to read files as ASCII, otherwise
@@ -155,7 +167,7 @@ export LANG=C.UTF-8
 
 ./mach build --verbose
 [% IF !c("var/testbuild") %]
-  export MOZ_CHROME_MULTILOCALE="[% tmpl(c('var/locales').join(' ')) %]"
+  export MOZ_CHROME_MULTILOCALE="$supported_locales"
   for AB_CD in $MOZ_CHROME_MULTILOCALE; do
     ./mach build chrome-$AB_CD
   done
diff --git a/projects/firefox/config b/projects/firefox/config
index 727d5d34..2a3482a1 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -181,6 +181,9 @@ input_files:
     enable: '[% c("var/linux") %]'
   - project: translation-base-browser
     name: translation-base-browser
+  - project: translation-base-browser-fluent
+    name: translation-base-browser-fluent
+    enable: '[% !c("var/testbuild") %]'
   - 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
diff --git a/projects/translation-base-browser-fluent/build b/projects/translation-base-browser-fluent/build
new file mode 100644
index 00000000..fe821718
--- /dev/null
+++ b/projects/translation-base-browser-fluent/build
@@ -0,0 +1,10 @@
+#!/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'),
+    }) %]
diff --git a/projects/translation-base-browser-fluent/config b/projects/translation-base-browser-fluent/config
new file mode 100644
index 00000000..4491ec19
--- /dev/null
+++ b/projects/translation-base-browser-fluent/config
@@ -0,0 +1,9 @@
+# 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: 38d0311207c47104247d4bd740e766901ee45f63
+version: '[% c("abbrev") %]'
+
+targets:
+  nightly:
+    git_hash: 'basebrowser-newidentityftl'

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list