This commit is contained in:
parent
d53a4e5507
commit
8e9887bec6
|
|
@ -22,6 +22,8 @@ import { PresetItem } from "./items/presets/preset-item"
|
|||
import { PromptItem } from "./items/prompts/prompt-item"
|
||||
import { ToolItem } from "./items/tools/tool-item"
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface SidebarDataListProps {
|
||||
contentType: ContentType
|
||||
data: DataListType
|
||||
|
|
@ -33,6 +35,9 @@ export const SidebarDataList: FC<SidebarDataListProps> = ({
|
|||
data,
|
||||
folders
|
||||
}) => {
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const {
|
||||
setChats,
|
||||
setPresets,
|
||||
|
|
@ -217,6 +222,12 @@ export const SidebarDataList: FC<SidebarDataListProps> = ({
|
|||
const dataWithFolders = data.filter(item => item.folder_id)
|
||||
const dataWithoutFolders = data.filter(item => item.folder_id === null)
|
||||
|
||||
// 获取 "No {contentType}" 的国际化文本
|
||||
const getNoContentTypeText = (contentType: string) => {
|
||||
const translatedContentType = t(`contentType.${contentType}`);
|
||||
return t('side.sidebarNoContentType', { contentType: translatedContentType }) + ".";
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
@ -227,7 +238,7 @@ export const SidebarDataList: FC<SidebarDataListProps> = ({
|
|||
{data.length === 0 && (
|
||||
<div className="flex grow flex-col items-center justify-center">
|
||||
<div className=" text-centertext-muted-foreground p-8 text-lg italic">
|
||||
No {contentType}.
|
||||
{getNoContentTypeText(contentType)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,8 @@
|
|||
"workspaceNamePlaceholder": "Name...",
|
||||
"workspaceBeginSettings": "These are the settings your workspace begins with when selected.",
|
||||
"workspaceInstructionsPlaceholder": "Instructions... (optional)",
|
||||
"sidebarCreateNew": "New"
|
||||
"sidebarCreateNew": "New",
|
||||
"sidebarNoContentType": "No {{contentType}}"
|
||||
},
|
||||
|
||||
"contentType": {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@
|
|||
"workspaceNamePlaceholder": "名前を入力...",
|
||||
"workspaceBeginSettings": "これらはワークスペースを選択したときに始まる設定です。",
|
||||
"workspaceInstructionsPlaceholder": "説明...(オプション)",
|
||||
"sidebarCreateNew": "新規作成"
|
||||
"sidebarCreateNew": "新規作成",
|
||||
"sidebarNoContentType": "{{contentType}} はありません"
|
||||
},
|
||||
|
||||
"contentType": {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@
|
|||
"workspaceNamePlaceholder": "请输入名称...",
|
||||
"workspaceBeginSettings": "这些是选择此工作区时的初始设置。",
|
||||
"workspaceInstructionsPlaceholder": "说明...(可选)",
|
||||
"sidebarCreateNew": "新建"
|
||||
"sidebarCreateNew": "新建",
|
||||
"sidebarNoContentType": "没有 {{contentType}}"
|
||||
},
|
||||
|
||||
"contentType": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue