feat: add auto README translation workflow with streaming
- Add GitHub Actions workflow to auto-translate README.md - Support Vietnamese and Simplified Chinese - Use GLM-5 API with streaming mode - Auto-commit translations to i18n/ folder - Trigger on README.md changes or manual dispatch Made-with: Cursor
This commit is contained in:
parent
afb83f4563
commit
4a1521de09
2 changed files with 226 additions and 0 deletions
38
.github/workflows/translate-readme.yml
vendored
Normal file
38
.github/workflows/translate-readme.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
name: Translate README
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'README.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
translate:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Translate README to all languages
|
||||
env:
|
||||
GLM_API_KEY: ${{ secrets.GLM_API_KEY }}
|
||||
run: |
|
||||
node .github/scripts/translate-readme.js vi zh-CN
|
||||
|
||||
- name: Commit translations
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git add i18n/
|
||||
git diff --staged --quiet || git commit -m "chore: auto-translate README to vi, zh-CN"
|
||||
git push
|
||||
Loading…
Add table
Add a link
Reference in a new issue