feat(i18n): add Korean (ko) translation#7290
Open
moduvoice wants to merge 1 commit into
Open
Conversation
Add full Korean translation for the main app's product-facing i18n system (packages/web/i18n, shared by projects/app and projects/marketplace), which previously only supported en/zh-CN/zh-Hant. All 24 namespace files are translated with full key parity against the English source (3634 keys total). Register the new locale end-to-end: LangEnum/LocaleList/langMap (with a new Korea flag icon), next-i18next locales arrays in both projects/app and projects/marketplace, the browser-language-to-locale mapping in packages/web/i18n/utils.ts, and the shared-chat language switcher's locale list. Also harden getModelProvider() on both the client store and the server-side provider controller: they previously indexed a provider-name/avatar cache map built only for the pre-existing three locales, which would throw when called with any other locale (including the new 'ko') — now they gracefully fall back to the default provider info instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
1 similar comment
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This adds Korean (
ko) translation support — to help Korean-speaking users use thisopen-source project more comfortably in their own language.
(한국 사람들의 오픈소스 이용에 도움이 되게 하기 위해서 한글화 작업을 하였습니다.)
Changes
packages/web/i18n/ko/, the main app's product-facing i18n directory (shared byprojects/appandprojects/marketplacevialocalePath). This is the app's real UI i18n system — distinct fromdocument/i18n, which only covers the documentation site. Translated from the English (en) source with exact key parity (3,634 keys, verified programmatically) and all{{placeholder}}/ HTML-like tag interpolations preserved.packages/global/common/i18n/type.ts: addkotoLangEnum,LocaleList, andlangMap(with a new Korean flag icon,common/language/Korea.svg, registered in the icon manifest).projects/app/next-i18next.config.js,projects/app/next.config.ts,projects/marketplace/next-i18next.config.js: addkoto thelocalesarray.packages/web/i18n/utils.ts: map browser locale strings (ko,ko-KR) to the app'skolocale, including the smart-fallback path.projects/app/.../useChatLanguageSwitch.ts: addkoto the shared-chat language switcher's fixed locale list.getModelProvider()in bothprojects/app/src/web/common/system/useSystemStore.ts(client) andpackages/service/core/app/provider/controller.ts(server): both indexed a provider name/avatar cache map that is only pre-built for the historical three locales. Calling them with any other locale (including the newko) would throwCannot read properties of undefined— this is exercised by many core screens (model config table, channel edit, model dashboard/logs, chat model selector, TTS select, etc.) viai18n.language. Both now fall back gracefully to the default provider info instead of throwing.Note on scope:
packages/global/common/i18n/type.tsalso has a much smaller, separateI18nStringType(enrequired,zh-CN/zh-Hantoptional) used for a handful of inline, hardcoded content strings scattered across the codebase (e.g. a few sandbox tool descriptions, one workflow template's sub-app names, the custom error page). I deliberately left that type untouched — extending it would mean hand-editing many unrelated files' hardcoded content rather than adding a translation. Since that type already falls back toenfor any locale it doesn't recognize (the same pattern used forzh-Hant→zh-CN), Korean users see the English text there instead of a broken value — a small, contained, and honest gap rather than a functional problem.Testing
ko/*.jsonfiles have exact key parity withen/*.json(3,634 keys,encount ==kocount, zero missing/extra keys in either direction).{{variable}}and<tag>...</tag>interpolation placeholders are preserved (as a multiset per key); the only differences found were a few English source strings themselves duplicating a placeholder multiple times inconsistently (likely a pre-existing bug in the English audit-log strings) — the Korean text uses every unique placeholder needed, just without the redundant repeats.LocaleList,langMap,chatLanguageList,getLangMapping) to confirm none assume a fixed 3-locale set; found and fixed the twogetModelProvidercall sites described above that did.pnpm test/pnpm lintin this environment (fresh clone, nonode_modules, and this is a large pnpm-workspace monorepo); the change set is limited to translation JSON plus small, self-contained TypeScript/config edits that were reviewed by hand.🤖 Generated with Claude Code