diff --git a/.github/workflows/translate.yml b/.github/workflows/translate.yml new file mode 100644 index 00000000..416c2e5b --- /dev/null +++ b/.github/workflows/translate.yml @@ -0,0 +1,28 @@ +name: Auto Translate + +on: + workflow_dispatch: + +jobs: + translate: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Translate with i18n-ai-translate + uses: taahamahdi/i18n-ai-translate@master + with: + json-file-path: src/locales/en/translation.json + api-key: ${{ secrets.GEMINI_API_KEY }} + engine: gemini + output-languages: de fr it ko pt-br ru zh + + - name: Commit and push translations + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add src/locales/ + git diff --staged --quiet || git commit -m "chore: auto-translate to multiple languages [skip ci]" + git push