中英文切换
This commit is contained in:
@@ -5,16 +5,14 @@ import { useTranslation } from 'react-i18next';
|
||||
import type { MenuProps } from 'antd';
|
||||
|
||||
export default function LanguageSwitcher() {
|
||||
const { i18n } = useTranslation();
|
||||
const { i18n ,t} = useTranslation();
|
||||
const currentLng = i18n.language?.startsWith('en') ? 'en' : 'zh';
|
||||
|
||||
const items: MenuProps['items'] = [
|
||||
{
|
||||
key: 'zh',
|
||||
label: (
|
||||
<span style={{ fontWeight: currentLng === 'zh' ? 600 : 400 }}>
|
||||
中文
|
||||
</span>
|
||||
<span style={{ fontWeight: currentLng === 'zh' ? 600 : 400 }}>{t('systemSetting.chinese')}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user