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:
28
.github/workflows/translate.yml
vendored
Normal file
28
.github/workflows/translate.yml
vendored
Normal 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
|
||||||
Reference in New Issue
Block a user