diff --git a/.github/workflows/update-langpack.yml b/.github/workflows/update-langpack.yml new file mode 100644 index 000000000..c3e0ab1f8 --- /dev/null +++ b/.github/workflows/update-langpack.yml @@ -0,0 +1,39 @@ +name: (U) 🧰 Update Language packs + +on: + workflow_dispatch: + +jobs: + update--langpackas: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: configure git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Setup git-cinnabar 🪛 + run: | + mkdir ~/tools + cd ~/tools + git clone https://github.com/glandium/git-cinnabar.git + cd git-cinnabar + git checkout 0.5.11 + export PATH=~/tools/git-cinnabar:$PATH + cd ~ + git cinnabar download + + - name: Update Language packs + run: | + for lang in $(cat ./supported-languages); do + ./update-langpack.sh $lang + done + + - name: Commit changes + run: | + git add . + git commit -m "[bot] Update Language packs" + git push diff --git a/supported-languages b/supported-languages new file mode 100644 index 000000000..aa1134710 --- /dev/null +++ b/supported-languages @@ -0,0 +1,27 @@ +ar +cs +da +de +el +en-GB +fr +hu +id +it +ja +ja-JP-mac +ko +lt +nl +nn-NO +pl +pt-BR +pt-PT +ru +sv-SE +th +tr +uk +vi +zh-CN +zh-TW diff --git a/update-tool.sh b/update-tool.sh new file mode 100644 index 000000000..e17ace25d --- /dev/null +++ b/update-tool.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +langId=$1 +currentDir=$(pwd) + +echo "Updating language pack for $lang" + +cd ./$langId + +if [ ! -d .git ]; then + git init +fi + +git remote add origin hg://hg.mozilla.org/l10n-central/$langId +git pull + +cd $currentDir + +echo "Update complete for $lang"