mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-26 20:20:00 +08:00
27 lines
833 B
JavaScript
27 lines
833 B
JavaScript
import React from 'react';
|
|
import { addLocaleData, IntlProvider } from 'react-intl';
|
|
import Header from './Header';
|
|
import Footer from './Footer';
|
|
import enLocale from '../../en-US.js';
|
|
import cnLocale from '../../zh-CN.js';
|
|
import '../../static/style';
|
|
|
|
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') !== 'en-US');
|
|
// (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') ||
|
|
// (navigator.language === 'zh-CN');
|
|
|
|
const appLocale = isZhCN ? cnLocale : enLocale;
|
|
addLocaleData(appLocale.data);
|
|
|
|
export default (props) => {
|
|
return (
|
|
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
|
|
<div className="page-wrapper">
|
|
<Header {...props} />
|
|
{props.children}
|
|
<Footer />
|
|
</div>
|
|
</IntlProvider>
|
|
);
|
|
};
|