mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
site: use correct locale for component
This commit is contained in:
parent
7404b7f36c
commit
9b17a943f5
@ -83,6 +83,7 @@ module.exports = {
|
||||
webpackConfig(config) {
|
||||
config.resolve.alias = {
|
||||
'antd/lib': path.join(process.cwd(), 'components'),
|
||||
'antd/es': path.join(process.cwd(), 'components'),
|
||||
antd: path.join(process.cwd(), 'index'),
|
||||
site: path.join(process.cwd(), 'site'),
|
||||
'react-router': 'react-router/umd/ReactRouter',
|
||||
|
@ -3,6 +3,9 @@ import ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import { enquireScreen } from 'enquire-js';
|
||||
import { addLocaleData, IntlProvider } from 'react-intl';
|
||||
import 'moment/locale/zh-cn';
|
||||
import { LocaleProvider } from 'antd';
|
||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||
import Header from './Header';
|
||||
import Footer from './Footer';
|
||||
import enLocale from '../../en-US';
|
||||
@ -82,11 +85,13 @@ export default class Layout extends React.Component {
|
||||
|
||||
return (
|
||||
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
|
||||
<div className="page-wrapper">
|
||||
<Header {...restProps} />
|
||||
{children}
|
||||
<Footer {...restProps} />
|
||||
</div>
|
||||
<LocaleProvider locale={appLocale.locale === 'zh-CN' ? zhCN : null}>
|
||||
<div className="page-wrapper">
|
||||
<Header {...restProps} />
|
||||
{children}
|
||||
<Footer {...restProps} />
|
||||
</div>
|
||||
</LocaleProvider>
|
||||
</IntlProvider>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user