0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2025-01-03 11:20:11 -05:00
LibreWolf/scripts/generate-locales.sh

21 lines
779 B
Bash
Raw Normal View History

2022-05-03 15:53:46 -05:00
#!/usr/bin/bash
if [ ! -f browser/locales/shipped-locales ]; then
echo "ERROR: Run this script from the root of the LibreWolf source code"
exit 1
fi
2024-09-10 09:52:58 -05:00
echo "-> Downloading locales"
2022-05-03 15:53:46 -05:00
rm -rf browser/locales/l10n
2024-09-10 09:52:58 -05:00
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
2024-09-10 09:52:58 -05:00
sourcedir="$(pwd)"
set -x
cd "../l10n/en-US"
find . -name '*.ftl' -exec sh -c "mkdir -p \$(dirname $sourcedir/{}) && cat {} >> $sourcedir/{}" \;
cd ..
find . -name '*.ftl' -path en-US -prune -exec sh -c "mkdir -p \$(dirname $sourcedir/browser/locales/l10n/{}) && cat {} >> $sourcedir/browser/locales/l10n/{}" \;