Skip to content

Commit

Permalink
📝 improve locale doc, ant-design#13462
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 7, 2018
1 parent 210aab8 commit 16c3a94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/locale-provider/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
3 changes: 3 additions & 0 deletions components/locale-provider/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
2 changes: 2 additions & 0 deletions docs/react/i18n.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions docs/react/i18n.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ return (
);
```

详细配置见:[LocaleProvider](/components/locale-provider)

注意:`zh_CN` 是文件名,以下表格也遵循同样的规则。

目前支持以下语言:
Expand Down

0 comments on commit 16c3a94

Please sign in to comment.