mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-09 03:42:06 +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) {
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
"menu": {
|
||||
"home": "Главная",
|
||||
"select": "Выбрать",
|
||||
"shareQrCode": "Share QR Code",
|
||||
"shareQrCode": "Поделиться QR-кодом",
|
||||
"editInfo": "Изменить информацию",
|
||||
"editFile": "Изменить файл",
|
||||
"editRules": "Редактировать правила",
|
||||
@@ -203,7 +203,7 @@
|
||||
"title": "Консоль скрипта"
|
||||
},
|
||||
"qrViewer": {
|
||||
"title": "Subscription QR Code"
|
||||
"title": "QR-код подписки"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user