Commit cf2254fd authored by Rayron Victor's avatar Rayron Victor Committed by 偏右

SelectLang: languages options don't need to be translated

parent eece603c
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { formatMessage, FormattedMessage, setLocale, getLocale } from 'umi/locale'; import { formatMessage, setLocale, getLocale } from 'umi/locale';
import { Menu, Icon, Dropdown } from 'antd'; import { Menu, Icon, Dropdown } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
...@@ -15,16 +15,28 @@ export default class SelectLang extends PureComponent { ...@@ -15,16 +15,28 @@ export default class SelectLang extends PureComponent {
const langMenu = ( const langMenu = (
<Menu className={styles.menu} selectedKeys={[selectedLang]} onClick={this.changLang}> <Menu className={styles.menu} selectedKeys={[selectedLang]} onClick={this.changLang}>
<Menu.Item key="zh-CN"> <Menu.Item key="zh-CN">
<FormattedMessage id="lang.simplified-chinese" /> <span role="img" aria-label="简体中文">
🇨🇳
</span>{' '}
简体中文
</Menu.Item> </Menu.Item>
<Menu.Item key="zh-TW"> <Menu.Item key="zh-TW">
<FormattedMessage id="lang.traditional-chinese" /> <span role="img" aria-label="繁体中文">
🇭🇰
</span>{' '}
繁体中文
</Menu.Item> </Menu.Item>
<Menu.Item key="en-US"> <Menu.Item key="en-US">
<FormattedMessage id="lang.english" /> <span role="img" aria-label="English">
🇬🇧
</span>{' '}
English
</Menu.Item> </Menu.Item>
<Menu.Item key="pt-BR"> <Menu.Item key="pt-BR">
<FormattedMessage id="lang.portuguese" /> <span role="img" aria-label="Português">
🇵🇹
</span>{' '}
Português
</Menu.Item> </Menu.Item>
</Menu> </Menu>
); );
......
export default { export default {
'navBar.lang': 'Languages', 'navBar.lang': 'Languages',
'lang.simplified-chinese': '🇨🇳 简体中文',
'lang.traditional-chinese': '🇭🇰 繁体中文',
'lang.english': '🇬🇧 English',
'lang.portuguese': '🇵🇹 Portuguese',
'layout.user.link.help': 'Help', 'layout.user.link.help': 'Help',
'layout.user.link.privacy': 'Privacy', 'layout.user.link.privacy': 'Privacy',
'layout.user.link.terms': 'Terms', 'layout.user.link.terms': 'Terms',
......
export default { export default {
'navBar.lang': 'Idiomas', 'navBar.lang': 'Idiomas',
'lang.simplified-chinese': '🇨🇳 简体中文',
'lang.traditional-chinese': '🇭🇰 繁体中文',
'lang.english': '🇬🇧 English',
'lang.portuguese': '🇵🇹 Portuguese',
'layout.user.link.help': 'ajuda', 'layout.user.link.help': 'ajuda',
'layout.user.link.privacy': 'política de privacidade', 'layout.user.link.privacy': 'política de privacidade',
'layout.user.link.terms': 'termos de serviços', 'layout.user.link.terms': 'termos de serviços',
......
export default { export default {
'navBar.lang': '语言', 'navBar.lang': '语言',
'lang.simplified-chinese': '🇨🇳 简体中文',
'lang.traditional-chinese': '🇭🇰 繁体中文',
'lang.english': '🇬🇧 English',
'lang.portuguese': '🇵🇹 Portuguese',
'layout.user.link.help': '帮助', 'layout.user.link.help': '帮助',
'layout.user.link.privacy': '隐私', 'layout.user.link.privacy': '隐私',
'layout.user.link.terms': '条款', 'layout.user.link.terms': '条款',
......
export default { export default {
'navBar.lang': '語言', 'navBar.lang': '語言',
'lang.simplified-chinese': '🇨🇳 简体中文',
'lang.traditional-chinese': '🇭🇰 繁体中文',
'lang.english': '🇬🇧 English',
'lang.portuguese': '🇵🇹 Portuguese',
'layout.user.link.help': '幫助', 'layout.user.link.help': '幫助',
'layout.user.link.privacy': '隱私', 'layout.user.link.privacy': '隱私',
'layout.user.link.terms': '條款', 'layout.user.link.terms': '條款',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment