diff --git a/components/locale-provider/index.en-US.md b/components/locale-provider/index.en-US.md index 85338d09b6..b77be089e8 100644 --- a/components/locale-provider/index.en-US.md +++ b/components/locale-provider/index.en-US.md @@ -13,23 +13,24 @@ title: LocaleProvider ```jsx import { LocaleProvider } from 'antd'; -import enUS from 'antd/lib/locale-provider/en_US'; +import fr_FR from 'antd/lib/locale-provider/fr_FR'; +import 'moment/locale/fr'; ... -return ; +return ; ``` We provide some locale like English, Chinese, Russian, German, French and etc, all locale packages can be found in [here](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/). -Note: if you need to use antd's UMD dist file, please import `antd/dist/antd-with-locales.js`: +Note: if you need to use antd's UMD dist file, please use `antd/dist/antd-with-locales.js` and corresponding moment locale: ```jsx const { LocaleProvider, locales } = window.antd; ... -return ; +return ; ``` ### Add a new language diff --git a/components/locale-provider/index.zh-CN.md b/components/locale-provider/index.zh-CN.md index 7126593da0..6b41f7d7de 100644 --- a/components/locale-provider/index.zh-CN.md +++ b/components/locale-provider/index.zh-CN.md @@ -13,16 +13,18 @@ title: LocaleProvider LocaleProvider 使用 React 的 [context](https://facebook.github.io/react/docs/context.html) 特性,只需在应用外围包裹一次即可全局生效。 ```jsx -import enUS from 'antd/lib/locale-provider/en_US'; +import { LocaleProvider } from 'antd'; +import zh_CN from 'antd/lib/locale-provider/zh_CN'; +import 'moment/locale/zh-cn'; ... -return ; +return ; ``` 我们提供了英语,中文,俄语,法语,德语等多种语言支持,所有语言包可以在 [这里](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/) 找到。 -注意:如果你需要使用 UMD 版的 dist 文件,应该引入 `antd/dist/antd-with-locales.js`,然后按以下方式使用: +注意:如果你需要使用 UMD 版的 dist 文件,应该引入 `antd/dist/antd-with-locales.js`,同时引入 moment 对应的 locale,然后按以下方式使用: ```jsx const { LocaleProvider, locales } = window.antd;