11import { HTMLAttributes } from "react"
22import { useAppTranslation } from "@/i18n/TranslationContext"
33import { Trans } from "react-i18next"
4+ import { Globe } from "lucide-react"
45
56import { VSCodeButton , VSCodeCheckbox , VSCodeLink } from "@vscode/webview-ui-toolkit/react"
67
78import { vscode } from "@/utils/vscode"
89import { cn } from "@/lib/utils"
910import { TelemetrySetting } from "../../../../src/shared/TelemetrySetting"
11+ import { SetCachedStateField } from "./types"
12+
13+ // Map of language codes to their display names
14+ const LANGUAGES : Record < string , string > = {
15+ ar : "العربية" ,
16+ ca : "Català" ,
17+ cs : "Čeština" ,
18+ de : "Deutsch" ,
19+ en : "English" ,
20+ es : "Español" ,
21+ fr : "Français" ,
22+ hi : "हिन्दी" ,
23+ hu : "Magyar" ,
24+ it : "Italiano" ,
25+ ja : "日本語" ,
26+ ko : "한국어" ,
27+ pl : "Polski" ,
28+ pt : "Português" ,
29+ "pt-BR" : "Português do Brasil" ,
30+ ru : "Русский" ,
31+ tr : "Türkçe" ,
32+ "zh-CN" : "简体中文" ,
33+ "zh-TW" : "繁體中文" ,
34+ }
1035
1136type SettingsFooterProps = HTMLAttributes < HTMLDivElement > & {
1237 version : string
1338 telemetrySetting : TelemetrySetting
1439 setTelemetrySetting : ( setting : TelemetrySetting ) => void
40+ language : string
41+ setCachedStateField : SetCachedStateField < "language" >
1542}
1643
1744export const SettingsFooter = ( {
1845 version,
1946 telemetrySetting,
2047 setTelemetrySetting,
48+ language,
49+ setCachedStateField,
2150 className,
2251 ...props
2352} : SettingsFooterProps ) => {
@@ -35,7 +64,26 @@ export const SettingsFooter = ({
3564 } }
3665 />
3766 </ p >
38- < p className = "italic" > { t ( "settings:footer.version" , { version } ) } </ p >
67+ < div className = "flex items-center gap-4" >
68+ < div className = "flex items-center text-nowrap" >
69+ < p > Roo Code</ p >
70+ < p className = "italic ml-1" > v{ version } </ p >
71+ </ div >
72+ < div className = "relative flex items-center" >
73+ < Globe className = "w-4 h-4 text-vscode-descriptionForeground absolute left-2 pointer-events-none" />
74+ < select
75+ value = { language }
76+ onChange = { ( e ) => setCachedStateField ( "language" , e . target . value ) }
77+ className = "appearance-none bg-transparent text-vscode-foreground border border-transparent hover:border-vscode-input-border focus:border-vscode-focusBorder rounded px-2 py-1 pl-7 text-xs min-w-[70px]"
78+ title = { LANGUAGES [ language ] } >
79+ { Object . entries ( LANGUAGES ) . map ( ( [ code , name ] ) => (
80+ < option key = { code } value = { code } >
81+ { name }
82+ </ option >
83+ ) ) }
84+ </ select >
85+ </ div >
86+ </ div >
3987 < div className = "mt-4 mb-4" >
4088 < div >
4189 < VSCodeCheckbox
0 commit comments