From 90513a5707af5cd6019abe65967862bfe730af82 Mon Sep 17 00:00:00 2001 From: Malte Juergens Date: Tue, 10 Sep 2024 16:52:58 +0200 Subject: [PATCH] Fix locales --- scripts/generate-locales.sh | 46 ++++--------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/scripts/generate-locales.sh b/scripts/generate-locales.sh index 7d3b29e..1e94b45 100755 --- a/scripts/generate-locales.sh +++ b/scripts/generate-locales.sh @@ -5,45 +5,9 @@ if [ ! -f browser/locales/shipped-locales ]; then exit 1 fi +echo "-> Downloading locales" rm -rf browser/locales/l10n -mkdir browser/locales/l10n - -N=8 -for i in $(seq $N); do echo; done -total=$(wc -l < browser/locales/shipped-locales) - -echo_status() { - printf "\033[$((($N - $n) + 1))A$@ %40s\r\033[$((($N - $n) + 1))B" -} - -generate_locale() { - if echo " en-US ca ja " | grep -q " $1 "; then - echo_status "Skipping locale \"$1\"" - sleep 1 - echo_status - return - fi - echo_status "Downloading locale \"$1\"" - wget -q -O browser/locales/l10n/$1.zip https://hg.mozilla.org/l10n-central/$1/archive/tip.zip - echo_status "Extracting locale \"$1\"" - unzip -qo browser/locales/l10n/$1.zip -d browser/locales/l10n/ - mv browser/locales/l10n/$1-*/ browser/locales/l10n/$1/ - rm -f browser/locales/l10n/$1.zip - echo_status "Generating locale \"$1\"" - mv browser/locales/l10n/$1/browser/branding/official browser/locales/l10n/$1/browser/branding/librewolf - find browser/locales/l10n/$1 -type f -exec sed -i -e 's/Mozilla Firefox/LibreWolf/g' {} \; - find browser/locales/l10n/$1 -type f -exec sed -i -e 's/Mozilla/LibreWolf/g' {} \; - find browser/locales/l10n/$1 -type f -exec sed -i -e 's/Firefox/LibreWolf/g' {} \; - echo_status "Done" - sleep 0.3 - echo_status -} - -while read in; do - ((n=n%N)); ((n++==0)) && wait - generate_locale $in & -done < browser/locales/shipped-locales - -wait - -printf "\033[$(($N))A\rGenerated $total locales %-40s\n" +curl -o browser/locales/l10n.zip "https://codeload.github.com/mozilla-l10n/firefox-l10n/zip/refs/heads/main" +unzip -qo browser/locales/l10n.zip -d browser/locales/ +mv browser/locales/firefox-l10n-main browser/locales/l10n +rm -f browser/locales/l10n.zip