Skip to content

feat(i18n): add Korean localization - #161

Open
dr-coton wants to merge 1 commit into
Tencent:mainfrom
dr-coton:feat/korean-localization
Open

feat(i18n): add Korean localization#161
dr-coton wants to merge 1 commit into
Tencent:mainfrom
dr-coton:feat/korean-localization

Conversation

@dr-coton

Copy link
Copy Markdown

Summary

  • add complete ko-KR translations for the shared and extension namespaces
  • register ko-KR so Korean browser locales are detected automatically
  • preserve existing interpolation variables and recording instructions

Validation

  • pnpm lint
  • pnpm ext:build
  • pnpm ext:test (797 tests passed)

iAstro added a commit to iAstro/BrowserSkill that referenced this pull request Sep 4, 2026
Per review feedback on Tencent#174: the hardcoded if/else in
normalizeLanguageCode required touching the function for every new
language, so a bare `ko` would miss the `ko-KR` resource Tencent#161 is about
to add and Korean users would land on English despite the fix.

Replace it with createLanguageNormalizer(resourceKeys), a factory that
derives its mapping from the resource keys i18next is configured with:

  1. exact resource key              -> unchanged
  2. one resource for the language   -> that key (ko -> ko-KR)
  3. several (zh-CN / zh-TW)         -> script subtag, then region
  4. nothing shipped                 -> unchanged, fallbackLng applies

getLanguageDetectionOptions now takes the resource keys and i18n.ts
passes Object.keys(resources). Chinese disambiguation stays as the only
special case - one language, two scripts; every other mapping derives
from the index automatically.

Test expectations for the zh-TW family change from "zh-TW" to "zh-CN":
only zh-CN ships today and the factory maps to shipped keys only, so
Traditional resolves directly to Simplified instead of leaking into the
fallback chain. The rendered UI is identical either way, and the new
extensibility cases lock in the automatic disambiguation once a zh-TW
bundle registers - plus the auto-resolution of a newly registered
language like ko-KR.

28 -> 31 tests; extension suite 832/832; tsc, biome and ext:build clean.
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