afc163
6 years ago
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48
4 changed files with
9 additions and
0 deletions
-
components/locale-provider/index.en-US.md
-
components/locale-provider/index.zh-CN.md
-
docs/react/i18n.en-US.md
-
docs/react/i18n.zh-CN.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>; |
|
|
|
|
|
@ -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` 是文件名,以下表格也遵循同样的规则。 |
|
|
|
|
|
|
|
目前支持以下语言: |
|
|
|