Fear/voice chatbot
Summary This MR implements comprehensive internationalization (i18n) and localization (l10n) across the application, establishing Telugu as the primary default language. It also completes the "Voice-to-Voice" loop for the AI assistant, relocating the voice interface to the chatbot area for a more integrated user experience.
Key Changes
- Internationalization (i18n) & Localization (l10n)
- Default Language: Updated App.jsx to initialize the application in Telugu ('te').
- Expanded Translation Schema: Updated src/i18n/ (English, Telugu, Hindi) to include new keys for the AI Assistant, including bot names, greetings, and action tooltips.
- Dynamic UI Updates: Refactored the "Kisan Sahayak" chatbot to dynamically switch its greeting message and interface labels whenever the global language state changes.
- Voice Assistant Relocation & Automation
- Relocation: Moved the microphone interface from the main SearchBar to the BotAssistant header to provide a focused AI interaction point.
- Hands-Free Interaction: Implemented automated message dispatch. When a user speaks, the transcript is automatically sent to the AI (Groq/Gemini) without requiring a manual click of the "Send" button.
- Text-to-Speech (TTS) Integration: Added a "Voice-Out" feature where the bot automatically reads its response aloud in the user's selected language (Telugu, Hindi, or English) if the query was initiated via voice.
- UI/UX Improvements
- Button Discoverability: Redesigned the voice assistant button in the chatbot header to be larger and more prominent (High-contrast white square).
- Visual Feedback: Added pulsing animations and dynamic placeholder text ("Listening...") to indicate active voice recording states.
Technical Notes
- Exclusively Groq/Gemini: The AI service now supports high-speed Groq (Llama 3.3) with a seamless fallback to Gemini.
- Rate-Limit Protection: All AI and data requests continue to use the centralized apiClient queue to prevent 429 errors.
- Browser Compatibility: Voice features are optimized for Web Speech API compatible browsers (Chrome/Edge).
Testing Instructions
- Verify the app loads in Telugu by default.
- Open the chatbot and verify the greeting is in Telugu.
- Click the microphone icon, ask a question in Telugu, and verify the bot responds and speaks back in Telugu.
- Switch the language to English via the header globe icon and verify the chatbot greeting updates instantly.
Edited by Banuri Koushik Reddy