Skip to content
Snippets Groups Projects
Verified Commit 9deed6f8 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

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.
parent 1b913b23
No related branches found
No related tags found
No related merge requests found
......@@ -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`
......
......@@ -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
......
......@@ -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
......
#!/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'),
}) %]
# 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'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment