feat(docs): enable blog + i18n (en / zh-Hans / zh-Hant) with full translations#353
Merged
Conversation
Upgrade Fumadocs to latest (core/ui 16.9.3, mdx 15.0.10) and add the two official Fumadocs features to the docs site: - i18n: defineI18n (default en, fallback en, hideLocale default-locale), proxy.ts middleware, routes moved under app/[lang]/, defineI18nUI in the RootProvider, per-locale search (mandarin tokenizer for zh). Untranslated pages fall back to English; landing page translated as a demo. - Blog: defineCollections collection + blogSource, /[lang]/blog list & post routes, sample post in all three languages, nav link. Verified: types:check, build (329 pages incl. all locales + blog), and a runtime smoke test of routing, fallback, language switcher and search.
Add Simplified & Traditional Chinese translations for every docs page (63 pages × 2) plus localized meta.json sidebar labels. Fully localize the Fumadocs UI chrome (TOC, search, language switcher, page-action buttons) and the blog page chrome via defineI18nUI translations.
|
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.
What
Brings the docs site (
apps/docs, Fumadocs v16 + Next.js 16) up to the official Fumadocs standard for internationalization and adds a blog, then translates the entire docs set into Simplified and Traditional Chinese.Internationalization
fumadocs-core/fumadocs-ui→ 16.9.3 andfumadocs-mdx→ 15.0.10; added@orama/tokenizersfor Chinese search.en(default, no URL prefix),zh-Hans(简体),zh-Hant(繁體), withfallbackLanguage: 'en'andhideLocale: 'default-locale'.lib/i18n.ts(defineI18n),proxy.ts(Next 16 middleware convention viacreateI18nMiddleware), and routes migrated underapp/[lang]/....Blog
defineCollections({ type: 'doc' })blog collection undercontent/blog, wired throughblogSource.app/[lang]/blog, localizable per locale.Translations (this is the bulk of the diff)
.zh-Hans.mdx+.zh-Hant.mdx(126 new pages), plus localizedmeta.jsonsidebar labels for every section and the root nav separators.title/descriptionand prose/headings/tables translated; code blocks, component names, and proper nouns (HotCRM, Copilot, SLA, API, ObjectStack, …) preserved; internal/docs/links rewritten to/zh-Hans/docs/and/zh-Hant/docs/; Simplified vs Traditional genuinely diverge per a shared glossary (字段/欄位, 线索/潛在客戶, 市场营销/行銷, …).UI chrome
defineI18nUItranslations (TOC, search, language switcher, prev/next, choose-theme, edit-on-GitHub).langprop.Verification
pnpm --filter @hotcrm/docs types:check✓pnpm --filter @hotcrm/docs build✓ — 329 static pages across all three locales (docs + blog + posts), proxy middleware active.Notes for reviewers
index.mdx.zh-Hans.mdxdouble-extension name; corrected to the Fumadocs-requiredindex.zh-Hans.mdxbefore commit./docs/prefix) were intentionally left unrewritten — they resolve correctly within the locale context.