mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
* feat: set preferred language in settings and have it update system prompt * Update webview-ui/src/components/settings/PreferredLanguagePicker.tsx Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * remove unnecessary useEffect * tweak prompt * formatting from main * Update Cline.ts * Revert "Update Cline.ts" This reverts commit bee6f0fee0b0783293aa035e566978589fe837d6. * Fixes * Update Cline.ts * move preferredLanguage to Advanced Settings * remove unneccessary import * remove more imports * skip language prompt for default language `en` * Update package.json * lint --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com>
73 lines
2 KiB
TypeScript
73 lines
2 KiB
TypeScript
export type LanguageKey =
|
|
| "en"
|
|
| "ar"
|
|
| "pt-BR"
|
|
| "cs"
|
|
| "fr"
|
|
| "de"
|
|
| "hi"
|
|
| "hu"
|
|
| "it"
|
|
| "ja"
|
|
| "ko"
|
|
| "pl"
|
|
| "pt-PT"
|
|
| "ru"
|
|
| "zh-CN"
|
|
| "es"
|
|
| "zh-TW"
|
|
| "tr"
|
|
|
|
export type LanguageDisplay =
|
|
| "English"
|
|
| "Arabic - العربية"
|
|
| "Portuguese - Português (Brasil)"
|
|
| "Czech - Čeština"
|
|
| "French - Français"
|
|
| "German - Deutsch"
|
|
| "Hindi - हिन्दी"
|
|
| "Hungarian - Magyar"
|
|
| "Italian - Italiano"
|
|
| "Japanese - 日本語"
|
|
| "Korean - 한국어"
|
|
| "Polish - Polski"
|
|
| "Portuguese - Português (Portugal)"
|
|
| "Russian - Русский"
|
|
| "Simplified Chinese - 简体中文"
|
|
| "Spanish - Español"
|
|
| "Traditional Chinese - 繁體中文"
|
|
| "Turkish - Türkçe"
|
|
|
|
export const DEFAULT_LANGUAGE_SETTINGS: LanguageKey = "en"
|
|
|
|
export const languageOptions: { key: LanguageKey; display: LanguageDisplay }[] = [
|
|
{ key: "en", display: "English" },
|
|
{ key: "ar", display: "Arabic - العربية" },
|
|
{ key: "pt-BR", display: "Portuguese - Português (Brasil)" },
|
|
{ key: "cs", display: "Czech - Čeština" },
|
|
{ key: "fr", display: "French - Français" },
|
|
{ key: "de", display: "German - Deutsch" },
|
|
{ key: "hi", display: "Hindi - हिन्दी" },
|
|
{ key: "hu", display: "Hungarian - Magyar" },
|
|
{ key: "it", display: "Italian - Italiano" },
|
|
{ key: "ja", display: "Japanese - 日本語" },
|
|
{ key: "ko", display: "Korean - 한국어" },
|
|
{ key: "pl", display: "Polish - Polski" },
|
|
{ key: "pt-PT", display: "Portuguese - Português (Portugal)" },
|
|
{ key: "ru", display: "Russian - Русский" },
|
|
{ key: "zh-CN", display: "Simplified Chinese - 简体中文" },
|
|
{ key: "es", display: "Spanish - Español" },
|
|
{ key: "zh-TW", display: "Traditional Chinese - 繁體中文" },
|
|
{ key: "tr", display: "Turkish - Türkçe" },
|
|
]
|
|
|
|
export function getLanguageKey(display: LanguageDisplay | undefined): LanguageKey {
|
|
if (!display) {
|
|
return DEFAULT_LANGUAGE_SETTINGS
|
|
}
|
|
const languageOption = languageOptions.find((option) => option.display === display)
|
|
if (languageOption) {
|
|
return languageOption.key
|
|
}
|
|
return DEFAULT_LANGUAGE_SETTINGS
|
|
}
|