Skip to content

i18n(pages): add Korean (ko) locale - #857

Draft
amondnet wants to merge 1 commit into
alibaba:mainfrom
amondnet:i18n/pages-korean-locale
Draft

i18n(pages): add Korean (ko) locale#857
amondnet wants to merge 1 commit into
alibaba:mainfrom
amondnet:i18n/pages-korean-locale

Conversation

@amondnet

@amondnet amondnet commented Aug 12, 2026

Copy link
Copy Markdown

Description

Adds Korean (ko) as the fifth locale of the docs site, following the Russian locale (#596).

pages/src/i18n/ko.ts carries all 283 keys from en.ts in the same order, so it diffs cleanly as keys are added upstream. Terminology follows the existing README.ko-KR.md; product names, CLI flags and code identifiers are left as-is.

Two changes beyond the three files named in #471 were required to typecheck and render:

  • Navbar.tsx / Footer.tsx list 한국어. The badge glyph gets a Korean font stack — the existing one put PingFang SC first, which the ja branch already worked around.
  • content/docs/index.tsdocsMap is Record<Language, LocalizedDocs>, so ko needs an entry. It is {}; doc pages fall back to English per-page.

The new ko label and badge lines carry allow-non-english: markers matching the ones #876 added for zh/ja/ru; go run scripts/verify-english-only.go passes.

Korean locale — home page

One fix that is not a translation

Headings and body copy broke mid-word under ko (Agent 시스 / , 교차 검 / ). Korean separates 어절 with spaces, so the default line-breaking reads as broken text.

word-break: keep-all is scoped to :lang(ko) via the lang attribute i18n/context.tsx already sets on documentElement. zh/ja depend on any-character breaking and are verified unchanged; keep-all is a no-op for Latin text, so English doc pages under the ko locale are unaffected.

Before

Before: heading breaks mid-word

After

After: heading breaks at word boundaries

Not in this PR: pages/src/content/docs/ko/ (16 pages, ~4,300 lines) is left for follow-up PRs, as #471 allows. DOCS_LOCALES in check-translation-sync.js stays ["zh", "ja", "ru"] — adding ko now would warn on every English docs change with no Korean counterpart to update. It belongs with the first docs batch.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)

The diff is confined to pages/, so the Go suite is not exercised by it; make check passes. Locally, matching pages-ci.yml: typecheck, lint, test (25/25), build, size (94.2 kB / 150 kB) all pass.

Key completeness is enforced by the type system — TranslationKeys is Record<TranslationKey, string>, so one missing key fails typecheck.

Rendering was checked with headless Chrome against the production build, driving the locale via --accept-lang=ko-KR so it exercises the real browser-language-detection path. Navbar tabs, the five highlight stat labels, the eight benchmark table headers and the nineteen docs sidebar entries all fit without clipping. The same pages were captured under en and ja to confirm the CSS change is scoped.

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

No tests added — the locale is data, and its one invariant (key completeness) is enforced at compile time. Happy to add a key-parity test covering all locales if you'd like one.

Related Issues

Closes #471

Follow-up: Korean docs pages, which I plan to submit in batches mirroring #696 / #698 / #701 rather than one large PR.

@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 7 selected item(s).

@amondnet
amondnet force-pushed the i18n/pages-korean-locale branch 3 times, most recently from 245eee3 to 333011e Compare August 12, 2026 06:19
@lizhengfeng101

Copy link
Copy Markdown
Collaborator

@amondnet nice work! Please rebase main

Add a complete Korean translation of the docs site UI strings and wire ko
into the language switcher.

- pages/src/i18n/ko.ts: all 273 keys from en.ts, in the same order.
  Terminology follows README.ko-KR.md (세션 뷰어, 텔레메트리, 위임 모드,
  정밀도/재현율). Product names, protocol names, CLI flags and code
  identifiers are left in their original form.
- Language union, translations record and SUPPORTED_LANGUAGES gain 'ko',
  so browser language detection picks up ko-KR automatically.
- Navbar/Footer language menus list 한국어; the navbar badge glyph 한 gets
  a Korean font stack instead of falling back to the Chinese one.
- docsMap gains an empty ko entry: doc pages fall back to English until
  pages/src/content/docs/ko/ is contributed in a follow-up.
- styles/index.css: word-break: keep-all scoped to :lang(ko). Korean
  separates 어절 with spaces, and the default breaking split headings
  mid-word ("Agent 시스" / "템"). zh/ja depend on any-character breaking
  and are verified unchanged; keep-all is a no-op for Latin text.

Verified with npm run typecheck, lint, test, build and size, plus headless
screenshots of the ko locale at 1440px across home, features, benchmark,
quickstart and docs.

Refs alibaba#471
@amondnet
amondnet force-pushed the i18n/pages-korean-locale branch from 333011e to 00288bb Compare August 15, 2026 09:49
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.

i18n(pages): add Korean (ko) locale to the documentation site

2 participants