feat(i18n): add unnamed translation and use in session creation

Add "unnamed" translation in both zh-cn and en-us locales
Use the translation as default name when creating new sessions
This commit is contained in:
icarus 2025-09-27 18:28:08 +08:00
parent 9ec6e5f771
commit e737f71932
3 changed files with 5 additions and 2 deletions

View File

@ -1035,6 +1035,7 @@
"success": "Success",
"swap": "Swap",
"topics": "Topics",
"unnamed": "Unnamed",
"update_success": "Update successfully",
"upload_files": "Upload file",
"warning": "Warning",

View File

@ -1035,6 +1035,7 @@
"success": "成功",
"swap": "交换",
"topics": "话题",
"unnamed": "未命名",
"update_success": "更新成功",
"upload_files": "上传文件",
"warning": "警告",

View File

@ -45,13 +45,14 @@ const Sessions: React.FC<SessionsProps> = ({ agentId }) => {
if (!agent) return
const session = {
...agent,
id: undefined
id: undefined,
name: t('common.unnamed')
} satisfies CreateSessionForm
const created = await createSession(session)
if (created) {
dispatch(setActiveSessionIdAction({ agentId, sessionId: created.id }))
}
}, [agent, agentId, createSession, dispatch])
}, [agent, agentId, createSession, dispatch, t])
const handleDeleteSession = useCallback(
async (id: string) => {