feat(i18n): Korean localization of the docs, landing, and UI

Merged
SE
4mo ago
+9029-181

Makes the site bilingual (English + 한국어). English keeps the un-prefixed URLs; Korean lives under /ko — /ko for the landing, /ko/docs/... for the docs. Translations follow the technical-writing.dev review guide: one idea per sentence, active voice with the developer as subject, concise, and consistent terminology (a locked glossary — bundle→번들, protocol→프로토콜, remote→원격, …). Code, commands, package/API names, file paths, and URLs are left unchanged.

What's translated

  • All 57 docs pages → *.ko.mdx (Guide, References, Config, Changelog).
  • 12 sidebar metas → meta.ko.json (Korean section labels: 소개 / 기능 / 플랫폼 / 원격 …).
  • Landing page copy (hero, showcase, features, CTA, footer) and the header/nav.

Infrastructure

  • Fumadocs i18n loader (defineI18n, English default), a /ko/docs route branch that shares the docs UI from the locale's page tree, and locale-aware sidebars.
  • A locale context + useUiStrings() dictionary for all non-doc UI copy, a language switcher that jumps to the equivalent page in the other locale, and a locale-aware MDX <a> so translated pages link within their own language (no /ko prefixes hand-written in content).
  • <html lang> and Fumadocs' own strings (search box, "On this page", pager, theme/language menus) follow the active locale.

How it was built

  • Proved the i18n infra end-to-end on one page first (routing, .ko.mdx rendering, meta.ko.json labels, link localization).
  • Translated the 57 pages + 12 metas via parallel agents grounded in the glossary + writing guide, and refactored the 6 landing components to the dictionary.

Verified

  • ✅ yarn build, yarn lint, yarn format --check all pass.
  • ✅ Every page (landing + a sweep of docs across all sections) returns 200 in both locales.
  • ✅ /ko/* renders Korean content, sidebar, nav, and Fumadocs UI strings; / and /docs/* are unchanged English (lang="en", English UI).

Note: search on Korean pages currently uses the default tokenizer. PR #7 (the garu Korean tokenizer) adds morpheme-aware Korean search and composes naturally with this — worth merging together for the best /ko search.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HhaZ2zL7bAqT3c8mRWTSs9


Summary by cubic

Adds full Korean localization across docs, landing, and UI to make the site bilingual. Per-locale search is now supported, using a Korean morpheme tokenizer and ensuring all links on /ko pages stay in Korean.

  • New Features

    • 57 docs pages and 12 sidebars translated (*.ko.mdx, meta.ko.json).
    • Landing, header/nav, and footer copy localized via useUiStrings().
    • i18n using Fumadocs defineI18n (default en, plus ko), shared docs UI for both locales, and /ko + /ko/docs routes.
    • Internal links auto-localize; Card links now localize too; <html lang> and Fumadocs UI strings follow the locale.
    • Language switcher jumps to the same page in the other locale.
    • Korean search uses a morpheme-aware tokenizer (garu) composed with the default tokenizer for better recall (e.g., 번들 matches 번들을).
  • Migration

    • Keep writing docs in English at /docs/*; add a .ko.mdx sibling and optional meta.ko.json for Korean.
    • Use /docs/... links in content; anchors are localized at render time.
    • For new UI text, add keys to src/lib/ui-strings.ts and read them with useUiStrings().
    • No breaking changes to existing English URLs or navigation.