From 2ad705747acedf9dcf4eac6305a670b647231857 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Wed, 17 Jun 2026 12:05:47 +1000 Subject: [PATCH 1/2] Add language switcher config for fa and zh-cn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `languages` and `current_language` to `html_theme_options` to enable the language switcher (globe icon) and SEO hreflang tags provided by quantecon-book-theme. Main already ships the 0.21.0 theme, so no environment change is needed here. Languages: - English (en) — https://python-programming.quantecon.org - فارسی (fa) — https://quantecon.github.io/lecture-python-programming.fa - 中文 (zh-cn) — https://quantecon.github.io/lecture-python-programming.zh-cn Co-Authored-By: Claude Opus 4.8 --- lectures/_config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index c3fe4825..0183ce65 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -35,6 +35,17 @@ sphinx: html_theme: quantecon_book_theme html_static_path: ['_static'] html_theme_options: + languages: + - code: en + name: English + url: https://python-programming.quantecon.org + - code: fa + name: فارسی + url: https://quantecon.github.io/lecture-python-programming.fa + - code: zh-cn + name: 中文 + url: https://quantecon.github.io/lecture-python-programming.zh-cn + current_language: en authors: - name: Thomas J. Sargent url: http://www.tomsargent.com/ From b5f3ad1ab5267231194559d1fc3c4f5b6e63c8c2 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 3 Aug 2026 10:01:36 +1000 Subject: [PATCH 2/2] Add French to the language switcher MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .fr edition went live on 2026-07-17 at the default Pages URL, with no custom domain to reconcile. That resolves the deferral recorded on this PR in July, when French was left out because the site was not yet published and its URL would have been a guess. See the rollout tracker QuantEcon/project-translation#3. Ordered alphabetically by code after English; English stays first because the theme uses languages[0] for the hreflang x-default. Verified with a local build against quantecon-book-theme 0.21.0: the switcher lists all four languages with English active, and the hreflang alternates — including x-default — inject on every page. All 26 shared lecture pages resolve on the .fr site; polars is not yet synced there, as is also the case for .fa and .zh-cn. Co-Authored-By: Claude Opus 5 (1M context) --- lectures/_config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 0183ce65..6b5e9ffc 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -42,6 +42,9 @@ sphinx: - code: fa name: فارسی url: https://quantecon.github.io/lecture-python-programming.fa + - code: fr + name: Français + url: https://quantecon.github.io/lecture-python-programming.fr - code: zh-cn name: 中文 url: https://quantecon.github.io/lecture-python-programming.zh-cn