Skip to content

feat(i18n-ko): core — add ko to UiLocale model #3975

Description

@me2seeks

Problem

UiLocale will ship ['zh-CN','zh-TW','en'] after #3853. ko/ko-KR system languages fall back to en. There is no type-safe slot for Korean, so catalog entries cannot be added.

Desired outcome

  • UI_LOCALES includes ko, isUiLocale/isUiLocalePreference accept ko
  • resolveSystemUiLocale recognizes ko, ko-KR, ko_KR (case-insensitive, ko prefix) and maps autoko correctly
  • uiLocaleToIntlLocale maps koko-KR
  • Existing zh-CN/zh-TW/en behavior unchanged; persisted auto preference preserved
  • Tests cover resolveSystemUiLocale(['ko','ko-KR','en']) and resolveUiLocale('auto', ko); missing ko entry in any UiCatalog<T> fails typecheck

Alternatives or workarounds

Keep English fallback for Korean systems.

Scope

packages/core/src/ui-locale.ts + tests (desktop-locale-authority, e2e-fixture-locale). Reuses #3853 pattern for zh-TW. No catalog content in this slice.

Delivery note (2026-08-27 audit): This slice must not land alone with Partial<Record<UiLocale,T>> widening. Per notes/pr-3853-feature-audit.md — widening would make the already-enabled zh-CN/zh-TW optional as well and force every getter to add undefined fallback/assertion, then require a second global tighten. Instead, keep dictionaries off the enabled union in the domain slices (#3977-#3980) and enable ko atomically (or on a stacked integration branch), as UiCatalog<T> = Record<UiLocale,T> requires all catalogs to carry the key at once. See audit § Global follow-up.

Acceptance criteria

  • resolveSystemUiLocale(['ko-KR']) === 'ko', ['en','ko'] === 'en' (order respected)
  • uiLocaleToIntlLocale('ko') === 'ko-KR'
  • npm --workspace @maka/core test green with new cases
  • This issue does not merge to main alone — it lands together with the catalog slices via atomic vertical or stacked integration branch, keeping UiCatalog strict

Parent: #3974

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions