mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
📝 improve locale doc, #13462
This commit is contained in:
parent
210aab8d51
commit
16c3a9453e
@ -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>;
|
||||
|
@ -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>;
|
||||
|
@ -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:
|
||||
|
@ -19,6 +19,8 @@ return (
|
||||
);
|
||||
```
|
||||
|
||||
详细配置见:[LocaleProvider](/components/locale-provider)。
|
||||
|
||||
注意:`zh_CN` 是文件名,以下表格也遵循同样的规则。
|
||||
|
||||
目前支持以下语言:
|
||||
|
Loading…
Reference in New Issue
Block a user