From 272ae6d56508cb328baa11c9c2389a39844b2c4f Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Sat, 18 Jul 2026 11:48:44 +1000 Subject: [PATCH] ENH: add zh-cn translation sync workflow (Phase 0, Track A) Copies the proven lecture-python-programming pattern: on merged PRs touching lectures/, QuantEcon/action-translation@v0 translates changed sections and opens a PR in QuantEcon/lecture-intro.zh-cn. Manual re-trigger via a \translate-resync issue comment. Pin follows the fr precedent (@v0 floats on the latest release, currently v0.17.0). Part of the Phase 0 Track A wiring (#782). Co-Authored-By: Claude Fable 5 --- .github/workflows/sync-translations-zh-cn.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sync-translations-zh-cn.yml diff --git a/.github/workflows/sync-translations-zh-cn.yml b/.github/workflows/sync-translations-zh-cn.yml new file mode 100644 index 00000000..738f9060 --- /dev/null +++ b/.github/workflows/sync-translations-zh-cn.yml @@ -0,0 +1,35 @@ +# Sync Translations — Simplified Chinese +# On merged PR, translate changed lectures into the zh-cn target repo. +# Comment \translate-resync on a merged PR to re-trigger sync. +name: Sync Translations (Simplified Chinese) + +on: + pull_request: + types: [closed] + paths: + - 'lectures/**/*.md' + - 'lectures/_toc.yml' + issue_comment: + types: [created] + +jobs: + sync: + if: > + (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '\translate-resync')) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 2 + + - uses: QuantEcon/action-translation@v0 + with: + mode: sync + target-repo: QuantEcon/lecture-intro.zh-cn + target-language: zh-cn + source-language: en + docs-folder: lectures + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ secrets.QUANTECON_SERVICES_PAT }}