diff --git a/src/main/index.ts b/src/main/index.ts index 4bd293ab..e4958acb 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -37,11 +37,11 @@ function createWindow(): void { mainWindow.webContents.on('context-menu', () => { const menu = new Menu() - menu.append(new MenuItem({ label: 'Copy', role: 'copy' })) - menu.append(new MenuItem({ label: 'Paste', role: 'paste' })) - menu.append(new MenuItem({ label: 'Cut', role: 'cut' })) + menu.append(new MenuItem({ label: '复制', role: 'copy', sublabel: '⌘ + C' })) + menu.append(new MenuItem({ label: '粘贴', role: 'paste', sublabel: '⌘ + V' })) + menu.append(new MenuItem({ label: '剪切', role: 'cut', sublabel: '⌘ + X' })) menu.append(new MenuItem({ type: 'separator' })) - menu.append(new MenuItem({ label: 'Select All', role: 'selectAll' })) + menu.append(new MenuItem({ label: '全选', role: 'selectAll', sublabel: '⌘ + A' })) menu.popup() }) @@ -68,7 +68,7 @@ function createWindow(): void { // Some APIs can only be used after this event occurs. app.whenReady().then(() => { // Set app user model id for windows - electronApp.setAppUserModelId('com.electron') + electronApp.setAppUserModelId('com.kangfenmao.CherryStudio') // Default open or close DevTools by F12 in development // and ignore CommandOrControl + R in production. diff --git a/src/renderer/index.html b/src/renderer/index.html index 252a5183..fc1826ee 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -1,5 +1,5 @@ - + Cherry Studio diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 362229b8..d1fad168 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1,20 +1,20 @@ import '@fontsource/inter' import store, { persistor } from '@renderer/store' +import { ConfigProvider } from 'antd' import { Provider } from 'react-redux' import { HashRouter, Route, Routes } from 'react-router-dom' import { PersistGate } from 'redux-persist/integration/react' import Sidebar from './components/app/Sidebar' +import TopViewContainer from './components/TopView' +import { AntdThemeConfig, getAntdLocale } from './config/antd' +import './i18n' import AppsPage from './pages/apps/AppsPage' import HomePage from './pages/home/HomePage' import SettingsPage from './pages/settings/SettingsPage' -import { ConfigProvider } from 'antd' -import TopViewContainer from './components/TopView' -import { AntdThemeConfig } from './config/antd' -import './i18n' function App(): JSX.Element { return ( - + diff --git a/src/renderer/src/components/Popups/AssistantSettingPopup.tsx b/src/renderer/src/components/Popups/AssistantSettingPopup.tsx index abca8ab4..a3c55c17 100644 --- a/src/renderer/src/components/Popups/AssistantSettingPopup.tsx +++ b/src/renderer/src/components/Popups/AssistantSettingPopup.tsx @@ -4,6 +4,7 @@ import { TopView } from '../TopView' import { Box } from '../Layout' import { Assistant } from '@renderer/types' import TextArea from 'antd/es/input/TextArea' +import { useTranslation } from 'react-i18next' interface AssistantSettingPopupShowParams { assistant: Assistant @@ -18,6 +19,7 @@ const AssistantSettingPopupContainer: React.FC = ({ assistant, resolve }) const [description, setDescription] = useState(assistant.description) const [prompt, setPrompt] = useState(assistant.prompt) const [open, setOpen] = useState(true) + const { t } = useTranslation() const onOk = () => { setOpen(false) @@ -33,21 +35,30 @@ const AssistantSettingPopupContainer: React.FC = ({ assistant, resolve }) return ( - Name - setName(e.target.value)} /> + {t('common.name')} + setName(e.target.value)} + /> - Description + {t('common.description')}