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 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<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

  1. heeoneie commented on Aug 27, 2026

    @heeoneie
    Contributor

    I'd like to take #3975.

    One thing I'd like to settle before starting, since it affects the other five slices too.

    UiCatalog<T> is Record<UiLocale, T>, so adding ko to UI_LOCALES makes every catalog require a ko entry. I count 38 of them — 34 declared with satisfies UiCatalog<T> and 4 annotated directly — across apps/desktop, packages/ui, packages/cli and packages/core. The acceptance criteria name that as intended ("missing ko entry in any UiCatalog<T> fails typecheck"), which is the right property to want, but it does mean #3975 on its own lands main with a failing typecheck until the catalog slices follow. Branch protection requires a passing test check, so the PR would sit red on its own.

    How would you like to sequence it? A few options I can see:

    • stack all six on one integration branch and merge them together
    • land feat(i18n-ko): core — add ko to UiLocale model #3975 last, after the catalog slices are staged behind the current type
    • widen UiCatalog so ko is optional first, then tighten it in a final PR once the catalogs are filled

    Happy to go with whichever you prefer — I just don't want to be the one who puts red CI on main. If the third option is the one you want, I can fold the widening into #3975 so it stays a single self-contained change.

    On the translation slices: I'd rather not claim one yet. #3977 alone is around 2,900 lines of copy, and I'd like to run the app in ko after this slice lands before committing to wording at that volume — tone is easier to get right against a real screen than against a diff.

  2. me2seeks commented on Aug 27, 2026

    @me2seeks
    ContributorAuthor

    Hi @heeoneie — thanks so much for catching this so early and for counting the 38 catalogs! You're totally right — Record<UiLocale, T> makes a pure core-only #3975 red on its own, and we definitely don't want you to be the one to put red CI on main.

    Let's go with option 3 — widen then tighten — it's the kindest to reviewers and keeps everything green:

    Also totally understand holding off on claiming #3977 — ~2,900 lines is a lot to word-smith from a diff! Please take your time, run it in ko after #3975 lands, and just comment I'd like to take #3977 (or whichever slice you prefer) whenever you're ready. No rush at all.

    Just for heads-up: we're settling the shared contract as ['zh-CN','zh-TW','en','ko'] (following #3853's region-aware shape), so #3975 will be built on ['zh-CN','zh-TW','en'] — we'll update the description to match, you don't need to rework anything beyond the widening.

    Thanks again for the super careful analysis and for offering to carry the Korean copy — really appreciate you!

  3. me2seeks commented on Aug 27, 2026

    @me2seeks
    ContributorAuthor

    Hi @heeoneie — quick correction to my last message, sorry for the whiplash!

    After your note I had a deeper feature audit run on #3853 (head 13428763b), and it flagged the Partial<Record<UiLocale,T>> widen-then-tighten we just agreed on. The audit's point is fair: that widening wouldn't just make ko optional — it would also make the already-shipped zh-CN/zh-TW optional, and force every UiCatalog getter to add an undefined fallback/assertion, then require a second global tighten. That's more risk than the small-PR benefit is worth.

    Updated guidance per the audit: let's not widen. Instead, please keep the ko dictionaries off the enabled union in your domain slices (#3977-#3980) — you can prepare them on branches that don't yet add ko to UI_LOCALES — and then enable ko atomically (either one atomic vertical that adds UI_LOCALES + all catalogs together with clearly separated commits like #3853, or a stacked integration branch). The type stays strict Record<UiLocale,T> the whole time.

    I know that's the opposite of what I just said — really sorry for the flip-flop! Your counting of the 38 catalogs was spot-on and is exactly why the audit prefers the atomic/stacked shape over the widening. If you'd still prefer to run ko live before committing wording, the stacked branch still lets you do that locally without putting an optional type on main.

    I've updated the issue body to reflect this — let me know if the new shape works for you, or if you'd like to keep #3975 parked until #3853 lands and then do the atomic enable together. Again, sorry for the change and thanks for your patience!

  4. heeoneie commented on Aug 27, 2026

    @heeoneie
    Contributor

    No whiplash — the audit is right, and #389's reasoning goes further than the type shape: the timeout/rate/auth/5xx/network classification in redaction.ts is already duplicated between generalizedErrorMessage and generalizedErrorMessageChinese — identical branches, different strings — and ko would have made that a third copy on main (a fourth at #3853's head). Better to collapse it to "classify once → typed locale catalog" before another locale exists, not after.

    I've read #3853 and @AcerYue0's contract question, so I'm working from ['zh-CN','zh-TW','en'], not the ['zh','en'] still in the #3975 body. Parking behind #3853 makes sense — adding ko is one line in UI_LOCALES once it lands.

    On the classifier: I'd rather not open that PR right now. It touches the same file #3853 is actively reworking, and dropping a refactor there while it's blocked would just cost @AcerYue0 another rebase. Two options I'm happy with:

    Your call — whichever costs @AcerYue0 less.

    Not claiming a translation slice until #3853 lands.

  5. me2seeks commented on Aug 27, 2026

    @me2seeks
    ContributorAuthor

    No whiplash — the audit is right, and #389's reasoning goes further than the type shape: the timeout/rate/auth/5xx/network classification in redaction.ts is already duplicated between generalizedErrorMessage and generalizedErrorMessageChinese — identical branches, different strings — and ko would have made that a third copy on main (a fourth at #3853's head). Better to collapse it to "classify once → typed locale catalog" before another locale exists, not after.

    I've read #3853 and @AcerYue0's contract question, so I'm working from ['zh-CN','zh-TW','en'], not the ['zh','en'] still in the #3975 body. Parking behind #3853 makes sense — adding ko is one line in UI_LOCALES once it lands.

    On the classifier: I'd rather not open that PR right now. It touches the same file #3853 is actively reworking, and dropping a refactor there while it's blocked would just cost @AcerYue0 another rebase. Two options I'm happy with:

    Your call — whichever costs @AcerYue0 less.

    Not claiming a translation slice until #3853 lands.

    Agreed. This looks better tracked as a separate issue rather than expanding #3975’s scope.

    I’ll open a follow-up issue for collapsing the duplicated error classification into a single classifier + typed locale catalog, and mark it as blocked by #3853 for now. That should avoid forcing another rebase on @AcerYue0 while keeping the refactor visible and scoped separately.

    Once #3853 lands, we can handle the classifier refactor there before adding another locale path. No need to claim a translation slice yet.

  6. added
    enhancement
    help wanted
    on Aug 29, 2026
  7. heeoneie commented on Aug 30, 2026

    @heeoneie
    Contributor

    @Astro-Han I see this picked up good first issue and help wanted yesterday — could I be assigned, or would you rather it went to someone new?

    I raised the Record<UiLocale, T> coupling on this issue and worked the sequencing out with @me2seeks above, so I have been treating it as mine and deliberately have not opened anything while #3853 is in flight. It is unassigned, though, and with the new labels I would rather not have a first-time contributor start the same work and collide with it.

    The blocker did move this morning: @AcerYue0 merged main into #3853 at 03:59 UTC and requested review. It still reports a conflict, so I am not starting yet — the contract here depends on whether UI_LOCALES lands as ['zh-CN','zh-TW','en'], and I would rather build on the shape that actually merges than guess at it.

    The labels are still on the issue, so if you would rather shape this differently, just say. I would mainly like to avoid two people discovering the same UiCatalog problem independently.

  8. heeoneie commented on Aug 30, 2026

    @heeoneie
    Contributor

    take

  9. removed
    help wanted
    good first issue
    on Aug 30, 2026
  10. me2seeks commented on Aug 30, 2026

    @me2seeks
    ContributorAuthor

    Thanks — you are assigned now, and #3975 is reserved for you.

    Please keep it parked until #3853 has merged, then refresh from main and coordinate the atomic/stacked enablement with the catalog slices. UiCatalog stays strict; please don't open a standalone PR that enables ko on main.

    I've removed the good first issue and help wanted labels so nobody else starts overlapping work. Thanks for being careful about the dependency and collision risk.

  11. 9 remaining items

  12. scs0209 commented on Sep 9, 2026

    @scs0209

    @heeoneie Already rebased #4515 onto #5011 (feat/i18n-ko-core-ui-locale / 93a8dd7).

  13. heeoneie commented on Sep 9, 2026

    @heeoneie
    Contributor

    Correction to my earlier note in this thread: the stack base has moved.

    I pointed at heeoneie:feat/i18n-ko-core-ui-locale above. That is superseded — @me2seeks opened #5100 as the official base inside apache/maka (branch stack/i18n-ko-core), recreating the reviewed core layer from #5011 at 36a4377 as a single commit on current main. @jackwener verified its combined patch ID matches the #5011 source range exactly.

    Because that branch now lives in apache/maka, slice PRs can retarget their base to it directly instead of carrying temporary core commits. @scs0209 has already done exactly that on #4515 — rebased onto stack/i18n-ko-core, retargeted the PR base, and dropped the temporary core commits. That is the shape to copy.

    @ggbdpq @xiechimon — please build on #5100 rather than my fork branch.

    #5011 stays open as the canonical reviewed source and the public record of the core work, but it is no longer the thing to stack on. #5100 is draft-only and does not merge by itself, so the delivery model is unchanged: only the complete, green stack is eligible for merge.

  14. me2seeks commented on Sep 29, 2026

    @me2seeks
    ContributorAuthor

    Maintainer decision update — this supersedes my 2026-09-08 atomic-delivery decision.

    We accept progressive Korean rollout. We will use the shared English-fallback catalog path so untranslated Korean copy can render in English while each translation slice is completed. This means Korean can become selectable / follow the system before every surface is translated; that mixed-language period is an accepted product behavior for this rollout.

    The delivery sequence is:

    1. Make the fallback path safe for every build/typecheck surface affected by enabling ko, with English required and explicit coverage checks so fallback cannot hide missing copy in the already shipped Chinese locales.
    2. Merge the green core enablement PR to main as its own squash commit.
    3. Retarget and merge each ready translation PR separately to main; each PR keeps its own squash commit and author/co-author attribution. The temporary integration branch is for cross-slice visual/E2E validation, not the final all-in-one squash.

    Please do not add verbatim English ko blocks just to satisfy the old strict type. Keep real Korean copy and let the shared resolver provide the fallback. Maintainers will own the integration and cross-slice coordination. #3975 remains the core locale change; the broader Korean completion/release audit stays tracked separately.

    简体中文

    维护者更新决定:本条替代我在 2026-09-08 发布的原子交付决定。

    我们接受韩语渐进式上线。使用共享的英文回退目录机制,在各翻译分片完成前,缺少的韩语文案显示英文。这意味着韩语可能在所有界面翻译完成前就可手动选择或随系统启用;本轮接受这段中英混合的过渡期。

    交付顺序:先让所有受 ko 启用影响的构建和类型检查路径安全支持回退;英文仍必须完整,并保留简繁中文完整性检查,避免回退掩盖已有语言漏译。然后核心启用 PR 单独 squash 到 main;各翻译 PR 准备好后分别 squash 合入,各自保留提交及作者/共同作者归属。临时集成分支用于跨分片界面和 E2E 验证,不作为最终整体 squash 的来源。

    请不要为了满足旧严格类型而复制英文作为 ko 占位;保留真实韩语,由共享解析器提供回退。跨分片集成由维护者负责。#3975 继续跟踪核心语言模型;整体韩语完成度和发布审计继续单独跟踪。

  15. me2seeks commented on Nov 2, 2026

    @me2seeks
    ContributorAuthor

    @heeoneie — I want to revisit where the Korean i18n work should go, because the project direction has changed since our progressive-rollout decision.

    The direction in Discussion #6366 reached lazy consensus on 30 October: new feature work moves to rust-preview, the current main becomes the 0.2.x maintenance line, and the Rust tree is intended to replace main only after the stated readiness checks. The discussion says maintainers will ask authors of open feature PRs whether they want to bring their work over or close it.

    Would you be interested in continuing the Korean localization work on rust-preview? Its plugin-composable product architecture, native Computer Use, and the performance measurements discussed in #6366 make this a promising direction. The cutover is not complete, though, and the desktop/readiness work is still ongoing.

    One important boundary: rust-preview and TypeScript main are incompatible in their Host, UI/plugin, and storage contracts (#6078). This would be a new, scoped Rust-side implementation, not a branch retarget or direct cherry-pick of #5011/#5451. The current Rust locale module normalizes system locale tags; it does not yet provide the typed catalog/fallback contract from the TypeScript work.

    If you’re interested, we’d be glad to support you in continuing the Korean localization work on rust-preview. You can choose the area and pace that suit you; maintainers can coordinate with the Rust/UI owners on any design questions that come up. The terminal and desktop shell use the same NSH workbench, so its UI localization can be shared across both. I’m not asking you to port all the strings at once or take over the GPUI desktop work. If you’d rather not move this contribution, that’s completely fine; we’ll agree how to close the TypeScript feature PRs while keeping the public record of your work.

    简体中文

    @heeoneie,我想重新讨论韩语 i18n 接下来放在哪里,因为项目方向已经变了。之前接受的渐进式英文回退方案,是针对 TypeScript main 的。

    #6366 讨论 已于 10 月 30 日按 lazy consensus 确认方向:新功能转到 rust-preview,当前 main 保留为 0.2.x 维护线;满足既定切换条件后,Rust 代码树才会取代 main。讨论中也说明,维护者会逐个询问已有功能 PR 的作者是迁移工作,还是关闭。

    你是否愿意把韩语本地化工作继续带到 rust-preview?Rust 方向采用可由插件组合的产品架构,包含原生 Computer Use,#6366 也记录了有希望的性能测量结果。不过切换尚未完成,桌面和其他就绪条件仍在推进。

    需要明确:rust-preview 与 TypeScript main 的 Host、UI/插件和存储契约已经不兼容(见 #6078)。这需要在 Rust 架构上重新确定范围并实现,不能简单改 PR 目标分支或直接 cherry-pick #5011/#5451。目前 Rust locale 模块只规范化系统语言标签,还没有 TypeScript 方案里的类型化目录和回退契约。

    如果你有兴趣,我们很愿意支持你把韩语本地化工作继续带到 rust-preview。你可以按自己的兴趣和节奏选择从哪里开始;维护者可以和 Rust/UI 负责人协作处理过程中遇到的设计问题。终端和桌面 shell 使用同一套 NSH 工作台,因此相关 UI 本地化可以在两端复用。我不是要求你一次移植全部文案,也不要求你接手 GPUI 桌面工作。如果你不想迁移也完全没问题;我们会和你商量如何关闭 TypeScript 功能 PR,同时保留你已有工作的公开记录。

  16. heeoneie commented on Nov 2, 2026

    @heeoneie
    Contributor

    @me2seeks Yes, I'll continue the Korean localization on rust-preview, starting with the TUI scope you suggested. I'll take it.

  17. heeoneie commented on Nov 3, 2026

    @heeoneie
    Contributor

    @me2seeks I looked through rust-preview at 7d08799cc. One correction to my reply: since the terminal and desktop share the workbench catalogs, I'd scope this by screen rather than "TUI".

    Proposed first PR

    • Add an optional Korean slot: Message = [en, zhCN, zhTW, ko?], falling back to en. zh-CN and zh-TW stay required by the type, so missing Chinese copy still fails to compile. No English stubs in the ko slot.
    • Extend languageIndex to match ko and ko-*.
    • Add a report of translated vs. fallback keys.
    • Translate locale-common and locale-composer.

    This only applies when the system locale is Korean. It doesn't change the wire format. I tried the type and fallback change on the catalogs in isolation, but I haven't run the app or just check yet.

    Later

    • Add ko to LanguagePreference, the generated schema and the language picker.
    • Translate settings, workspace and conversation in separate PRs.

    Questions

    1. In plugins/shared, the workbench catalogs reference only 96 of the 1,541 exports in locale-messages.ts and tui-messages.ts, and I found no other importers. Are the other 1,445 safe to leave untranslated, or are they waiting to be wired up?
    2. Rust Language is a closed enum, with Language::ZhTw at 176 sites in 68 files. I'd leave it out for now, so Rust-owned copy stays English in Korean. Is that acceptable during the rollout? When we add LanguagePreference::Ko, should it resolve to Language::En until Language::Ko exists?
    3. Do you want this as a discussion first, or is a draft PR against rust-preview fine?

    For #5011 and #5451, I'd like to keep them open until the first PR lands, then close them with a link to it so the record stays connected. Does that work?

  18. me2seeks commented on Nov 3, 2026

    @me2seeks
    ContributorAuthor

    @heeoneie Thanks for taking the time to investigate this and for continuing the Korean localization on rust-preview!

    A draft PR against rust-preview is welcome; there’s no need to open a separate discussion first. Splitting the work into module-based PRs sounds good and should make review and merging easier. Please choose the scope and pace that work for you.

    For the shared message exports that you found no current importers for, it’s fine to focus on the messages used by the current workbench. We don’t need to translate the rest as part of this work; if they are used later, they can be translated when they are brought into use. I can’t yet confirm whether any particular unused export is intended for future wiring, so we shouldn’t assume either way.

    For Rust-owned copy, English during the gradual rollout sounds reasonable. Please note the behavior in the PR; we can review the actual language resolution paths, including how LanguagePreference::Ko should map before a Rust Language::Ko exists, when that change is proposed.

    And yes, let’s keep #5011 and #5451 open until the first Rust-side PR lands, then close them with links to it as you suggested. Thank you for making sure the record of the work stays connected.

  19. heeoneie commented on Nov 23, 2026

    @heeoneie
    Contributor

    @me2seeks #6595 was closed automatically when rust-preview was removed after the switch to main. I rebased the same change onto main and opened it again as draft #7186. The scope is unchanged: common and composer translated, everything else falls back to English, and Rust-owned copy stays English.

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

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions