@@ -5,8 +5,10 @@ import { GeminiContextLoader, createContextLoader } from '@/utils/gemini-context
55import ChatMessageComponent from './chat-message' ;
66import { IoSend , IoRefresh , IoSparkles , IoDocument , IoStop } from 'react-icons/io5' ;
77import { v4 as uuidv4 } from 'uuid' ;
8+ import { useTranslation } from 'react-i18next' ;
89
910export default function AIChat ( ) {
11+ const { i18n } = useTranslation ( ) ;
1012 const [ messages , setMessages ] = useState < ChatMessage [ ] > ( [ ] ) ;
1113 const [ inputValue , setInputValue ] = useState ( '' ) ;
1214 const [ status , setStatus ] = useState < ChatStatus > ( ChatStatus . IDLE ) ;
@@ -150,13 +152,15 @@ export default function AIChat() {
150152 const terminalContext = contextLoader . current ?. getCurrentTerminalContext ( ) || '' ;
151153
152154 // Use the new simplified chat API - all teaching guidelines are now in backend
153- console . log ( `[AIChat] Sending message with session ${ sessionId . substring ( 0 , 8 ) } ... (history: ${ messages . length } messages)` ) ;
155+ const currentLanguage = i18n . language || 'en' ;
156+ console . log ( `[AIChat] Sending message with session ${ sessionId . substring ( 0 , 8 ) } ... (history: ${ messages . length } messages, language: ${ currentLanguage } )` ) ;
154157 await geminiClient . current . chatWithContext (
155158 sessionId ,
156159 userMessage . content ,
157160 messages , // Conversation history
158161 editorContext ,
159162 terminalContext ,
163+ currentLanguage , // User's selected language
160164 ( content : string ) => {
161165 // Check if generation was aborted
162166 if ( abortController . current ?. signal . aborted ) {
0 commit comments