From cdb9a089417ce6d491689a339c88dd3a396eeb1a Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 15 Jul 2026 10:39:53 +1000 Subject: [PATCH] Add French translation sync workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged PRs now translate changed lectures into lecture-python-programming.fr. Without this the French edition never tracks English — it was seeded and would sit frozen from the next merge onward. Copy of sync-translations-zh-cn.yml with the header, name, target-repo and target-language changed, plus the action pin. Pinned to @v0.16.0 (default model claude-sonnet-5) rather than the @v0.15.0 (claude-sonnet-4-6) its siblings use. Deliberate: French is the edition evaluated on Sonnet 5; fa and zh-cn have not been, and silently changing their model is not this PR's business. The repo runs two action versions until someone decides to move them. Requires QuantEcon/lecture-python-programming.fr#1 (the seed) to merge first. --- .github/workflows/sync-translations-fr.yml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/sync-translations-fr.yml diff --git a/.github/workflows/sync-translations-fr.yml b/.github/workflows/sync-translations-fr.yml new file mode 100644 index 00000000..062ab664 --- /dev/null +++ b/.github/workflows/sync-translations-fr.yml @@ -0,0 +1,35 @@ +# Sync Translations — French +# On merged PR, translate changed lectures into the French target repo. +# Comment \translate-resync on a merged PR to re-trigger sync. +name: Sync Translations (French) + +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.16.0 + with: + mode: sync + target-repo: QuantEcon/lecture-python-programming.fr + target-language: fr + source-language: en + docs-folder: lectures + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ secrets.QUANTECON_SERVICES_PAT }}