From 1eb677cfe083ba674d2632c40ab60561534c4084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B9=E9=9B=AA?= <2b@yorha.xyz> Date: Thu, 11 Jun 2026 03:55:15 +0900 Subject: [PATCH] feat(ui): i18n for chat messages --- .../src/components/chat/ChatMessages.tsx | 23 ++++++++++++------- ui/litellm-dashboard/src/locales/en.json | 10 ++++++++ ui/litellm-dashboard/src/locales/zh-CN.json | 10 ++++++++ 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/ui/litellm-dashboard/src/components/chat/ChatMessages.tsx b/ui/litellm-dashboard/src/components/chat/ChatMessages.tsx index 67b55697481..bbb6731f253 100644 --- a/ui/litellm-dashboard/src/components/chat/ChatMessages.tsx +++ b/ui/litellm-dashboard/src/components/chat/ChatMessages.tsx @@ -3,6 +3,7 @@ import { ToolOutlined, CopyOutlined, CheckOutlined, EditOutlined } from "@ant-design/icons"; import { Collapse, Tooltip } from "antd"; import React, { useEffect, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; import ReactMarkdown from "react-markdown"; import remarkGfm from "remark-gfm"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; @@ -78,6 +79,7 @@ interface UserBubbleProps { } function UserBubble({ message, onEdit, isStreaming }: UserBubbleProps) { + const { t } = useTranslation(); const [hovered, setHovered] = useState(false); const [editing, setEditing] = useState(false); const [editValue, setEditValue] = useState(message.content); @@ -174,7 +176,7 @@ function UserBubble({ message, onEdit, isStreaming }: UserBubbleProps) { cursor: "pointer", }} > - Cancel + {t("common.cancel")} @@ -207,7 +209,7 @@ function UserBubble({ message, onEdit, isStreaming }: UserBubbleProps) {
{/* Edit button — appears on hover, to the left of the bubble */} {hovered && !isStreaming && onEdit && ( - +