From 4817e75d1f9cd4d483f280484e918b7fde890102 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 21 Apr 2025 09:50:01 +0800 Subject: [PATCH] . --- components/chat/chat-secondary-buttons.tsx | 30 ++++++++------ public/locales/en/translation.json | 46 ++++++++++++++-------- public/locales/ja/translation.json | 14 +++++++ public/locales/zh/translation.json | 46 ++++++++++++++-------- 4 files changed, 91 insertions(+), 45 deletions(-) diff --git a/components/chat/chat-secondary-buttons.tsx b/components/chat/chat-secondary-buttons.tsx index 780f765..ea8e356 100644 --- a/components/chat/chat-secondary-buttons.tsx +++ b/components/chat/chat-secondary-buttons.tsx @@ -3,10 +3,14 @@ import { ChatbotUIContext } from "@/context/context" import { IconInfoCircle, IconMessagePlus } from "@tabler/icons-react" import { FC, useContext } from "react" import { WithTooltip } from "../ui/with-tooltip" +import { useTranslation } from 'react-i18next' interface ChatSecondaryButtonsProps {} export const ChatSecondaryButtons: FC = ({}) => { + + const { t } = useTranslation() + const { selectedChat } = useContext(ChatbotUIContext) const { handleNewChat } = useChatHandler() @@ -19,31 +23,31 @@ export const ChatSecondaryButtons: FC = ({}) => { delayDuration={200} display={
-
Chat Info
+
{t("chatInfo.title")}
-
Model: {selectedChat.model}
-
Prompt: {selectedChat.prompt}
+
{t("chatInfo.model")}: {selectedChat.model}
+
{t("chatInfo.prompt")}: {selectedChat.prompt}
-
Temperature: {selectedChat.temperature}
-
Context Length: {selectedChat.context_length}
+
{t("chatInfo.temperature")}: {selectedChat.temperature}
+
{t("chatInfo.contextLength")}: {selectedChat.context_length}
- Profile Context:{" "} + {t("chatInfo.profileContext")}:{" "} {selectedChat.include_profile_context - ? "Enabled" - : "Disabled"} + ? t("chatInfo.enabled") + : t("chatInfo.disabled")}
{" "} - Workspace Instructions:{" "} + {t("chatInfo.workspaceInstructions")}:{" "} {selectedChat.include_workspace_instructions - ? "Enabled" - : "Disabled"} + ? t("chatInfo.enabled") + : t("chatInfo.disabled")}
- Embeddings Provider: {selectedChat.embeddings_provider} + {t("chatInfo.embeddingsProvider")}: {selectedChat.embeddings_provider}
@@ -60,7 +64,7 @@ export const ChatSecondaryButtons: FC = ({}) => { Start a new chat} + display={
{t("chat.startNewChat")}
} trigger={