diff --git a/src/components/AskAIDialog.tsx b/src/components/AskAIDialog.tsx index 238ff81..19a3ab3 100644 --- a/src/components/AskAIDialog.tsx +++ b/src/components/AskAIDialog.tsx @@ -6,6 +6,8 @@ import DOMPurify from 'dompurify' import { Minus, X } from 'lucide-react' import { ChatBubble } from './ChatBubble' import { SourceHint } from './SourceHint' +import { useLanguage } from '@i18n/LanguageProvider' +import { translations } from '@i18n/translations' const MAX_MESSAGES = 20 const MAX_CACHE_SIZE = 50 @@ -49,8 +51,12 @@ export function AskAIDialog({ new Map() ) const requestIdRef = useRef(0) + const requestIdRef = useRef(0) const processedInitialRef = useRef(null) + const { language } = useLanguage() + const t = translations[language].askAI + useEffect(() => { return () => { abortRef.current?.abort() @@ -311,8 +317,8 @@ export function AskAIDialog({
-

Ask AI

-

Ask anything about your docs

+

{t.title}

+

{t.subtitle}

diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts index 26f6c6f..8df52fa 100644 --- a/src/i18n/translations.ts +++ b/src/i18n/translations.ts @@ -582,6 +582,12 @@ export type Translation = { } } about: AboutTranslation + askAI: { + title: string + subtitle: string + placeholder: string + ask: string + } } export const translations: Record<'en' | 'zh', Translation> = { @@ -1311,6 +1317,12 @@ export const translations: Record<'en' | 'zh', Translation> = { ], opensource: 'We embrace open source. Human progress is made possible through continuous sharing and collaboration.', }, + askAI: { + title: 'Ask AI', + subtitle: 'Do anything with Moltbot AI', + placeholder: 'Type your question...', + ask: 'Ask', + }, }, zh: { hero: { @@ -1886,5 +1898,11 @@ export const translations: Record<'en' | 'zh', Translation> = { ], opensource: '我们拥抱开源。人类正是因为持续的共享与协作,才得以彼此成就。', }, + askAI: { + title: 'Ask AI', + subtitle: '使用 Moltbot AI 做任何事', + placeholder: '输入您的指令或问题...', + ask: '发送', + }, }, }