Add Chinese glossary (#772)#773
Open
LukasWallrich wants to merge 2 commits into
Open
Conversation
Replaces the hardcoded language-button HTML duplicated across each glossary _index.md with a single shortcode driven by data/glossary_languages.yaml. Adding a future language is now one YAML entry rather than five lockstep edits. Also fixes a pre-existing bug where every language's index marked English as the active button regardless of which page the user was on — the shortcode resolves the active language from the page's directory (or an explicit current= arg). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the Chinese (Simplified) translation of the FORRT glossary, sourced from the main glossary spreadsheet (CN_* columns): - content/glossary/chinese/_index.md landing page with the Chinese background, citation note, and Phase II call-to-action. - 262 translated term entries generated by _create_glossaries.py (which gains a 'CN': 'chinese' mapping and a Chinese branch in sort_key_for_language that sorts by pinyin and strips leading punctuation so titles starting with curly quotes or 《》 land at their natural pinyin position). - Chinese UI dictionary block in layouts/glossary/single.html so per-term pages render labels like 定义, 参考文献, 翻译, etc. - layouts/glossary/list.html now sorts the index TOC by Params.sort_key (matching what single.html already does for the per-term TOC), so the pinyin sort actually takes effect on the /glossary/chinese/ landing page. - pypinyin added to requirements.txt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
📝 Spell Check ResultsFound 25 potential spelling issue(s) when checking 30 changed file(s): 📄
|
| Line | Issue |
|---|---|
| 24 | oder ==> order, older, coder, odder, odor, over, doer |
| 26 | oder ==> order, older, coder, odder, odor, over, doer |
| 26 | oder ==> order, older, coder, odder, odor, over, doer |
| 26 | oder ==> order, older, coder, odder, odor, over, doer |
| 26 | unter ==> under |
| 26 | Ressource ==> Resource |
| 26 | als ==> also |
| 40 | als ==> also |
| 40 | unser ==> under, unset, unsure, user |
| 40 | alle ==> all, alley |
| 40 | als ==> also |
| 44 | offen ==> often |
| 46 | Ressource ==> Resource |
📄 content/glossary/turkish/_index.md
| Line | Issue |
|---|---|
| 22 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 22 | bu ==> by, be, but, bug, bun, bud, buy, bum |
| 22 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 24 | bu ==> by, be, but, bug, bun, bud, buy, bum |
| 24 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 24 | bu ==> by, be, but, bug, bun, bud, buy, bum |
| 26 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 26 | bu ==> by, be, but, bug, bun, bud, buy, bum |
| 30 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 42 | Bu ==> By, Be, But, Bug, Bun, Bud, Buy, Bum |
| 52 | bu ==> by, be, but, bug, bun, bud, buy, bum |
📄 layouts/glossary/single.html
| Line | Issue |
|---|---|
| 32 | Referenz ==> Reference |
ℹ️ How to address these issues:
- Fix the typo: If it's a genuine typo, please correct it.
- Add to whitelist: If it's a valid word (e.g., a name, technical term), add it to
.codespell-ignore.txt - False positive: If this is a false positive, please report it in the PR comments.
🤖 This check was performed by codespell
Contributor
|
👍 All image files/references (if any) are in webp format, in line with our policy. |
Contributor
Author
|
This PR was attempted for staging deployment but had merge conflicts and was skipped. Attempted at: 2026-05-24 08:57:01 UTC Please resolve conflicts with the base branch and the deployment will be retried automatically. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #772.
CN_*columns) — 262 entries plus a landing page at/glossary/chinese/using the intro text from the issue.'CN': 'chinese'in_create_glossaries.py, a pinyin sort_key (viapypinyin, with leading punctuation stripped so titles starting with curly quotes / 《》 sort by their first Chinese character), a Chinese UI dictionary block inlayouts/glossary/single.html(定义, 参考文献, 翻译, …), and a 中文 button in the language switcher.layouts/glossary/list.htmlnow sorts the index TOC byParams.sort_key(matchingsingle.html's per-term TOC) — without this the pinyin sort never reached the landing page since Hugo was falling back to filename order._index.mdmarked English as the active button regardless of page is fixed as a side effect of the shortcode refactor.The first commit is a pure refactor (no Chinese), the second is the feature.
Refactor: language switcher → shortcode + data file (commit 1)
The hardcoded language-button HTML block was duplicated across each glossary
_index.md(six files). Adding a future language was a six-file lockstep edit. Now there is a single source of truth:data/glossary_languages.yaml— slug + label per language, in display order.layouts/shortcodes/glossary_language_switcher.html— renders the buttons and resolves the active language from the page's directory (or an explicitcurrent=arg)._index.mdis now{{< glossary_language_switcher >}}(or withcurrent=\"<lang>\").Adding the next language requires: one YAML entry, one new
content/glossary/<slug>/_index.md, and one line inlanguage_mapin_create_glossaries.py.Test plan
~/go/bin/hugobuilds clean (no errors, only pre-existing deprecation warning)./glossary/chinese/landing page renders the issue's intro text with the citation alert and Phase II call-to-action.AMNESIA → ARRIVE指南 → 版本控制 (banben) → … → JSON 文件 → 开放… (kaifang) → … → 西方的… (xifang), with 《旧金山…》 landing in thejblock (jiujinshan) and "兄弟"式开放科学 in thexblock (xiongdi)._index.mdnow marks its own button as active (English, German, Arabic, Turkish, Chinese all verified in built HTML).list.htmlsort change.🤖 Generated with Claude Code