mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 14:16:43 +00:00
feat(dashboard): add Korean language support
Adds Korean (ko) as a supported dashboard locale alongside en, zh-CN, vi, ja.
Browser locales starting with `ko` (e.g. `ko-KR`) normalize to `ko` and the
Language switcher exposes "Korean" / "한국어" as a selectable option.
The full ~2670-key translation block was translated from the English source
with the formal-polite register (하십시오체) appropriate for an enterprise
dashboard. Technical names (CCS, Claude, CLIProxy, OAuth, provider names,
env vars, paths) are kept untranslated. All placeholders (e.g. {{name}},
{{count}}, {{provider}}) are preserved verbatim, matching the parity test.
Also backfills 23 keys missing from zh-CN, vi, and ja that were added to en
with the recent "Shared Resource Controls" feature (#1206 -> 2a422b3b):
accountsPage.resources*, accountsTable.{sharedResources,resourcesTitle,
resourcesShared,resourcesProfileLocal,badges.profileLocal},
commonToast.resourcesUpdated, and the full editAccountSharedResources
section. Without this backfill the existing i18n parity test was red for
all non-en locales on dev.
Closes #1241
This commit is contained in:
+2760
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
export const LOCALE_STORAGE_KEY = 'ccs-ui-locale';
|
||||
|
||||
export const SUPPORTED_LOCALES = ['en', 'zh-CN', 'vi', 'ja'] as const;
|
||||
export const SUPPORTED_LOCALES = ['en', 'zh-CN', 'vi', 'ja', 'ko'] as const;
|
||||
|
||||
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
|
||||
|
||||
@@ -10,6 +10,7 @@ export function isSupportedLocale(locale: string): locale is AppLocale {
|
||||
|
||||
export function normalizeLocale(locale: string | null | undefined): AppLocale {
|
||||
if (!locale) return 'en';
|
||||
if (locale.toLowerCase().startsWith('ko')) return 'ko';
|
||||
if (locale.toLowerCase().startsWith('ja')) return 'ja';
|
||||
if (locale.toLowerCase().startsWith('zh')) return 'zh-CN';
|
||||
if (locale.toLowerCase().startsWith('vi')) return 'vi';
|
||||
|
||||
@@ -96,6 +96,7 @@ describe('Dashboard i18n', () => {
|
||||
it.each([
|
||||
{ locale: 'vi', label: 'Vietnamese', browserLocale: 'vi-VN' },
|
||||
{ locale: 'ja', label: 'Japanese', browserLocale: 'ja-JP' },
|
||||
{ locale: 'ko', label: 'Korean', browserLocale: 'ko-KR' },
|
||||
])(
|
||||
'supports $locale locale in switcher and persistence',
|
||||
async ({ locale, label, browserLocale }) => {
|
||||
|
||||
Reference in New Issue
Block a user