Skip to content

Commit 19f0109

Browse files
moduvoiceHmbown
authored andcommitted
i18n: add Korean (ko) locale support
Adds full Korean translation (752/752 keys) and registers Locale::Ko throughout the codebase, mirroring the existing vi/ja/zh-Hans/es-419/ pt-BR pattern: - crates/tui/locales/ko.json: new 752-key Korean translation - crates/tui/src/localization.rs: Locale::Ko enum variant, code/display name, ALL_LOCALES lists, locale-specific string match arms, and locale-code parsing - crates/tui/src/tui/setup/mod.rs: (Locale::Ko, ...) match arms for setup-flow strings - crates/tui/src/commands/groups/config/config.rs: Locale::Ko display in `/config` output - crates/tui/src/commands/groups/debug/change.rs: Locale::Ko display name in language switcher - crates/tui/src/tui/onboarding/language.rs: Korean added as option 9 in the onboarding language picker - All 6 pre-existing locale JSON files: fixed onboarding OnboardLanguageFooter hint from "Press 1-8" to "Press 1-9" to account for the new 9th language option Harvested from PR #4347 by @moduvoice
1 parent 0a79b67 commit 19f0109

12 files changed

Lines changed: 922 additions & 6 deletions

File tree

crates/tui/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
"HomeGoalModeTip": "Goal tracking - Set /goal <objective> to pursue objectives",
316316
"OnboardLanguageTitle": "Choose your language",
317317
"OnboardLanguageBlurb": "Pick the UI language. You can change it any time with `/settings set locale <tag>`.",
318-
"OnboardLanguageFooter": "Press 1-8 to choose, or Enter to keep the current setting",
318+
"OnboardLanguageFooter": "Press 1-9 to choose, or Enter to keep the current setting",
319319
"OnboardProviderTitle": "Choose your model provider",
320320
"OnboardProviderBlurb": "Pick where your API key comes from. CodeWhale treats every provider equally — none is privileged.",
321321
"OnboardProviderFooter": "Press 1-8 to choose, ↑/↓ to move, Enter to continue, Esc to go back.",

crates/tui/locales/es-419.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"HomeGoalModeTip": "Seguimiento de Goal - Usa /goal <objetivo> para seguir un objetivo persistente",
314314
"OnboardLanguageTitle": "Elige el idioma",
315315
"OnboardLanguageBlurb": "Elige el idioma de la interfaz. Puedes cambiarlo en cualquier momento con `/settings set locale <etiqueta>`.",
316-
"OnboardLanguageFooter": "Presiona 1-8 para elegir, o Enter para mantener la configuración actual",
316+
"OnboardLanguageFooter": "Presiona 1-9 para elegir, o Enter para mantener la configuración actual",
317317
"OnboardProviderTitle": "Elige tu proveedor de modelos",
318318
"OnboardProviderBlurb": "Elige de dónde viene tu clave API. CodeWhale trata a todos los proveedores por igual — ninguno tiene privilegios.",
319319
"OnboardProviderFooter": "Presiona 1-8 para elegir, ↑/↓ para mover, Enter para continuar, Esc para volver.",

crates/tui/locales/ja.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"HomeGoalModeTip": "Goal 追跡 - /goal <目標> で持続的な目標を追跡",
314314
"OnboardLanguageTitle": "言語を選択",
315315
"OnboardLanguageBlurb": "UI 言語を選んでください。`/settings set locale <tag>` でいつでも変更できます。",
316-
"OnboardLanguageFooter": "1〜8 で選択、または Enter で現在の設定を維持",
316+
"OnboardLanguageFooter": "1〜9 で選択、または Enter で現在の設定を維持",
317317
"OnboardProviderTitle": "モデルプロバイダーを選択",
318318
"OnboardProviderBlurb": "API キーの取得元を選びます。CodeWhale はすべてのプロバイダーを平等に扱います — 特権はありません。",
319319
"OnboardProviderFooter": "1-8 で選択、↑/↓ で移動、Enter で続行、Esc で戻る。",

crates/tui/locales/ko.json

Lines changed: 754 additions & 0 deletions
Large diffs are not rendered by default.

