📝 improve locale doc, #13462

This commit is contained in:
afc163 2018-12-07 18:16:23 +08:00
parent 210aab8d51
commit 16c3a9453e
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48
4 changed files with 9 additions and 0 deletions

View File

@ -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>;

View File

@ -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>;

View File

@ -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:

View File

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