Skip to content

Commit 4dc07cb

Browse files
committed
ci: add sync-translations workflow for zh-cn
Adds a GitHub Actions workflow that automatically translates changed lectures into Simplified Chinese on merged PRs, targeting QuantEcon/lecture-intro.zh-cn via QuantEcon/action-translation@v0.14.1. Supports re-triggering via \translate-resync comment on merged PRs.
1 parent 5ee005d commit 4dc07cb

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Sync Translations — Simplified Chinese
2+
# On merged PR, translate changed lectures into the zh-cn target repo.
3+
#
4+
# Comment \translate-resync on a merged PR to re-trigger sync.
5+
name: Sync Translations (Simplified Chinese)
6+
7+
on:
8+
pull_request:
9+
types: [closed]
10+
paths:
11+
- 'lectures/**/*.md'
12+
- 'lectures/_toc.yml'
13+
issue_comment:
14+
types: [created]
15+
16+
jobs:
17+
sync:
18+
if: >
19+
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
20+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync'))
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v6
25+
with:
26+
fetch-depth: 2
27+
28+
- uses: QuantEcon/action-translation@v0.14.1
29+
with:
30+
mode: sync
31+
target-repo: QuantEcon/lecture-intro.zh-cn
32+
target-language: zh-cn
33+
source-language: en
34+
docs-folder: lectures
35+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
36+
github-token: ${{ secrets.QUANTECON_SERVICES_PAT }}

0 commit comments

Comments
 (0)