From d2d3b73f530b58c5eedaa09cff21c00d5355ff70 Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Mon, 23 Mar 2026 17:17:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E9=99=84=E4=BB=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=8C=89=E9=92=AE=E5=9B=BD=E9=99=85=E5=8C=96=20-=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=20prompt-input=20=E9=99=84=E4=BB=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F=EF=BC=8C=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=9A=90=E8=97=8F=EF=BC=8Chover=20=E6=97=B6=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ai-elements/message.tsx | 9 ++++++--- frontend/src/components/ai-elements/prompt-input.tsx | 7 ++++--- frontend/src/core/i18n/locales/en-US.ts | 1 + frontend/src/core/i18n/locales/types.ts | 1 + frontend/src/core/i18n/locales/zh-CN.ts | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/ai-elements/message.tsx b/frontend/src/components/ai-elements/message.tsx index 9c36a669..24f8b5e9 100644 --- a/frontend/src/components/ai-elements/message.tsx +++ b/frontend/src/components/ai-elements/message.tsx @@ -8,6 +8,7 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; +import { useI18n } from "@/core/i18n/hooks"; import { cn } from "@/lib/utils"; import type { FileUIPart, UIMessage } from "ai"; import { @@ -333,6 +334,7 @@ export function MessageAttachment({ onRemove, ...props }: MessageAttachmentProps) { + const { t } = useI18n(); const filename = data.filename || ""; const mediaType = data.mediaType?.startsWith("image/") && data.url ? "image" : "file"; @@ -358,7 +360,7 @@ export function MessageAttachment({ /> {onRemove && ( )} @@ -386,7 +388,7 @@ export function MessageAttachment({ {onRemove && ( )} diff --git a/frontend/src/components/ai-elements/prompt-input.tsx b/frontend/src/components/ai-elements/prompt-input.tsx index dd96c28b..b0a844f3 100644 --- a/frontend/src/components/ai-elements/prompt-input.tsx +++ b/frontend/src/components/ai-elements/prompt-input.tsx @@ -290,6 +290,7 @@ export function PromptInputAttachment({ ...props }: PromptInputAttachmentProps) { const attachments = usePromptInputAttachments(); + const { t } = useI18n(); const filename = data.filename || ""; @@ -348,7 +349,7 @@ export function PromptInputAttachment({ {/* 删除按钮 - 右上角 */}