Add GitHub Actions workflow for auto translation

This workflow automates the translation of JSON files using the i18n-ai-translate action, committing changes back to the repository.
This commit is contained in:
Luke Gustafson
2025-12-24 14:04:28 -06:00
committed by GitHub
parent f0647dc7c1
commit 7139290d14

28
.github/workflows/translate.yml vendored Normal file
View File

@@ -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