mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 01:19:59 +02:00
Update download-language-packs.sh
Signed-off-by: Cristian Cezar Moisés <ethicalhacker@riseup.net>
This commit is contained in:
parent
8ab4f8bd93
commit
f81835cc60
1 changed files with 28 additions and 23 deletions
|
@ -12,49 +12,54 @@ git config --global fetch.prune true
|
||||||
L10N_DIR="$CURRENT_DIR/l10n"
|
L10N_DIR="$CURRENT_DIR/l10n"
|
||||||
FIREFOX_L10N_REPO="https://github.com/mozilla-l10n/firefox-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"
|
cd "$L10N_DIR"
|
||||||
|
|
||||||
if [ ! -d "firefox-l10n" ]; then
|
if [ ! -d "firefox-l10n" ]; then
|
||||||
git clone "$FIREFOX_L10N_REPO"
|
git clone "$FIREFOX_L10N_REPO"
|
||||||
else
|
else
|
||||||
echo "The repository 'firefox-l10n' already exists. Pulling the latest changes."
|
echo "The repository 'firefox-l10n' already exists. Pulling the latest changes."
|
||||||
cd firefox-l10n
|
cd firefox-l10n
|
||||||
git pull origin main
|
git pull origin main
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Function to update language files
|
# Function to update language files
|
||||||
update_language() {
|
update_language() {
|
||||||
langId=$1
|
local langId=$1
|
||||||
LANG_DIR="$L10N_DIR/$langId"
|
local LANG_DIR="$L10N_DIR/$langId"
|
||||||
|
|
||||||
echo "Updating $langId..."
|
echo "Updating $langId..."
|
||||||
|
|
||||||
# Check if the language directory exists
|
# Check if the language directory exists
|
||||||
if [ -d "../firefox-l10n/$langId" ]; then
|
if [ -d "../firefox-l10n/$langId" ]; then
|
||||||
rsync -av --progress "../firefox-l10n/$langId/" "$LANG_DIR/" --exclude .git
|
rsync -av --progress "../firefox-l10n/$langId/" "$LANG_DIR/" --exclude .git
|
||||||
else
|
else
|
||||||
echo "Warning: Language directory '$langId' does not exist in the repository."
|
echo "Warning: Language directory '$langId' does not exist in the repository."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set PATH for git-cinnabar
|
# Set PATH for git-cinnabar
|
||||||
export PATH=~/tools/git-cinnabar:$PATH
|
export PATH=~/tools/git-cinnabar:$PATH
|
||||||
|
|
||||||
# Update all supported languages
|
# Update all supported languages
|
||||||
if [[ -f "$L10N_DIR/l10n/supported-languages" ]]; then
|
SUPPORTED_LANGUAGES_FILE="$L10N_DIR/l10n/supported-languages"
|
||||||
while read -r lang; do
|
if [[ -f "$SUPPORTED_LANGUAGES_FILE" ]]; then
|
||||||
update_language "$lang"
|
while read -r lang; do
|
||||||
done < "$L10N_DIR/l10n/supported-languages"
|
update_language "$lang"
|
||||||
|
done < "$SUPPORTED_LANGUAGES_FILE"
|
||||||
else
|
else
|
||||||
echo "Error: 'supported-languages' file not found."
|
echo "Error: 'supported-languages' file not found."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Move all the files to the correct location
|
# Move all the files to the correct location
|
||||||
sh scripts/copy-language-pack.sh en-US
|
sh scripts/copy-language-pack.sh en-US
|
||||||
|
|
||||||
while read -r lang; do
|
while read -r lang; do
|
||||||
sh scripts/copy-language-pack.sh "$lang"
|
sh scripts/copy-language-pack.sh "$lang"
|
||||||
done < "$L10N_DIR/l10n/supported-languages"
|
done < "$SUPPORTED_LANGUAGES_FILE"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue