Skip to content

Commit

Permalink
feat: change default assistant name
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/renderer/src/i18n/index.ts
  • Loading branch information
kangfenmao committed Jul 21, 2024
1 parent 3f5c151 commit 75c3763
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -166,7 +166,7 @@ const resources = {
'chat.completion.paused': '会话已停止'
},
assistant: {
'default.name': '默认助手',
'default.name': '😃 默认助手 - Assistant',
'default.description': '你好,我是默认助手。你可以立刻开始跟我聊天。',
'default.topic.name': '默认话题',
'topics.title': '话题',
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const persistedReducer = persistReducer(
{
key: 'cherry-studio',
storage,
version: 12,
version: 13,
blacklist: ['runtime'],
migrate
},
Expand Down
15 changes: 15 additions & 0 deletions src/renderer/src/store/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
})

Expand Down

0 comments on commit 75c3763

Please sign in to comment.