diff --git a/scripts/download-language-packs.sh b/scripts/download-language-packs.sh index 54b7e3a96..0df961af8 100644 --- a/scripts/download-language-packs.sh +++ b/scripts/download-language-packs.sh @@ -14,33 +14,32 @@ FIREFOX_L10N_REPO="https://github.com/mozilla-l10n/firefox-l10n" # Ensure the l10n directory exists if [ ! -d "$L10N_DIR" ]; then - mkdir -p "$L10N_DIR" + mkdir -p "$L10N_DIR" fi cd "$L10N_DIR" if [ ! -d "firefox-l10n" ]; then - git clone "$FIREFOX_L10N_REPO" + git clone "$FIREFOX_L10N_REPO" else - echo "The repository 'firefox-l10n' already exists. Pulling the latest changes." - cd firefox-l10n - git pull origin main - cd .. + echo "The repository 'firefox-l10n' already exists. Pulling the latest changes." + cd firefox-l10n + git pull origin main + cd .. fi # Function to update language files update_language() { - local langId=$1 - local LANG_DIR="$L10N_DIR/$langId" + local langId=$1 + local LANG_DIR="$L10N_DIR/$langId" + echo "Updating $langId..." - echo "Updating $langId..." - - # Check if the language directory exists - if [ -d "../firefox-l10n/$langId" ]; then - rsync -av --progress "../firefox-l10n/$langId/" "$LANG_DIR/" --exclude .git - else - echo "Warning: Language directory '$langId' does not exist in the repository." - fi + # Check if the language directory exists + if [ -d "../firefox-l10n/$langId" ]; then + rsync -av --progress "../firefox-l10n/$langId/" "$LANG_DIR/" --exclude .git + else + echo "Warning: Language directory '$langId' does not exist in the repository." + fi } # Set PATH for git-cinnabar @@ -49,17 +48,17 @@ export PATH=~/tools/git-cinnabar:$PATH # Update all supported languages SUPPORTED_LANGUAGES_FILE="$L10N_DIR/l10n/supported-languages" if [[ -f "$SUPPORTED_LANGUAGES_FILE" ]]; then - while read -r lang; do - update_language "$lang" - done < "$SUPPORTED_LANGUAGES_FILE" + while read -r lang; do + update_language "$lang" + done < "$SUPPORTED_LANGUAGES_FILE" else - echo "Error: 'supported-languages' file not found." - exit 1 + echo "Error: 'supported-languages' file not found." + exit 1 fi # Move all the files to the correct location sh scripts/copy-language-pack.sh en-US while read -r lang; do - sh scripts/copy-language-pack.sh "$lang" + sh scripts/copy-language-pack.sh "$lang" done < "$SUPPORTED_LANGUAGES_FILE"