apache / apache/maka

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

Open
#3,975 16 comments 0 reactions 1 assignee Claimed by @heeoneie View on GitHub
enhancement
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
715

Description

## 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 `auto` → `ko` correctly
- `uiLocaleToIntlLocale` maps `ko` → `ko-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` 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>` 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 = Record` 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.