feat(Help): switch to the Chinese page when using Chinese (#3567)

This commit is contained in:
Zeke Zhang 2024-02-24 11:50:06 +08:00 committed by GitHub
parent 3d1f73fcaf
commit 4373e6da88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,9 @@ const SettingsMenu: React.FC<{
const data = useCurrentAppInfo(); const data = useCurrentAppInfo();
const { token } = useToken(); const { token } = useToken();
// 是否是简体中文
const isSimplifiedChinese = data?.data?.lang === 'zh-CN';
const items = [ const items = [
{ {
key: 'nocobase', key: 'nocobase',
@ -34,7 +37,7 @@ const SettingsMenu: React.FC<{
{ {
key: 'homePage', key: 'homePage',
label: ( label: (
<a href="https://www.nocobase.com" target="__blank"> <a href={isSimplifiedChinese ? 'https://cn.nocobase.com/' : 'https://www.nocobase.com'} target="__blank">
{t('Home page')} {t('Home page')}
</a> </a>
), ),
@ -42,7 +45,14 @@ const SettingsMenu: React.FC<{
{ {
key: 'userManual', key: 'userManual',
label: ( label: (
<a href="https://docs.nocobase.com/manual/quick-start/the-first-app" target="__blank"> <a
href={
isSimplifiedChinese
? 'https://docs-cn.nocobase.com/manual/quick-start/the-first-app'
: 'https://docs.nocobase.com/manual/quick-start/the-first-app'
}
target="__blank"
>
{t('User manual')} {t('User manual')}
</a> </a>
), ),