mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
feat: add changes log
This commit is contained in:
parent
e90ef9d05f
commit
74aa95339c
@ -2,3 +2,4 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
out
|
out
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
||||||
|
|||||||
@ -4,3 +4,4 @@ pnpm-lock.yaml
|
|||||||
LICENSE.md
|
LICENSE.md
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
tsconfig.*.json
|
tsconfig.*.json
|
||||||
|
CHANGELOG*.md
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import { PersistGate } from 'redux-persist/integration/react'
|
|||||||
import Sidebar from './components/app/Sidebar'
|
import Sidebar from './components/app/Sidebar'
|
||||||
import TopViewContainer from './components/TopView'
|
import TopViewContainer from './components/TopView'
|
||||||
import { AntdThemeConfig, getAntdLocale } from './config/antd'
|
import { AntdThemeConfig, getAntdLocale } from './config/antd'
|
||||||
import './i18n'
|
|
||||||
import AppsPage from './pages/apps/AppsPage'
|
import AppsPage from './pages/apps/AppsPage'
|
||||||
import HomePage from './pages/home/HomePage'
|
import HomePage from './pages/home/HomePage'
|
||||||
import SettingsPage from './pages/settings/SettingsPage'
|
import SettingsPage from './pages/settings/SettingsPage'
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## 0.2.1 (2024-07-15)
|
|
||||||
|
|
||||||
1.【功能】新增消息暂停发送功能
|
|
||||||
2.【修复】修复多语言切换不彻底问题
|
|
||||||
3.【构建】支持 macOS Intel 架构
|
|
||||||
7
src/renderer/src/assets/changelog/CHANGELOG.en.md
Normal file
7
src/renderer/src/assets/changelog/CHANGELOG.en.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# CHANGES LOG
|
||||||
|
|
||||||
|
### v0.2.1 - 2024-07-15
|
||||||
|
|
||||||
|
1. **Feature**: Add new feature for pausing message sending
|
||||||
|
2. **Fix**: Resolve incomplete translation issue upon language switch
|
||||||
|
3. **Build**: Support for macOS Intel architecture
|
||||||
8
src/renderer/src/assets/changelog/CHANGELOG.zh.md
Normal file
8
src/renderer/src/assets/changelog/CHANGELOG.zh.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# 更新日志
|
||||||
|
|
||||||
|
### v0.2.1 - 2024-07-15
|
||||||
|
|
||||||
|
1. 【功能】新增消息暂停发送功能
|
||||||
|
2. 【修复】修复多语言切换不彻底问题
|
||||||
|
3. 【构建】支持 macOS Intel 架构
|
||||||
|
|
||||||
73
src/renderer/src/assets/styles/changelog.module.scss
Normal file
73
src/renderer/src/assets/styles/changelog.module.scss
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
$background-color: #121212;
|
||||||
|
$text-color: #ffffff;
|
||||||
|
$heading-color: #bb86fc;
|
||||||
|
$link-color: #3498db;
|
||||||
|
$code-background: #1e1e1e;
|
||||||
|
$code-color: #f0e7db;
|
||||||
|
|
||||||
|
.markdown {
|
||||||
|
body {
|
||||||
|
background-color: $background-color;
|
||||||
|
color: $text-color;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
color: $heading-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin: 10px 0;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $link-color;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: $code-background;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
background-color: $code-background;
|
||||||
|
color: $code-color;
|
||||||
|
padding: 2px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-left: 4px solid $heading-color;
|
||||||
|
padding-left: 10px;
|
||||||
|
margin-left: 0;
|
||||||
|
color: #b3b3b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
padding-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
import { i18nInit } from '@renderer/i18n'
|
||||||
import LocalStorage from '@renderer/services/storage'
|
import LocalStorage from '@renderer/services/storage'
|
||||||
import { useAppDispatch } from '@renderer/store'
|
import { useAppDispatch } from '@renderer/store'
|
||||||
import { setAvatar } from '@renderer/store/runtime'
|
import { setAvatar } from '@renderer/store/runtime'
|
||||||
@ -12,5 +13,6 @@ export function useAppInitEffect() {
|
|||||||
const storedImage = await LocalStorage.getImage('avatar')
|
const storedImage = await LocalStorage.getImage('avatar')
|
||||||
storedImage && dispatch(setAvatar(storedImage))
|
storedImage && dispatch(setAvatar(storedImage))
|
||||||
})
|
})
|
||||||
|
i18nInit()
|
||||||
}, [dispatch])
|
}, [dispatch])
|
||||||
}
|
}
|
||||||
|
|||||||
@ -225,11 +225,15 @@ const resources = {
|
|||||||
|
|
||||||
i18n.use(initReactI18next).init({
|
i18n.use(initReactI18next).init({
|
||||||
resources,
|
resources,
|
||||||
lng: store.getState().settings.language || 'en-US',
|
lng: localStorage.getItem('language') || 'en-US',
|
||||||
fallbackLng: 'en-US',
|
fallbackLng: 'en-US',
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false
|
escapeValue: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export function i18nInit() {
|
||||||
|
i18n.changeLanguage(store.getState().settings.language || 'en-US')
|
||||||
|
}
|
||||||
|
|
||||||
export default i18n
|
export default i18n
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client'
|
|||||||
import App from './App'
|
import App from './App'
|
||||||
import './assets/styles/index.scss'
|
import './assets/styles/index.scss'
|
||||||
import './init'
|
import './init'
|
||||||
|
import './i18n'
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
|
|||||||
@ -4,8 +4,7 @@ import styled from 'styled-components'
|
|||||||
import Logo from '@renderer/assets/images/logo.png'
|
import Logo from '@renderer/assets/images/logo.png'
|
||||||
import { runAsyncFunction } from '@renderer/utils'
|
import { runAsyncFunction } from '@renderer/utils'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Markdown from 'react-markdown'
|
import Changelog from './components/Changelog'
|
||||||
import changelogs from '@renderer/CHANGELOG.md?raw'
|
|
||||||
|
|
||||||
const AboutSettings: FC = () => {
|
const AboutSettings: FC = () => {
|
||||||
const [version, setVersion] = useState('')
|
const [version, setVersion] = useState('')
|
||||||
@ -25,9 +24,7 @@ const AboutSettings: FC = () => {
|
|||||||
Cherry Studio <Version>(v{version})</Version>
|
Cherry Studio <Version>(v{version})</Version>
|
||||||
</Title>
|
</Title>
|
||||||
<Description>{t('settings.about.description')}</Description>
|
<Description>{t('settings.about.description')}</Description>
|
||||||
<ChangeLog>
|
<Changelog />
|
||||||
<Markdown className="markdown">{changelogs}</Markdown>
|
|
||||||
</ChangeLog>
|
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -60,14 +57,4 @@ const Description = styled.div`
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
`
|
`
|
||||||
|
|
||||||
const ChangeLog = styled.div`
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--color-text-2);
|
|
||||||
background-color: var(--color-background-soft);
|
|
||||||
margin-top: 40px;
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 5px;
|
|
||||||
width: 800px;
|
|
||||||
`
|
|
||||||
|
|
||||||
export default AboutSettings
|
export default AboutSettings
|
||||||
|
|||||||
@ -21,7 +21,7 @@ const GeneralSettings: FC = () => {
|
|||||||
const onSelectLanguage = (value: string) => {
|
const onSelectLanguage = (value: string) => {
|
||||||
dispatch(setLanguage(value))
|
dispatch(setLanguage(value))
|
||||||
i18next.changeLanguage(value)
|
i18next.changeLanguage(value)
|
||||||
setTimeout(() => window.location.reload(), 500)
|
localStorage.setItem('language', value)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
29
src/renderer/src/pages/settings/components/Changelog.tsx
Normal file
29
src/renderer/src/pages/settings/components/Changelog.tsx
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import changelogEn from '@renderer/assets/changelog/CHANGELOG.en.md?raw'
|
||||||
|
import changelogZh from '@renderer/assets/changelog/CHANGELOG.zh.md?raw'
|
||||||
|
import i18next from 'i18next'
|
||||||
|
import { FC } from 'react'
|
||||||
|
import Markdown from 'react-markdown'
|
||||||
|
import styled from 'styled-components'
|
||||||
|
import styles from '@renderer/assets/styles/changelog.module.scss'
|
||||||
|
|
||||||
|
const Changelog: FC = () => {
|
||||||
|
const language = i18next.language
|
||||||
|
const changelog = language === 'zh-CN' ? changelogZh : changelogEn
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container>
|
||||||
|
<Markdown className={styles.markdown}>{changelog}</Markdown>
|
||||||
|
</Container>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const Container = styled.div`
|
||||||
|
font-size: 14px;
|
||||||
|
background-color: var(--color-background-soft);
|
||||||
|
margin-top: 40px;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
width: 650px;
|
||||||
|
`
|
||||||
|
|
||||||
|
export default Changelog
|
||||||
Loading…
Reference in New Issue
Block a user