Skip to content

Commit 36d11b3

Browse files
committed
docs(book): correct lang-switcher LOCALES comment + reorder to match locales.toml
The header comment claimed `cargo mdbook build` would regenerate this file from locales.toml at the repo root. That xtask subcommand was removed in a later refactor, so the file is now hand-maintained, but the misleading comment caused multiple PRs to either ignore manual edits as drive-by drift or treat the file as authoritative when it had silently desynced from locales.toml (this file: en/ja/fr/es/zh-CN; locales.toml: en/fr/ja/es/zh-CN). Drop the generator claim, replace with an honest "hand-maintained, keep in sync with locales.toml" instruction, and reorder LOCALES to match locales.toml so the two lists agree.
1 parent 44a8421 commit 36d11b3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

docs/book/theme/lang-switcher.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
// matches one of LOCALES, then renders a dropdown linking to the same page
55
// in every other locale.
66
//
7-
// LOCALES is generated from locales.toml at build time by `cargo mdbook build`.
8-
// Edit locales.toml at the repo root to add or remove locales.
7+
// LOCALES is hand-maintained. The previous comment claimed an
8+
// `cargo mdbook build` step would regenerate it from locales.toml at the
9+
// repo root, but that xtask command no longer exists, so the two lists
10+
// drifted (this file ordered en/ja/fr/es/zh-CN; locales.toml ordered
11+
// en/fr/ja/es/zh-CN). Keep the order below in sync with locales.toml
12+
// when adding or removing a locale.
913
(function () {
1014
const LOCALES = [
1115
{ code: "en", label: "English" },
12-
{ code: "ja", label: "日本語" },
1316
{ code: "fr", label: "Français" },
17+
{ code: "ja", label: "日本語" },
1418
{ code: "es", label: "Español" },
1519
{ code: "zh-CN", label: "中文" },
1620
];

0 commit comments

Comments
 (0)