@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
22import { Modal , Input , Slider , Button , Tooltip , Card , theme } from 'antd' ;
33import { ModelIcon } from '@lobehub/icons' ;
44import { Info , Undo2 , Bot } from 'lucide-react' ;
5+ import { useTranslation } from 'react-i18next' ;
56import { useConversationStore , useSettingsStore } from '@/stores' ;
67import { CONV_ICON_KEY , type ConvIconType , type ConvIcon } from '@/lib/convIcon' ;
78import { IconEditor } from '@/components/shared/IconEditor' ;
@@ -17,6 +18,7 @@ const CONTEXT_LIMIT_KEY = (id: string) => `aqbot_context_limit_${id}`;
1718
1819export function ConversationSettingsModal ( { open, onClose } : ConversationSettingsModalProps ) {
1920 const { token } = theme . useToken ( ) ;
21+ const { t } = useTranslation ( ) ;
2022
2123 const conversations = useConversationStore ( ( s ) => s . conversations ) ;
2224 const activeConversationId = useConversationStore ( ( s ) => s . activeConversationId ) ;
@@ -108,7 +110,7 @@ export function ConversationSettingsModal({ open, onClose }: ConversationSetting
108110 {
109111 key : 'use_model' ,
110112 icon : < Bot size = { 14 } /> ,
111- label : ' 使用模型图标',
113+ label : t ( 'settings.useModelIcon' , ' 使用模型图标') ,
112114 onClick : ( ) => { setIconType ( 'model' ) ; setIconValue ( '' ) ; } ,
113115 } ,
114116 ] ;
@@ -130,17 +132,17 @@ export function ConversationSettingsModal({ open, onClose }: ConversationSetting
130132
131133 return (
132134 < Modal
133- title = " 对话设置"
135+ title = { t ( 'settings.conversationSettings' , ' 对话设置' ) }
134136 open = { open }
135137 mask = { { enabled : true , blur : true } }
136138 onCancel = { onClose }
137139 width = { 520 }
138140 destroyOnHidden
139141 footer = {
140142 < div style = { { display : 'flex' , justifyContent : 'space-between' } } >
141- < Button onClick = { onClose } > 取消 </ Button >
143+ < Button onClick = { onClose } > { t ( 'common.cancel' , '取消' ) } </ Button >
142144 < Button type = "primary" onClick = { handleSave } loading = { saving } >
143- 保存
145+ { t ( 'common.save' , '保存' ) }
144146 </ Button >
145147 </ div >
146148 }
@@ -169,24 +171,24 @@ export function ConversationSettingsModal({ open, onClose }: ConversationSetting
169171
170172 { /* Name */ }
171173 < div style = { { marginBottom : 16 } } >
172- < div style = { labelStyle } > 名称 </ div >
174+ < div style = { labelStyle } > { t ( 'common.name' , '名称' ) } </ div >
173175 < Input value = { title } onChange = { ( e ) => setTitle ( e . target . value ) } />
174176 </ div >
175177
176178 { /* System Prompt */ }
177179 < div style = { { marginBottom : 16 } } >
178- < div style = { labelStyle } > 系统提示(角色设定)</ div >
180+ < div style = { labelStyle } > { t ( 'settings.systemPromptLabel' , ' 系统提示(角色设定)' ) } </ div >
179181 < Input . TextArea
180182 value = { systemPrompt }
181183 onChange = { ( e ) => setSystemPrompt ( e . target . value ) }
182184 rows = { 3 }
183- placeholder = " 输入系统提示词..."
185+ placeholder = { t ( 'settings.systemPromptPlaceholder' , ' 输入系统提示词...' ) }
184186 />
185187 </ div >
186188
187189 { /* Model Settings Card */ }
188190 < Card
189- title = " 模型设置"
191+ title = { t ( 'settings.modelSettings' , ' 模型设置' ) }
190192 size = "small"
191193 extra = {
192194 < Button
@@ -195,20 +197,20 @@ export function ConversationSettingsModal({ open, onClose }: ConversationSetting
195197 icon = { < Undo2 size = { 14 } /> }
196198 onClick = { handleReset }
197199 >
198- 重置
200+ { t ( 'common.reset' , '重置' ) }
199201 </ Button >
200202 }
201203 >
202204
203205 { /* Context Message Limit */ }
204206 < div style = { { marginBottom : 20 } } >
205207 < div style = { labelStyle } >
206- 上下文的消息数量上限
207- < Tooltip title = " 限制发送给模型的历史消息数量。设为 50 表示不限制。" >
208+ { t ( 'settings.contextMessageLimit' , ' 上下文的消息数量上限' ) }
209+ < Tooltip title = { t ( 'settings.contextMessageLimitTooltip' , ' 限制发送给模型的历史消息数量。设为 50 表示不限制。' ) } >
208210 < Info size = { 14 } style = { { color : token . colorTextSecondary , cursor : 'help' } } />
209211 </ Tooltip >
210212 < span style = { { marginLeft : 'auto' , color : token . colorTextSecondary , fontSize : 12 } } >
211- { contextLimit >= 50 ? ' 不限制' : contextLimit }
213+ { contextLimit >= 50 ? t ( 'common.unlimited' , ' 不限制') : contextLimit }
212214 </ span >
213215 </ div >
214216 < div style = { sliderRowStyle } >
0 commit comments