Commit 1474317
committed
fix(theme): tolerate hyphenated locale keys for Sphinx 9
Sphinx 9 normalizes the `language` config to hyphenated BCP-47 form
(e.g. `de-DE`) before passing it into the Jinja template context, but
`load_languages()` keyed the `languages` dict on the underscored form
derived from Crowdin's locale strings. `versions.html` rendering then
raised `KeyError('de-DE')` on every per-locale build.
`get_language_code` and `get_language_display_name` now accept either
form and fall back to the underscored variant, keeping the theme
compatible with Sphinx 7, 8, and 9 without touching `.po`/`.mo` naming.
Bumps version to 1.2.4.
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>1 parent 07aa1b4 commit 1474317
3 files changed
Lines changed: 26 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
3 | 13 | | |
4 | 14 | | |
5 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
15 | 26 | | |
16 | | - | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
20 | | - | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| |||
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | | - | |
| 48 | + | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
| |||
0 commit comments