Skip to content

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

Merged
seokju-na merged 4 commits into
mainfrom
docs/korean-translation
Jul 1, 2026
Merged

seokju-na merged 4 commits into
mainfrom
docs/korean-translation

Conversation

@seokju-na

@seokju-na seokju-na commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

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.

Written for commit e6a9470. Summary will update on new commits.

Review in cubic

Make the site bilingual. English stays at the un-prefixed URLs; Korean lives
under `/ko` (`/ko`, `/ko/docs/...`).

Infrastructure:
- Fumadocs i18n loader (`defineI18n`, en default + ko) with a `/ko/docs` route
  branch sharing the docs UI; locale-aware page tree + `meta.ko.json` sidebars.
- A locale context, a `useUiStrings()` dictionary for all non-doc UI copy, a
  language switcher that navigates to the equivalent page, and a locale-aware
  MDX `<a>` so translated pages link within their language without carrying
  prefixes. `<html lang>` and Fumadocs' own strings (search, TOC, pager) follow
  the locale.

Content (polished per technical-writing.dev — one idea per sentence, active
voice, consistent terminology; code, commands, package/API names, paths, and
URLs left unchanged):
- All 57 docs pages translated to Korean (`*.ko.mdx`) + 12 sidebar metas.
- Landing page, header/nav, and footer localized.

Verified: build, lint, and format pass; every page renders 200 in both locales;
Korean content, sidebar, nav, and UI strings render correctly while English is
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhaZ2zL7bAqT3c8mRWTSs9
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
webview-bundle-website e6a9470 Commit Preview URL

Branch Preview URL
Jul 01 2026, 03:56 PM

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 92 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="content/docs/references/bridge/testing.ko.mdx">

<violation number="1" location="content/docs/references/bridge/testing.ko.mdx:139">
P2: Card href links are not localized. When viewed on the Korean page, `<Card href="/docs/references/bridge">` points to the English path instead of `/ko/docs/references/bridge`, breaking locale consistency.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

<Cards>
<Card
title="Bridge 개요"
href="/docs/references/bridge"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Card href links are not localized. When viewed on the Korean page, <Card href="/docs/references/bridge"> points to the English path instead of /ko/docs/references/bridge, breaking locale consistency.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At content/docs/references/bridge/testing.ko.mdx, line 139:

<comment>Card href links are not localized. When viewed on the Korean page, `<Card href="/docs/references/bridge">` points to the English path instead of `/ko/docs/references/bridge`, breaking locale consistency.</comment>

<file context>
@@ -0,0 +1,147 @@
+<Cards>
+  <Card
+    title="Bridge 개요"
+    href="/docs/references/bridge"
+    description="이 헬퍼가 대신하는 invoke 진입점, 명령어 그룹, 오류를 다룹니다."
+  />
</file context>

Comment thread src/lib/i18n.ts Outdated
Comment thread content/docs/guide/cli.ko.mdx Outdated
Comment thread src/lib/locale.tsx Outdated
seokju-na and others added 3 commits July 1, 2026 23:49
With i18n enabled, Fumadocs builds a per-locale Orama index and maps `ko` to the
Orama language `ko`, which has no stemmer — so searching threw "Language 'ko' is
not supported". Add a `localeMap`: English keeps Orama's default tokenizer, and
Korean gets a lightweight character-bigram tokenizer (Hangul runs → overlapping
2-grams, Latin/number runs kept whole, all lowercased). This needs no dependency
and runs on workerd, and gives solid Korean recall (`번들` matches `번들을`).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhaZ2zL7bAqT3c8mRWTSs9
- Localize <Card> hrefs: Cards render their own anchor and bypassed the
  locale-aware `a`, so on Korean pages they pointed to the English paths. Add a
  LocalizedCard wrapper so every card link resolves within its locale.
- Derive DEFAULT_LOCALE from the defineI18n config (single source of truth).
- Remove the unused useLocaleFromPath hook (and its now-unused import).
- Translate the remaining descriptive English card/code-block titles to Korean,
  matching each card to its target page's Korean title (kept API/class names,
  HTTP endpoints, filenames, and product names).

Verified: build, lint, and format pass; Card links on `/ko` now prefix `/ko`,
and no descriptive English titles remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HhaZ2zL7bAqT3c8mRWTSs9
@seokju-na
seokju-na merged commit a513c1b into main Jul 1, 2026
4 checks passed
@seokju-na
seokju-na deleted the docs/korean-translation branch July 1, 2026 15:56
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