This commit is contained in:
hailin 2025-04-19 00:37:14 +08:00
parent 2ac04f9d92
commit 106b240a15
4 changed files with 35 additions and 6 deletions

View File

@ -17,9 +17,14 @@ import { FC, useContext, useEffect, useState } from "react"
import { Button } from "../ui/button"
import { Input } from "../ui/input"
import { useTranslation } from 'react-i18next'
interface WorkspaceSwitcherProps {}
export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
const { t } = useTranslation()
useHotkey(";", () => setOpen(prevState => !prevState))
const {
@ -60,7 +65,7 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
selectedWorkspace.include_workspace_instructions,
instructions: selectedWorkspace.instructions,
is_home: false,
name: "New Workspace"
name: t("side.newWorkspace")
})
setWorkspaces([...workspaces, createdWorkspace])
@ -124,7 +129,7 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
</div>
)}
{getWorkspaceName(value) || "Select workspace..."}
{getWorkspaceName(value) || t("side.selectWorkspace")}
</div>
<ChevronsUpDown className="ml-2 size-4 shrink-0 opacity-50" />
@ -138,11 +143,11 @@ export const WorkspaceSwitcher: FC<WorkspaceSwitcherProps> = ({}) => {
onClick={handleCreateWorkspace}
>
<IconPlus />
<div className="ml-2">New Workspace</div>
<div className="ml-2">{t("side.newWorkspace")}</div>
</Button>
<Input
placeholder="Search workspaces..."
placeholder={t("side.searchWorkspaces")}
autoFocus
value={search}
onChange={e => setSearch(e.target.value)}

View File

@ -124,5 +124,13 @@
"groqApiKeySetByAdmin": "Groq API Key set by admin.",
"perplexityApiKeySetByAdmin": "Perplexity API Key set by admin.",
"openRouterApiKeySetByAdmin": "OpenRouter API Key set by admin."
}
},
"side": {
"selectWorkspace": "Select workspace...",
"newWorkspace": "New Workspace",
"searchWorkspaces": "Search workspaces...",
"noWorkspacesFound": "No workspaces found"
}
}

View File

@ -123,6 +123,14 @@
"groqApiKeySetByAdmin": "Groq API キーは管理者によって設定されました。",
"perplexityApiKeySetByAdmin": "Perplexity API キーは管理者によって設定されました。",
"openRouterApiKeySetByAdmin": "OpenRouter API キーは管理者によって設定されました。"
}
},
"side": {
"selectWorkspace": "ワークスペースを選択...",
"newWorkspace": "新しいワークスペース",
"searchWorkspaces": "ワークスペースを検索...",
"noWorkspacesFound": "ワークスペースが見つかりません"
}
}

View File

@ -123,5 +123,13 @@
"groqApiKeySetByAdmin": "Groq API 密钥由管理员设置。",
"perplexityApiKeySetByAdmin": "Perplexity API 密钥由管理员设置。",
"openRouterApiKeySetByAdmin": "OpenRouter API 密钥由管理员设置。"
},
"side": {
"selectWorkspace": "选择工作区...",
"newWorkspace": "新建工作区",
"searchWorkspaces": "搜索工作区...",
"noWorkspacesFound": "未找到工作区"
}
}