crates/tui/locales/pt-BR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"HomeGoalModeTip": "Rastreamento de Goal - Use /goal <objetivo> para rastrear um objetivo persistente",
314314
"OnboardLanguageTitle": "Escolha o idioma",
315315
"OnboardLanguageBlurb": "Escolha o idioma da interface. Você pode mudá-lo a qualquer momento com `/settings set locale <tag>`.",
316-
"OnboardLanguageFooter": "Pressione 1-8 para escolher, ou Enter para manter a configuração atual",
316+
"OnboardLanguageFooter": "Pressione 1-9 para escolher, ou Enter para manter a configuração atual",
317317
"OnboardProviderTitle": "Escolha seu provedor de modelos",
318318
"OnboardProviderBlurb": "Escolha de onde vem sua chave API. O CodeWhale trata todos os provedores igualmente — nenhum é privilegiado.",
319319
"OnboardProviderFooter": "Pressione 1-8 para escolher, ↑/↓ para mover, Enter para continuar, Esc para voltar.",

crates/tui/locales/vi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"HomeGoalModeTip": "Theo dõi mục tiêu - Dùng /goal <mục_tiêu> để đặt mục tiêu làm việc",
314314
"OnboardLanguageTitle": "Chọn ngôn ngữ của bạn",
315315
"OnboardLanguageBlurb": "Chọn ngôn ngữ hiển thị. Bạn có thể thay đổi bất kỳ lúc nào bằng lệnh `/settings set locale <tag>`.",
316-
"OnboardLanguageFooter": "Nhấn phím từ 1-8 để chọn, hoặc Enter để giữ cài đặt hiện tại",
316+
"OnboardLanguageFooter": "Nhấn phím từ 1-9 để chọn, hoặc Enter để giữ cài đặt hiện tại",
317317
"OnboardProviderTitle": "Chọn nhà cung cấp mô hình",
318318
"OnboardProviderBlurb": "Chọn nguồn khóa API. CodeWhale đối xử bình đẳng với mọi nhà cung cấp — không ai được ưu tiên.",
319319
"OnboardProviderFooter": "Nhấn 1-8 để chọn, ↑/↓ để di chuyển, Enter để tiếp tục, Esc để quay lại.",

crates/tui/locales/zh-Hans.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"HomeGoalModeTip": "Goal 跟踪 - 设置 /goal <目标> 以跟踪持久目标",
314314
"OnboardLanguageTitle": "选择语言",
315315
"OnboardLanguageBlurb": "选择界面语言。可随时使用 `/settings set locale <tag>` 修改。",
316-
"OnboardLanguageFooter": "按 1-8 选择,或按 Enter 保留当前设置",
316+
"OnboardLanguageFooter": "按 1-9 选择,或按 Enter 保留当前设置",
317317
"OnboardProviderTitle": "选择模型提供商",
318318
"OnboardProviderBlurb": "选择 API 密钥来源。CodeWhale 平等对待每个提供商——无一特权。",
319319
"OnboardProviderFooter": "按 1-8 选择,↑/↓ 移动,Enter 继续,Esc 返回。",

crates/tui/src/commands/groups/config/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ fn show_single_setting(app: &App, key: &str) -> CommandResult {
191191
crate::localization::Locale::PtBr => "pt-BR",
192192
crate::localization::Locale::Es419 => "es-419",
193193
crate::localization::Locale::Vi => "vi",
194+
crate::localization::Locale::Ko => "ko",
194195
}
195196
}
196197
fn density_display(d: crate::tui::app::ComposerDensity) -> &'static str {

crates/tui/src/commands/groups/debug/change.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub fn change(app: &mut App, version: Option<&str>) -> CommandResult {
100100
Locale::PtBr => "Brazilian Portuguese (Português)",
101101
Locale::Es419 => "Latin American Spanish (Español latinoamericano)",
102102
Locale::Vi => "Vietnamese (Tiếng Việt)",
103+
Locale::Ko => "Korean (한국어)",
103104
// Fallback — should never reach here since we check En above.
104105
Locale::En => "English",
105106
};

crates/tui/src/localization.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub enum Locale {
1414
PtBr,
1515
Es419,
1616
Vi,
17+
Ko,
1718
}
1819

1920
impl Locale {
@@ -26,6 +27,7 @@ impl Locale {
2627
Self::PtBr => "pt-BR",
2728
Self::Es419 => "es-419",
2829
Self::Vi => "vi",
30+
Self::Ko => "ko",
2931
}
3032
}
3133

@@ -38,6 +40,7 @@ impl Locale {
3840
Self::PtBr => "Brazilian Portuguese (Português do Brasil)",
3941
Self::Es419 => "Latin American Spanish (Español latinoamericano)",
4042
Self::Vi => "Vietnamese (Tiếng Việt)",
43+
Self::Ko => "Korean (한국어)",
4144
}
4245
}
4346

@@ -52,6 +55,7 @@ impl Locale {
5255
Self::PtBr,
5356
Self::Es419,
5457
Self::Vi,
58+
Self::Ko,
5559
]
5660
}
5761

@@ -67,6 +71,7 @@ impl Locale {
6771
Self::PtBr,
6872
Self::Es419,
6973
Self::Vi,
74+
Self::Ko,
7075
]
7176
}
7277

@@ -1633,6 +1638,7 @@ pub fn thinking_translation_placeholder(locale: Locale) -> &'static str {
16331638
Locale::PtBr => "Pensando; traduzindo ao concluir...",
16341639
Locale::Es419 => "Pensando; traduciendo al finalizar...",
16351640
Locale::Vi => "Đang suy nghĩ; sẽ dịch sau khi hoàn thành...",
1641+
Locale::Ko => "생각하는 중입니다. 완료되면 번역합니다...",
16361642
}
16371643
}
16381644

@@ -1645,6 +1651,7 @@ pub fn thinking_translation_in_progress(locale: Locale) -> &'static str {
16451651
Locale::PtBr => "Traduzindo o conteúdo de raciocínio...",
16461652
Locale::Es419 => "Traduciendo el contenido de razonamiento...",
16471653
Locale::Vi => "Đang dịch nội dung suy nghĩ...",
1654+
Locale::Ko => "생각 내용을 번역하는 중...",
16481655
}
16491656
}
16501657

@@ -1657,6 +1664,7 @@ pub fn thinking_translation_complete(locale: Locale) -> &'static str {
16571664
Locale::PtBr => "Tradução do raciocínio concluída",
16581665
Locale::Es419 => "Traducción del razonamiento completada",
16591666
Locale::Vi => "Đã dịch xong nội dung suy nghĩ",
1667+
Locale::Ko => "생각 내용 번역 완료",
16601668
}
16611669
}
16621670

@@ -1669,6 +1677,7 @@ pub fn thinking_translation_failed(locale: Locale) -> &'static str {
16691677
Locale::PtBr => "Falha ao traduzir o raciocínio",
16701678
Locale::Es419 => "Falló la traducción del razonamiento",
16711679
Locale::Vi => "Dịch nội dung suy nghĩ thất bại",
1680+
Locale::Ko => "생각 내용 번역 실패",
16721681
}
16731682
}
16741683

@@ -1681,6 +1690,7 @@ pub fn hidden_translation_failed(locale: Locale) -> &'static str {
16811690
Locale::PtBr => "A tradução falhou; o texto original está oculto.",
16821691
Locale::Es419 => "La traducción falló; el texto original está oculto.",
16831692
Locale::Vi => "Dịch thất bại; văn bản gốc đã bị ẩn.",
1693+
Locale::Ko => "번역에 실패했습니다. 원문은 숨겨져 있습니다.",
16841694
}
16851695
}
16861696

@@ -1784,6 +1794,9 @@ fn parse_locale(value: &str) -> Option<Locale> {
17841794
if value.starts_with("vi") {
17851795
return Some(Locale::Vi);
17861796
}
1797+
if value.starts_with("ko") {
1798+
return Some(Locale::Ko);
1799+
}
17871800
None
17881801
}
17891802

@@ -1847,6 +1860,7 @@ mod tests {
18471860
Locale::PtBr => include_str!("../locales/pt-BR.json"),
18481861
Locale::Es419 => include_str!("../locales/es-419.json"),
18491862
Locale::Vi => include_str!("../locales/vi.json"),
1863+
Locale::Ko => include_str!("../locales/ko.json"),
18501864
}
18511865
}
18521866

0 commit comments

Comments
 (0)