From 7d3744c8ca2a58ae9a822b39748ab4bc199f5e9c Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 13:13:53 +1100 Subject: [PATCH 1/3] Add Farsi translation sync workflow Adds sync-translations-fa.yml that triggers when PRs merge with changes to lectures/**/*.md or _toc.yml, automatically creating translation PRs in lecture-python-programming.fa. Uses action-translation v0.10.0 with QUANTECON_SERVICES_PAT for cross-repo write access. --- .github/workflows/sync-translations-fa.yml | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/sync-translations-fa.yml diff --git a/.github/workflows/sync-translations-fa.yml b/.github/workflows/sync-translations-fa.yml new file mode 100644 index 00000000..628a2330 --- /dev/null +++ b/.github/workflows/sync-translations-fa.yml @@ -0,0 +1,30 @@ +# Sync Translations — Farsi +# On merged PR, translate changed lectures into the Farsi target repo. +name: Sync Translations (Farsi) + +on: + pull_request: + types: [closed] + paths: + - 'lectures/**/*.md' + - '_toc.yml' + +jobs: + sync: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - uses: QuantEcon/action-translation@v0.10.0 + with: + mode: sync + target-repo: QuantEcon/lecture-python-programming.fa + target-language: fa + source-language: en + docs-folder: lectures + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ secrets.QUANTECON_SERVICES_PAT }} From 6fc6d643493dda0d7f7cc9b9ec96d4d371638ae0 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 13:42:24 +1100 Subject: [PATCH 2/3] Address review: fix _toc.yml path, bump checkout to v6 --- .github/workflows/sync-translations-fa.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-translations-fa.yml b/.github/workflows/sync-translations-fa.yml index 628a2330..e67ecfb8 100644 --- a/.github/workflows/sync-translations-fa.yml +++ b/.github/workflows/sync-translations-fa.yml @@ -7,7 +7,7 @@ on: types: [closed] paths: - 'lectures/**/*.md' - - '_toc.yml' + - 'lectures/_toc.yml' jobs: sync: @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 2 From e62e91b537af36005da9338017bb95bfb70c7cd6 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 20 Mar 2026 15:39:49 +1100 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20bump=20action-translation=20v0.10.?= =?UTF-8?q?0=20=E2=86=92=20v0.11.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-translations-fa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-translations-fa.yml b/.github/workflows/sync-translations-fa.yml index e67ecfb8..8c7d3b8a 100644 --- a/.github/workflows/sync-translations-fa.yml +++ b/.github/workflows/sync-translations-fa.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 2 - - uses: QuantEcon/action-translation@v0.10.0 + - uses: QuantEcon/action-translation@v0.11.0 with: mode: sync target-repo: QuantEcon/lecture-python-programming.fa