mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
- 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
39 lines
952 B
YAML
39 lines
952 B
YAML
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
|