diff --git a/components/sidebar/items/chat/delete-chat.tsx b/components/sidebar/items/chat/delete-chat.tsx index 868e38a..0465c59 100644 --- a/components/sidebar/items/chat/delete-chat.tsx +++ b/components/sidebar/items/chat/delete-chat.tsx @@ -16,11 +16,16 @@ import { Tables } from "@/supabase/types" import { IconTrash } from "@tabler/icons-react" import { FC, useContext, useRef, useState } from "react" +import { useTranslation } from 'react-i18next' + interface DeleteChatProps { chat: Tables<"chats"> } export const DeleteChat: FC = ({ chat }) => { + + const { t } = useTranslation() + useHotkey("Backspace", () => setShowChatDialog(true)) const { setChats } = useContext(ChatbotUIContext) @@ -54,16 +59,16 @@ export const DeleteChat: FC = ({ chat }) => { - Delete {chat.name} + t("side.deleteChatTitle") {chat.name} - Are you sure you want to delete this chat? + {t("side.deleteChatConfirm")} diff --git a/components/sidebar/sidebar-switcher.tsx b/components/sidebar/sidebar-switcher.tsx index 6e1caa1..454d942 100644 --- a/components/sidebar/sidebar-switcher.tsx +++ b/components/sidebar/sidebar-switcher.tsx @@ -15,6 +15,8 @@ import { WithTooltip } from "../ui/with-tooltip" import { ProfileSettings } from "../utility/profile-settings" import { SidebarSwitchItem } from "./sidebar-switch-item" +import { useTranslation } from 'react-i18next' + export const SIDEBAR_ICON_SIZE = 28 interface SidebarSwitcherProps { @@ -24,6 +26,7 @@ interface SidebarSwitcherProps { export const SidebarSwitcher: FC = ({ onContentTypeChange }) => { + const { t } = useTranslation() return (
@@ -84,7 +87,7 @@ export const SidebarSwitcher: FC = ({ {/* */} Profile Settings
} + display={
{t("side.profileSettings")}
} trigger={} /> diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 353866c..19f5481 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -147,7 +147,11 @@ "workspaceInstructionsPlaceholder": "Instructions... (optional)", "sidebarCreateNew": "New", "sidebarNoContentType": "No {{contentType}}", - "searchPlaceholder": "Search {{contentType}}..." + "searchPlaceholder": "Search {{contentType}}...", + "profileSettings": "Profile Settings", + "deleteChatTitle": "Delete", + "deleteChatConfirm": "Are you sure you want to delete this chat?", + "delete": "Delete" }, "contentType": { diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index 6f9453d..6003983 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -146,7 +146,11 @@ "workspaceInstructionsPlaceholder": "説明...(オプション)", "sidebarCreateNew": "新規作成", "sidebarNoContentType": "{{contentType}} はありません", - "searchPlaceholder": "{{contentType}} を検索..." + "searchPlaceholder": "{{contentType}} を検索...", + "profileSettings": "プロフィール設定", + "deleteChatTitle": "削除", + "deleteChatConfirm": "このチャットを削除してもよろしいですか?", + "delete": "削除" }, "contentType": { diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 8296df3..4dd36b7 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -146,7 +146,11 @@ "workspaceInstructionsPlaceholder": "说明...(可选)", "sidebarCreateNew": "新建", "sidebarNoContentType": "没有 {{contentType}}", - "searchPlaceholder": "搜索{{contentType}}..." + "searchPlaceholder": "搜索{{contentType}}...", + "profileSettings": "个人资料设置", + "deleteChatTitle": "删除", + "deleteChatConfirm": "您确定要删除此聊天记录吗?", + "delete": "删除" }, "contentType": {