Browse Source

📝 improve locale doc, #13462

pull/13476/head
afc163 6 years ago
parent
commit
16c3a9453e
No known key found for this signature in database GPG Key ID: 738F973FCE5C6B48
  1. 2
      components/locale-provider/index.en-US.md
  2. 3
      components/locale-provider/index.zh-CN.md
  3. 2
      docs/react/i18n.en-US.md
  4. 2
      docs/react/i18n.zh-CN.md

2
components/locale-provider/index.en-US.md

@ -14,8 +14,10 @@ title: LocaleProvider
```jsx
import { LocaleProvider } from 'antd';
import fr_FR from 'antd/lib/locale-provider/fr_FR';
import moment from 'moment';
import 'moment/locale/fr';
moment.locale('fr');
...
return <LocaleProvider locale={fr_FR}><App /></LocaleProvider>;

3
components/locale-provider/index.zh-CN.md

@ -15,7 +15,10 @@ LocaleProvider 使用 React 的 [context](https://facebook.github.io/react/docs/
```jsx
import { LocaleProvider } from 'antd';
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
...
return <LocaleProvider locale={zh_CN}><App /></LocaleProvider>;

2
docs/react/i18n.en-US.md

@ -21,6 +21,8 @@ return (
);
```
You can see complete config at: [LocaleProvider](/components/locale-provider).
Note: `fr_FR` is the filename, follow below.
Supported languages:

2
docs/react/i18n.zh-CN.md

@ -19,6 +19,8 @@ return (
);
```
详细配置见:[LocaleProvider](/components/locale-provider)。
注意:`zh_CN` 是文件名,以下表格也遵循同样的规则。
目前支持以下语言:

Loading…
Cancel
Save