@@ -21,6 +21,8 @@ import {
2121 StopIcon ,
2222} from "@hugeicons/core-free-icons" ;
2323import { cn } from '@/lib/utils' ;
24+ import { useTranslation } from '@/hooks/useTranslation' ;
25+ import type { TranslationKey } from '@/i18n' ;
2426import {
2527 PromptInput ,
2628 PromptInputTextarea ,
@@ -65,6 +67,7 @@ interface PopoverItem {
6567 label : string ;
6668 value : string ;
6769 description ?: string ;
70+ descriptionKey ?: TranslationKey ;
6871 builtIn ?: boolean ;
6972 immediate ?: boolean ;
7073 installedSource ?: "agents" | "claude" ;
@@ -91,15 +94,15 @@ const COMMAND_PROMPTS: Record<string, string> = {
9194} ;
9295
9396const BUILT_IN_COMMANDS : PopoverItem [ ] = [
94- { label : 'help' , value : '/help' , description : 'Show available commands and tips' , builtIn : true , immediate : true , icon : HelpCircleIcon } ,
95- { label : 'clear' , value : '/clear' , description : 'Clear conversation history' , builtIn : true , immediate : true , icon : Delete02Icon } ,
96- { label : 'cost' , value : '/cost' , description : 'Show token usage statistics' , builtIn : true , immediate : true , icon : Coins01Icon } ,
97- { label : 'compact' , value : '/compact' , description : 'Compress conversation context' , builtIn : true , icon : FileZipIcon } ,
98- { label : 'doctor' , value : '/doctor' , description : 'Diagnose project health' , builtIn : true , icon : Stethoscope02Icon } ,
99- { label : 'init' , value : '/init' , description : 'Initialize CLAUDE.md for project' , builtIn : true , icon : FileEditIcon } ,
100- { label : 'review' , value : '/review' , description : 'Review code quality' , builtIn : true , icon : SearchList01Icon } ,
101- { label : 'terminal-setup' , value : '/terminal-setup' , description : 'Configure terminal settings' , builtIn : true , icon : CommandLineIcon } ,
102- { label : 'memory' , value : '/memory' , description : 'Edit project memory file' , builtIn : true , icon : BrainIcon } ,
97+ { label : 'help' , value : '/help' , description : 'Show available commands and tips' , descriptionKey : 'messageInput.helpDesc' , builtIn : true , immediate : true , icon : HelpCircleIcon } ,
98+ { label : 'clear' , value : '/clear' , description : 'Clear conversation history' , descriptionKey : 'messageInput.clearDesc' , builtIn : true , immediate : true , icon : Delete02Icon } ,
99+ { label : 'cost' , value : '/cost' , description : 'Show token usage statistics' , descriptionKey : 'messageInput.costDesc' , builtIn : true , immediate : true , icon : Coins01Icon } ,
100+ { label : 'compact' , value : '/compact' , description : 'Compress conversation context' , descriptionKey : 'messageInput.compactDesc' , builtIn : true , icon : FileZipIcon } ,
101+ { label : 'doctor' , value : '/doctor' , description : 'Diagnose project health' , descriptionKey : 'messageInput.doctorDesc' , builtIn : true , icon : Stethoscope02Icon } ,
102+ { label : 'init' , value : '/init' , description : 'Initialize CLAUDE.md for project' , descriptionKey : 'messageInput.initDesc' , builtIn : true , icon : FileEditIcon } ,
103+ { label : 'review' , value : '/review' , description : 'Review code quality' , descriptionKey : 'messageInput.reviewDesc' , builtIn : true , icon : SearchList01Icon } ,
104+ { label : 'terminal-setup' , value : '/terminal-setup' , description : 'Configure terminal settings' , descriptionKey : 'messageInput.terminalSetupDesc' , builtIn : true , icon : CommandLineIcon } ,
105+ { label : 'memory' , value : '/memory' , description : 'Edit project memory file' , descriptionKey : 'messageInput.memoryDesc' , builtIn : true , icon : BrainIcon } ,
103106] ;
104107
105108interface ModeOption {
@@ -183,11 +186,12 @@ function FileAwareSubmitButton({
183186 */
184187function AttachFileButton ( ) {
185188 const attachments = usePromptInputAttachments ( ) ;
189+ const { t } = useTranslation ( ) ;
186190
187191 return (
188192 < PromptInputButton
189193 onClick = { ( ) => attachments . openFileDialog ( ) }
190- tooltip = "Attach files"
194+ tooltip = { t ( 'messageInput.attachFiles' ) }
191195 >
192196 < HugeiconsIcon icon = { PlusSignIcon } className = "h-3.5 w-3.5" />
193197 </ PromptInputButton >
@@ -331,6 +335,7 @@ export function MessageInput({
331335 mode = 'code' ,
332336 onModeChange,
333337} : MessageInputProps ) {
338+ const { t } = useTranslation ( ) ;
334339 const textareaRef = useRef < HTMLTextAreaElement > ( null ) ;
335340 const popoverRef = useRef < HTMLDivElement > ( null ) ;
336341 const searchInputRef = useRef < HTMLInputElement > ( null ) ;
@@ -752,9 +757,9 @@ export function MessageInput({
752757 < HugeiconsIcon icon = { CommandLineIcon } className = "h-4 w-4 shrink-0 text-muted-foreground" />
753758 ) }
754759 < span className = "font-mono text-xs truncate" > { item . label } </ span >
755- { item . description && (
760+ { ( item . descriptionKey || item . description ) && (
756761 < span className = "text-xs text-muted-foreground truncate max-w-[200px]" >
757- { item . description }
762+ { item . descriptionKey ? t ( item . descriptionKey ) : item . description }
758763 </ span >
759764 ) }
760765 { ! item . builtIn && item . installedSource && (
@@ -919,7 +924,7 @@ export function MessageInput({
919924 ) }
920925 onClick = { ( ) => onModeChange ?.( opt . value ) }
921926 >
922- { opt . label }
927+ { opt . value === 'code' ? t ( 'messageInput.modeCode' ) : opt . value === 'plan' ? t ( 'messageInput.modePlan' ) : opt . label }
923928 </ button >
924929 ) ;
925930 } ) }
0 commit comments