mirror of
https://codeberg.org/librewolf/source.git
synced 2024-12-22 13:43:04 -05:00
Fix locales
This commit is contained in:
parent
b793b84896
commit
90513a5707
1 changed files with 5 additions and 41 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue