1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

Update download-language-packs.sh

Signed-off-by: Cristian Cezar Moisés <ethicalhacker@riseup.net>
This commit is contained in:
Cristian Cezar Moisés 2025-01-04 04:29:30 +00:00 committed by GitHub
parent 8ab4f8bd93
commit f81835cc60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,11 @@ git config --global fetch.prune true
L10N_DIR="$CURRENT_DIR/l10n"
FIREFOX_L10N_REPO="https://github.com/mozilla-l10n/firefox-l10n"
mkdir -p "$L10N_DIR" # Ensure the l10n directory exists
# Ensure the l10n directory exists
if [ ! -d "$L10N_DIR" ]; then
mkdir -p "$L10N_DIR"
fi
cd "$L10N_DIR"
if [ ! -d "firefox-l10n" ]; then
@ -26,8 +30,8 @@ fi
# Function to update language files
update_language() {
langId=$1
LANG_DIR="$L10N_DIR/$langId"
local langId=$1
local LANG_DIR="$L10N_DIR/$langId"
echo "Updating $langId..."
@ -43,10 +47,11 @@ update_language() {
export PATH=~/tools/git-cinnabar:$PATH
# Update all supported languages
if [[ -f "$L10N_DIR/l10n/supported-languages" ]]; then
SUPPORTED_LANGUAGES_FILE="$L10N_DIR/l10n/supported-languages"
if [[ -f "$SUPPORTED_LANGUAGES_FILE" ]]; then
while read -r lang; do
update_language "$lang"
done < "$L10N_DIR/l10n/supported-languages"
done < "$SUPPORTED_LANGUAGES_FILE"
else
echo "Error: 'supported-languages' file not found."
exit 1
@ -57,4 +62,4 @@ sh scripts/copy-language-pack.sh en-US
while read -r lang; do
sh scripts/copy-language-pack.sh "$lang"
done < "$L10N_DIR/l10n/supported-languages"
done < "$SUPPORTED_LANGUAGES_FILE"