mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
site: show lang button
This commit is contained in:
parent
bf96362cea
commit
b7e6b1ba51
@ -152,13 +152,9 @@ export default class Header extends React.Component {
|
||||
{options}
|
||||
</Select>
|
||||
</div>
|
||||
{
|
||||
window.location.port ? (
|
||||
<Button id="lang" type="ghost" size="small" onClick={this.handleLangChange}>
|
||||
<FormattedMessage id="app.header.lang" />
|
||||
</Button>
|
||||
) : null
|
||||
}
|
||||
<Button id="lang" type="ghost" size="small" onClick={this.handleLangChange}>
|
||||
<FormattedMessage id="app.header.lang" />
|
||||
</Button>
|
||||
<Menu mode={this.state.menuMode} selectedKeys={[activeMenuItem]} id="nav">
|
||||
<Menu.Item key="home">
|
||||
<Link to="/">
|
||||
|
@ -12,9 +12,8 @@ window.react = React;
|
||||
window['react-dom'] = ReactDOM;
|
||||
window.antd = require('antd');
|
||||
|
||||
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US');
|
||||
// (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') ||
|
||||
// (navigator.language === 'zh-CN');
|
||||
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') ||
|
||||
(navigator.language === 'zh-CN');
|
||||
|
||||
const appLocale = isZhCN ? cnLocale : enLocale;
|
||||
addLocaleData(appLocale.data);
|
||||
|
Loading…
Reference in New Issue
Block a user