feat: change default assistant name

# Conflicts:
#	src/renderer/src/i18n/index.ts
This commit is contained in:
kangfenmao 2024-07-20 11:43:23 +08:00
parent 3f5c151a11
commit 75c37632d4
3 changed files with 18 additions and 3 deletions

View File

@ -44,7 +44,7 @@ const resources = {
'chat.completion.paused': 'Chat completion paused'
},
assistant: {
'default.name': 'Default Assistant',
'default.name': '😀 Default Assistant',
'default.description': "Hello, I'm Default Assistant. You can start chatting with me right away",
'default.topic.name': 'Default Topic',
'topics.title': 'Topics',
@ -166,7 +166,7 @@ const resources = {
'chat.completion.paused': '会话已停止'
},
assistant: {
'default.name': '默认助手',
'default.name': '😃 默认助手 - Assistant',
'default.description': '你好,我是默认助手。你可以立刻开始跟我聊天。',
'default.topic.name': '默认话题',
'topics.title': '话题',

View File

@ -19,7 +19,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 12,
version: 13,
blacklist: ['runtime'],
migrate
},

View File

@ -228,6 +228,21 @@ const migrate = createMigrate({
]
}
}
},
// @ts-ignore store type is unknown
'13': (state: RootState) => {
return {
...state,
assistants: {
...state.assistants,
defaultAssistant: {
...state.assistants.defaultAssistant,
name: ['Default Assistant', '默认助手'].includes(state.assistants.defaultAssistant.name)
? i18n.t(`assistant.default.name`)
: state.assistants.defaultAssistant.name
}
}
}
}
})