Skip to content

feat: localize ict/smc tutorial content by locale#33

Merged
ronload merged 1 commit into
mainfrom
feat/implement-tutorial-docs-i18n
Apr 29, 2026
Merged

feat: localize ict/smc tutorial content by locale#33
ronload merged 1 commit into
mainfrom
feat/implement-tutorial-docs-i18n

Conversation

@ronload
Copy link
Copy Markdown
Owner

@ronload ronload commented Apr 29, 2026

Summary

  • Move the simplified-chinese chapter files into a dedicated zh-CN/ subfolder, alongside the existing en/ and zh-TW/ folders that were just added.
  • Thread locale through loadIctSmcChapter, loadAllChaptersMetaWithSections, and getIctSmcChapterNeighbors so each /[locale]/tutorial/ict-smc/... URL resolves to its own language file.
  • Replace the hardcoded <Markdown lang="zh-CN"> with the active locale, and update sidebar/pagination to consume a localized chapter shape (LocalizedChapter) so chapter titles match the URL.

Why

Until now the tutorial loader was locale-blind: it always read from the repo-root markdown files, so /en/tutorial/..., /zh-TW/tutorial/..., and /zh-CN/tutorial/... all rendered the same simplified-chinese content. With the en and zh-TW translations now in place, the content pipeline needs to actually pick the right file per locale, and the markdown wrapper's lang attribute needs to reflect the served language for accessibility and font shaping.

Test plan

  • /en/tutorial/ict-smc/introduction shows English content; sidebar/pagination titles in English
  • /zh-TW/tutorial/ict-smc/introduction shows Traditional Chinese content; sidebar/pagination titles in Traditional Chinese
  • /zh-CN/tutorial/ict-smc/introduction shows Simplified Chinese content; sidebar/pagination titles in Simplified Chinese
  • DevTools shows the prose container's lang attribute matches the active locale
  • Language switcher swaps both URL and visible content
  • pnpm build static-generates 27 chapter routes (3 locales × 9 chapters)

Move the simplified-chinese chapter files into a dedicated zh-CN/
subfolder alongside the existing en/ and zh-TW/ folders, and thread
locale through the tutorial loaders so each URL serves the matching
language file. Replaces the hardcoded zh-CN lang on the markdown
wrapper with the active locale, and updates sidebar/pagination to
consume the localized chapter shape.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kaiyn-website Ready Ready Preview, Comment Apr 29, 2026 7:59am

@ronload ronload merged commit 98451c6 into main Apr 29, 2026
6 checks passed
@ronload ronload deleted the feat/implement-tutorial-docs-i18n branch April 29, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant