mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-04 06:02:08 +08:00
Improve Russian localization (#7138)
This commit is contained in:
@@ -59,6 +59,8 @@ const GITHUB_ALERT_PATTERN =
|
||||
const GITHUB_ALERT_CLASS_PATTERN =
|
||||
/markdown-alert-(note|tip|important|warning|caution)/
|
||||
|
||||
const shouldShowReleaseNotes = (language: string) => language === 'zh'
|
||||
|
||||
const LazyReactMarkdown = lazy(async () => {
|
||||
const [{ default: ReactMarkdown }, { default: rehypeRaw }] =
|
||||
await Promise.all([import('react-markdown'), import('rehype-raw')])
|
||||
@@ -136,7 +138,7 @@ const remarkGitHubAlerts = (labels: Record<GitHubAlertType, string>) => {
|
||||
}
|
||||
|
||||
export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
const [open, setOpen] = useState(false)
|
||||
const updateState = useUpdateState()
|
||||
@@ -174,12 +176,16 @@ export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
[githubAlertLabels],
|
||||
)
|
||||
|
||||
const activeLanguage = i18n.resolvedLanguage ?? i18n.language
|
||||
const markdownContent = useMemo(() => {
|
||||
if (!updateInfo?.body) {
|
||||
return t('settings.modals.update.messages.available')
|
||||
}
|
||||
if (!shouldShowReleaseNotes(activeLanguage)) {
|
||||
return t('settings.modals.update.messages.available')
|
||||
}
|
||||
return updateInfo?.body
|
||||
}, [t, updateInfo])
|
||||
}, [activeLanguage, t, updateInfo])
|
||||
|
||||
const breakChangeFlag = useMemo(() => {
|
||||
if (!updateInfo?.body) {
|
||||
|
||||
Reference in New Issue
Block a user