diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml new file mode 100644 index 0000000..f7364b1 --- /dev/null +++ b/.github/workflows/translation.yml @@ -0,0 +1,25 @@ +name: Update Translations + +on: + workflow_dispatch: + +jobs: + translation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: git config --global user.email "actions@github.com" && git config --global user.name "actions" + - run: pip install transifex-client + - run: echo -e "[https://www.transifex.com]\ntoken = ${{ secrets.TRANSIFEX_TOKEN }}" > ~/.transifexrc + - run: | + tx init --no-interactive + tx set --auto-local -r traccar.client "lib/l10n/.arb" --source-lang en --type KEYVALUEJSON + tx pull -a + - run: | + git config --global user.name "Traccar Bot" + git config --global user.email "support@traccar.org" + git add lib/l10n/*.arb + git diff --cached --quiet || git commit -m "Update translations" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}