diff --git a/frontend/src/components/chat/ChatInput.tsx b/frontend/src/components/chat/ChatInput.tsx index b1cee26688..21cbd17a02 100644 --- a/frontend/src/components/chat/ChatInput.tsx +++ b/frontend/src/components/chat/ChatInput.tsx @@ -62,7 +62,7 @@ function ChatInput({ disabled = false, onSendMessage }: ChatInputProps) { ? "cursor-not-allowed border-neutral-400 text-neutral-400" : "hover:bg-neutral-500 ", )} - aria-label="Send message" + aria-label={t(I18nKey.CHAT_INTERFACE$TOOLTIP_SEND_MESSAGE)} > diff --git a/frontend/src/components/chat/ChatMessage.tsx b/frontend/src/components/chat/ChatMessage.tsx index 095b08c6ca..6b4660eeb3 100644 --- a/frontend/src/components/chat/ChatMessage.tsx +++ b/frontend/src/components/chat/ChatMessage.tsx @@ -2,8 +2,10 @@ import React, { useState } from "react"; import Markdown from "react-markdown"; import { FaClipboard } from "react-icons/fa"; import { twMerge } from "tailwind-merge"; +import { useTranslation } from "react-i18next"; import { code } from "../markdown/code"; import toast from "#/utils/toast"; +import { I18nKey } from "#/i18n/declaration"; interface MessageProps { message: Message; @@ -18,14 +20,18 @@ function ChatMessage({ message }: MessageProps) { message.sender === "user" ? "bg-neutral-700 self-end" : "bg-neutral-500", ); + const { t } = useTranslation(); const copyToClipboard = () => { navigator.clipboard .writeText(message.content) .then(() => { - toast.info("Message copied to clipboard!"); + toast.info(t(I18nKey.CHAT_INTERFACE$CHAT_MESSAGE_COPIED)); }) - .catch((error) => { - toast.error("copy-error", `Failed to copy message: ${error}`); + .catch(() => { + toast.error( + "copy-error", + t(I18nKey.CHAT_INTERFACE$CHAT_MESSAGE_COPY_FAILED), + ); }); }; @@ -40,7 +46,7 @@ function ChatMessage({ message }: MessageProps) {