From d53a4e5507c582c215b24cfa7443d68a54540474 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 19 Apr 2025 11:03:51 +0800 Subject: [PATCH] . --- components/sidebar/sidebar-create-buttons.tsx | 5 +---- public/locales/en/translation.json | 11 +++++++++++ public/locales/ja/translation.json | 11 +++++++++++ public/locales/zh/translation.json | 11 +++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/components/sidebar/sidebar-create-buttons.tsx b/components/sidebar/sidebar-create-buttons.tsx index b2f361d..b164cd3 100644 --- a/components/sidebar/sidebar-create-buttons.tsx +++ b/components/sidebar/sidebar-create-buttons.tsx @@ -100,9 +100,6 @@ export const SidebarCreateButtons: FC = ({ } } - // 获取当前语言 - const language = i18n.language; - // 判断需要大写首字母的语言 const needsUpperCaseFirstLetter = (language: string) => { const languagesRequiringUpperCase = ['en', 'de', 'fr', 'es', 'it']; // 其他需要大写首字母的语言 @@ -123,7 +120,7 @@ export const SidebarCreateButtons: FC = ({ {t('side.sidebarCreateNew')}{" "} - {getCapitalizedContentType(contentType, language)} + {getCapitalizedContentType(t(`contentType.${contentType}`), i18n.language)} diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 285e6b1..b3cf8b5 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -146,6 +146,17 @@ "workspaceBeginSettings": "These are the settings your workspace begins with when selected.", "workspaceInstructionsPlaceholder": "Instructions... (optional)", "sidebarCreateNew": "New" + }, + + "contentType": { + "chats": "chats", + "presets": "presets", + "prompts": "prompts", + "files": "files", + "collections": "collections", + "assistants": "assistants", + "tools": "tools", + "models": "models" } } diff --git a/public/locales/ja/translation.json b/public/locales/ja/translation.json index f3c760e..7e2f8f9 100644 --- a/public/locales/ja/translation.json +++ b/public/locales/ja/translation.json @@ -145,6 +145,17 @@ "workspaceBeginSettings": "これらはワークスペースを選択したときに始まる設定です。", "workspaceInstructionsPlaceholder": "説明...(オプション)", "sidebarCreateNew": "新規作成" + }, + + "contentType": { + "chats": "チャット", + "presets": "プリセット", + "prompts": "プロンプト", + "files": "ファイル", + "collections": "コレクション", + "assistants": "アシスタント", + "tools": "ツール", + "models": "モデル" } } diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 6e790a9..6e554c0 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -145,6 +145,17 @@ "workspaceBeginSettings": "这些是选择此工作区时的初始设置。", "workspaceInstructionsPlaceholder": "说明...(可选)", "sidebarCreateNew": "新建" + }, + + "contentType": { + "chats": "聊天", + "presets": "预设", + "prompts": "提示词", + "files": "文件", + "collections": "集合", + "assistants": "助手", + "tools": "工具", + "models": "模型" } }