feat(i18n): update assistant settings titles and add new translations for multiple languages
This commit is contained in:
parent
fb9c23c500
commit
1a85b8bd5d
@ -32,7 +32,9 @@
|
|||||||
"title": "Agents"
|
"title": "Agents"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
|
"title": "Assistants",
|
||||||
"abbr": "Assistant",
|
"abbr": "Assistant",
|
||||||
|
"settings.title": "Assistant Settings",
|
||||||
"clear.content": "Clearing the topic will delete all topics and files in the assistant. Are you sure you want to continue?",
|
"clear.content": "Clearing the topic will delete all topics and files in the assistant. Are you sure you want to continue?",
|
||||||
"clear.title": "Clear topics",
|
"clear.title": "Clear topics",
|
||||||
"copy.title": "Copy Assistant",
|
"copy.title": "Copy Assistant",
|
||||||
@ -53,7 +55,7 @@
|
|||||||
"settings.reasoning_effort.medium": "medium",
|
"settings.reasoning_effort.medium": "medium",
|
||||||
"settings.reasoning_effort.off": "off",
|
"settings.reasoning_effort.off": "off",
|
||||||
"settings.reasoning_effort.tip": "Only supports OpenAI o-series and Anthropic reasoning models",
|
"settings.reasoning_effort.tip": "Only supports OpenAI o-series and Anthropic reasoning models",
|
||||||
"title": "Assistants"
|
"settings.more": "Assistant Settings"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"error": "API key automatically obtained failed, please get it manually",
|
"error": "API key automatically obtained failed, please get it manually",
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
"title": "エージェント"
|
"title": "エージェント"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
|
"title": "アシスタント",
|
||||||
"abbr": "アシスタント",
|
"abbr": "アシスタント",
|
||||||
|
"settings.title": "アシスタント設定",
|
||||||
"clear.content": "トピックをクリアすると、アシスタント内のすべてのトピックとファイルが削除されます。続行しますか?",
|
"clear.content": "トピックをクリアすると、アシスタント内のすべてのトピックとファイルが削除されます。続行しますか?",
|
||||||
"clear.title": "トピックをクリア",
|
"clear.title": "トピックをクリア",
|
||||||
"copy.title": "アシスタントをコピー",
|
"copy.title": "アシスタントをコピー",
|
||||||
@ -53,7 +55,7 @@
|
|||||||
"settings.reasoning_effort.medium": "中程度",
|
"settings.reasoning_effort.medium": "中程度",
|
||||||
"settings.reasoning_effort.off": "オフ",
|
"settings.reasoning_effort.off": "オフ",
|
||||||
"settings.reasoning_effort.tip": "OpenAIのoシリーズとAnthropicの推論モデルのみサポートしています",
|
"settings.reasoning_effort.tip": "OpenAIのoシリーズとAnthropicの推論モデルのみサポートしています",
|
||||||
"title": "アシスタント"
|
"settings.more": "アシスタント設定"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"error": "APIキーの自動取得に失敗しました。手動で取得してください",
|
"error": "APIキーの自動取得に失敗しました。手動で取得してください",
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
"title": "Агенты"
|
"title": "Агенты"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
|
"title": "Ассистенты",
|
||||||
"abbr": "Ассистент",
|
"abbr": "Ассистент",
|
||||||
|
"settings.title": "Настройки ассистента",
|
||||||
"clear.content": "Очистка топика удалит все топики и файлы в ассистенте. Вы уверены, что хотите продолжить?",
|
"clear.content": "Очистка топика удалит все топики и файлы в ассистенте. Вы уверены, что хотите продолжить?",
|
||||||
"clear.title": "Очистить топики",
|
"clear.title": "Очистить топики",
|
||||||
"copy.title": "Копировать ассистента",
|
"copy.title": "Копировать ассистента",
|
||||||
@ -53,7 +55,7 @@
|
|||||||
"settings.reasoning_effort.medium": "Средняя",
|
"settings.reasoning_effort.medium": "Средняя",
|
||||||
"settings.reasoning_effort.off": "Выключено",
|
"settings.reasoning_effort.off": "Выключено",
|
||||||
"settings.reasoning_effort.tip": "Поддерживается только моделями с рассуждением OpenAI o-series и Anthropic",
|
"settings.reasoning_effort.tip": "Поддерживается только моделями с рассуждением OpenAI o-series и Anthropic",
|
||||||
"title": "Ассистенты"
|
"settings.more": "Настройки ассистента"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"error": "Автоматический получение ключа API не удалось, пожалуйста, получите ключ вручную",
|
"error": "Автоматический получение ключа API не удалось, пожалуйста, получите ключ вручную",
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
"title": "智能体"
|
"title": "智能体"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
|
"title": "助手",
|
||||||
"abbr": "助手",
|
"abbr": "助手",
|
||||||
|
"settings.title": "助手设置",
|
||||||
"clear.content": "清空话题会删除助手下所有话题和文件,确定要继续吗?",
|
"clear.content": "清空话题会删除助手下所有话题和文件,确定要继续吗?",
|
||||||
"clear.title": "清空话题",
|
"clear.title": "清空话题",
|
||||||
"copy.title": "复制助手",
|
"copy.title": "复制助手",
|
||||||
@ -53,7 +55,7 @@
|
|||||||
"settings.reasoning_effort.medium": "中",
|
"settings.reasoning_effort.medium": "中",
|
||||||
"settings.reasoning_effort.off": "关",
|
"settings.reasoning_effort.off": "关",
|
||||||
"settings.reasoning_effort.tip": "仅支持 OpenAI o-series 和 Anthropic 推理模型",
|
"settings.reasoning_effort.tip": "仅支持 OpenAI o-series 和 Anthropic 推理模型",
|
||||||
"title": "助手"
|
"settings.more": "助手设置"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"error": "自动获取密钥失败,请手动获取",
|
"error": "自动获取密钥失败,请手动获取",
|
||||||
|
|||||||
@ -32,7 +32,9 @@
|
|||||||
"title": "智慧代理人"
|
"title": "智慧代理人"
|
||||||
},
|
},
|
||||||
"assistants": {
|
"assistants": {
|
||||||
|
"title": "助手",
|
||||||
"abbr": "助手",
|
"abbr": "助手",
|
||||||
|
"settings.title": "助手設定",
|
||||||
"clear.content": "清空話題會刪除助手下所有主題和檔案,確定要繼續嗎?",
|
"clear.content": "清空話題會刪除助手下所有主題和檔案,確定要繼續嗎?",
|
||||||
"clear.title": "清空話題",
|
"clear.title": "清空話題",
|
||||||
"copy.title": "複製助手",
|
"copy.title": "複製助手",
|
||||||
@ -52,8 +54,8 @@
|
|||||||
"settings.reasoning_effort.low": "短",
|
"settings.reasoning_effort.low": "短",
|
||||||
"settings.reasoning_effort.medium": "中",
|
"settings.reasoning_effort.medium": "中",
|
||||||
"settings.reasoning_effort.off": "關",
|
"settings.reasoning_effort.off": "關",
|
||||||
"settings.reasoning_effort.tip": "僅支援 OpenAI o 系列和 Anthropic 推理模型",
|
"settings.reasoning_effort.tip": "僅支援 OpenAI o-series 和 Anthropic 推理模型",
|
||||||
"title": "助手"
|
"settings.more": "助手設定"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"error": "自動取得金鑰失敗,請手動取得",
|
"error": "自動取得金鑰失敗,請手動取得",
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { CheckOutlined, QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons'
|
import { CheckOutlined, QuestionCircleOutlined, ReloadOutlined, SettingOutlined } from '@ant-design/icons'
|
||||||
import { HStack } from '@renderer/components/Layout'
|
import { HStack } from '@renderer/components/Layout'
|
||||||
import Scrollbar from '@renderer/components/Scrollbar'
|
import Scrollbar from '@renderer/components/Scrollbar'
|
||||||
import {
|
import {
|
||||||
@ -13,6 +13,7 @@ import { codeThemes } from '@renderer/context/SyntaxHighlighterProvider'
|
|||||||
import { useAssistant } from '@renderer/hooks/useAssistant'
|
import { useAssistant } from '@renderer/hooks/useAssistant'
|
||||||
import { useSettings } from '@renderer/hooks/useSettings'
|
import { useSettings } from '@renderer/hooks/useSettings'
|
||||||
import { SettingDivider, SettingRow, SettingRowTitle, SettingSubtitle } from '@renderer/pages/settings'
|
import { SettingDivider, SettingRow, SettingRowTitle, SettingSubtitle } from '@renderer/pages/settings'
|
||||||
|
import AssistantSettingsPopup from '@renderer/pages/settings/AssistantSettings'
|
||||||
import { getDefaultModel } from '@renderer/services/AssistantService'
|
import { getDefaultModel } from '@renderer/services/AssistantService'
|
||||||
import { useAppDispatch } from '@renderer/store'
|
import { useAppDispatch } from '@renderer/store'
|
||||||
import {
|
import {
|
||||||
@ -37,7 +38,7 @@ import {
|
|||||||
} from '@renderer/store/settings'
|
} from '@renderer/store/settings'
|
||||||
import { Assistant, AssistantSettings, CodeStyleVarious, ThemeMode, TranslateLanguageVarious } from '@renderer/types'
|
import { Assistant, AssistantSettings, CodeStyleVarious, ThemeMode, TranslateLanguageVarious } from '@renderer/types'
|
||||||
import { modalConfirm } from '@renderer/utils'
|
import { modalConfirm } from '@renderer/utils'
|
||||||
import { Col, InputNumber, Row, Segmented, Select, Slider, Switch, Tooltip } from 'antd'
|
import { Button, Col, InputNumber, Row, Segmented, Select, Slider, Switch, Tooltip } from 'antd'
|
||||||
import { FC, useEffect, useState } from 'react'
|
import { FC, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
@ -145,11 +146,19 @@ const SettingsTab: FC<Props> = (props) => {
|
|||||||
return (
|
return (
|
||||||
<Container className="settings-tab">
|
<Container className="settings-tab">
|
||||||
<SettingGroup style={{ marginTop: 10 }}>
|
<SettingGroup style={{ marginTop: 10 }}>
|
||||||
<SettingSubtitle style={{ marginTop: 0 }}>
|
<SettingSubtitle style={{ marginTop: 0, display: 'flex', justifyContent: 'space-between' }}>
|
||||||
{t('settings.messages.model.title')}{' '}
|
<HStack alignItems="center">
|
||||||
|
{t('assistants.settings.title')}{' '}
|
||||||
<Tooltip title={t('chat.settings.reset')}>
|
<Tooltip title={t('chat.settings.reset')}>
|
||||||
<ReloadOutlined onClick={onReset} style={{ cursor: 'pointer', fontSize: 12, padding: '0 3px' }} />
|
<ReloadOutlined onClick={onReset} style={{ cursor: 'pointer', fontSize: 12, padding: '0 3px' }} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
</HStack>
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
icon={<SettingOutlined />}
|
||||||
|
onClick={() => AssistantSettingsPopup.show({ assistant, tab: 'model' })}
|
||||||
|
/>
|
||||||
</SettingSubtitle>
|
</SettingSubtitle>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<Row align="middle">
|
<Row align="middle">
|
||||||
|
|||||||
@ -16,16 +16,19 @@ import AssistantPromptSettings from './AssistantPromptSettings'
|
|||||||
|
|
||||||
interface AssistantSettingPopupShowParams {
|
interface AssistantSettingPopupShowParams {
|
||||||
assistant: Assistant
|
assistant: Assistant
|
||||||
|
tab?: AssistantSettingPopupTab
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AssistantSettingPopupTab = 'prompt' | 'model' | 'messages' | 'knowledge_base'
|
||||||
|
|
||||||
interface Props extends AssistantSettingPopupShowParams {
|
interface Props extends AssistantSettingPopupShowParams {
|
||||||
resolve: (assistant: Assistant) => void
|
resolve: (assistant: Assistant) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
const AssistantSettingPopupContainer: React.FC<Props> = ({ resolve, ...props }) => {
|
const AssistantSettingPopupContainer: React.FC<Props> = ({ resolve, tab, ...props }) => {
|
||||||
const [open, setOpen] = useState(true)
|
const [open, setOpen] = useState(true)
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [menu, setMenu] = useState('prompt')
|
const [menu, setMenu] = useState<AssistantSettingPopupTab>(tab || 'prompt')
|
||||||
|
|
||||||
const _useAssistant = useAssistant(props.assistant.id)
|
const _useAssistant = useAssistant(props.assistant.id)
|
||||||
const _useAgent = useAgent(props.assistant.id)
|
const _useAgent = useAgent(props.assistant.id)
|
||||||
@ -94,10 +97,10 @@ const AssistantSettingPopupContainer: React.FC<Props> = ({ resolve, ...props })
|
|||||||
<LeftMenu>
|
<LeftMenu>
|
||||||
<Menu
|
<Menu
|
||||||
style={{ width: 220, padding: 5, background: 'transparent' }}
|
style={{ width: 220, padding: 5, background: 'transparent' }}
|
||||||
defaultSelectedKeys={['prompt']}
|
defaultSelectedKeys={[tab || 'prompt']}
|
||||||
mode="vertical"
|
mode="vertical"
|
||||||
items={items}
|
items={items}
|
||||||
onSelect={({ key }) => setMenu(key as string)}
|
onSelect={({ key }) => setMenu(key as AssistantSettingPopupTab)}
|
||||||
/>
|
/>
|
||||||
</LeftMenu>
|
</LeftMenu>
|
||||||
<Settings>
|
<Settings>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user