feat: localize ict/smc tutorial content by locale#33
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
zh-CN/subfolder, alongside the existingen/andzh-TW/folders that were just added.localethroughloadIctSmcChapter,loadAllChaptersMetaWithSections, andgetIctSmcChapterNeighborsso each/[locale]/tutorial/ict-smc/...URL resolves to its own language file.<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'slangattribute needs to reflect the served language for accessibility and font shaping.Test plan
/en/tutorial/ict-smc/introductionshows English content; sidebar/pagination titles in English/zh-TW/tutorial/ict-smc/introductionshows Traditional Chinese content; sidebar/pagination titles in Traditional Chinese/zh-CN/tutorial/ict-smc/introductionshows Simplified Chinese content; sidebar/pagination titles in Simplified Chineselangattribute matches the active localepnpm buildstatic-generates 27 chapter routes (3 locales × 9 chapters)