Skip to content

Commit 5cd98ab

Browse files
authored
Correct links for zh- languages. (#61)
1 parent ec4b300 commit 5cd98ab

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

docs/config.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ extra:
3232
link: /pt/
3333
lang: pt
3434
- name: 中文(简体)
35-
link: /zh-cn/
35+
link: /zh_CN/
3636
lang: zh-Hant
3737
- name: 中文(繁體)
38-
link: /zh-tw/
38+
link: /zh_TW/
3939
lang: zh-TW
4040
social:
4141
- icon: fontawesome/brands/github
@@ -146,3 +146,15 @@ plugins:
146146
literate-nav:
147147
nav_file: SUMMARY.md
148148
macros: {}
149+
redirects:
150+
redirect_maps:
151+
# Old
152+
"en/latest/tutorial/tutorial-1.md": "tutorial/tutorial-1.md"
153+
"en/latest.md": "index.md"
154+
"de/latest.md": "https://tutorial.beeware.org/de"
155+
"es/latest.md": "https://tutorial.beeware.org/es"
156+
"fr/latest.md": "https://tutorial.beeware.org/fr"
157+
"it/latest.md": "https://tutorial.beeware.org/it"
158+
"pt/latest.md": "https://tutorial.beeware.org/pt"
159+
"zh-cn/latest.md": "https://tutorial.beeware.org/zh_CN"
160+
"zh-tw/latest.md": "https://tutorial.beeware.org/zh_TW"

docs/en/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Welcome to BeeWare! In this tutorial, we're going to build a graphical user inte
88

99
/// admonition | Translations are available
1010

11-
If you're not comfortable with English, translations of this tutorial are available in [Deutsch](https://tutorial.beeware.org/de), [Español](https://tutorial.beeware.org/es), [Français](https://tutorial.beeware.org/fr), [Italiano](https://tutorial.beeware.org/it), [Português](https://tutorial.beeware.org/pt), [中文(简体)](https://tutorial.beeware.org/zh-cn), and [中文(繁體)](https://tutorial.beeware.org/zh-tw).
11+
If you're not comfortable with English, translations of this tutorial are available in [Deutsch](https://tutorial.beeware.org/de), [Español](https://tutorial.beeware.org/es), [Français](https://tutorial.beeware.org/fr), [Italiano](https://tutorial.beeware.org/it), [Português](https://tutorial.beeware.org/pt), [中文(简体)](https://tutorial.beeware.org/zh_CN), and [中文(繁體)](https://tutorial.beeware.org/zh_TW).
1212

1313
///
1414

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ pre-commit = [
33
"pre-commit == 4.5.1",
44
]
55

6+
redirects = [
7+
"mkdocs-redirects == 1.2.2",
8+
]
9+
610
tox-uv = [
711
"tox-uv == 1.29.0",
812
]
@@ -24,6 +28,8 @@ translate = [
2428

2529
docs = [
2630
"beeware-docs-tools @ git+https://github.com/beeware/beeware-docs-tools",
31+
# "beeware-docs-tools @ file://../beeware-docs-tools",
32+
{include-group = "redirects"},
2733
]
2834

2935
[tool.rumdl]

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ envlist = docs-lint,docs-all
44
[docs]
55
docs_dir = {tox_root}{/}docs{/}en
66

7-
[testenv:docs{,-lint,-translate,-all,-live,-en,-de,-es,-fr,-it,-pt,-zh-cn,-zh-tw}]
7+
[testenv:docs{,-translate,-lint,-en,-de,-es,-fr,-it,-pt,-zh_CN,-zh_TW,-all,-serve,-live}]
88
# Docs are always built on Python 3.13. See also the RTD config.
99
base_python = py313
1010
skip_install = true
1111
passenv =
1212
DEEPL_API_KEY
1313
dependency_groups = docs
1414
commands:
15-
!lint-!all-!translate-!live-!en-!de-!es-!fr-!it-!pt-!zh-cn-!zh-tw : build_md_translations {posargs} en
15+
!translate-!lint-!en-!de-!es-!fr-!it-!pt-!zh_CN-!zh_TW-!all-!live : build_md_translations {posargs} en
1616
translate : build_pot_translations
1717
translate : build_po_translations de es fr it pt zh_CN zh_TW
1818
translate : update_machine_translations --soft-fail de es fr it pt zh_CN zh_TW
@@ -24,8 +24,8 @@ commands:
2424
fr : build_md_translations {posargs} fr
2525
it : build_md_translations {posargs} it
2626
pt : build_md_translations {posargs} pt
27-
zh-cn : build_md_translations {posargs} zh_CN
28-
zh-tw : build_md_translations {posargs} zh_TW
27+
zh_CN : build_md_translations {posargs} zh_CN
28+
zh_TW : build_md_translations {posargs} zh_TW
2929
all : build_md_translations {posargs} en de es fr it pt zh_CN zh_TW
3030
serve : python -m http.server -d _build/html 8041
3131
live : live_serve_en {posargs} --port=8041

0 commit comments

Comments
 (0)