Skip to content

feat(docs): enable blog + i18n (en / zh-Hans / zh-Hant) with full translations#353

Merged
os-zhuang merged 2 commits into
mainfrom
docs/blog-and-i18n
May 30, 2026
Merged

feat(docs): enable blog + i18n (en / zh-Hans / zh-Hant) with full translations#353
os-zhuang merged 2 commits into
mainfrom
docs/blog-and-i18n

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

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

  • Upgraded fumadocs-core/fumadocs-ui → 16.9.3 and fumadocs-mdx → 15.0.10; added @orama/tokenizers for Chinese search.
  • Three locales: en (default, no URL prefix), zh-Hans (简体), zh-Hant (繁體), with fallbackLanguage: 'en' and hideLocale: 'default-locale'.
  • New lib/i18n.ts (defineI18n), proxy.ts (Next 16 middleware convention via createI18nMiddleware), and routes migrated under app/[lang]/....
  • Localized search index (Orama mandarin tokenizer for both Chinese variants).

Blog

  • Official defineCollections({ type: 'doc' }) blog collection under content/blog, wired through blogSource.
  • List + detail routes under app/[lang]/blog, localizable per locale.

Translations (this is the bulk of the diff)

  • All 63 English docs pages translated → .zh-Hans.mdx + .zh-Hant.mdx (126 new pages), plus localized meta.json sidebar labels for every section and the root nav separators.
  • Translation rules: only frontmatter title/description and 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

  • Enriched defineI18nUI translations (TOC, search, language switcher, prev/next, choose-theme, edit-on-GitHub).
  • Localized the blog page chrome and the page-action buttons (复制 Markdown / 打开 · 複製 Markdown / 開啟) via a lang prop.

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.
  • Manual browser check: language switcher shows English / 简体中文 / 繁體中文; switching updates content, sidebar, TOC, and search placeholder; untranslated pages fall back to English.

Notes for reviewers

  • Two translation agents initially emitted a index.mdx.zh-Hans.mdx double-extension name; corrected to the Fumadocs-required index.zh-Hans.mdx before commit.
  • Relative cross-page links (no /docs/ prefix) were intentionally left unrewritten — they resolve correctly within the locale context.

os-zhuang added 2 commits May 30, 2026 18:58
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.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored May 30, 2026 11:30am

Request Review

@os-zhuang os-zhuang merged commit 3303ff2 into main May 30, 2026
5 of 7 checks passed
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.

2 participants