mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-24 15:38:45 +08:00
docs: update docs for LocaleProvider, close: #5271
This commit is contained in:
parent
0042ac1c0a
commit
b567c99074
@ -23,6 +23,16 @@ return <LocaleProvider locale={enUS}><App /></LocaleProvider>;
|
||||
|
||||
We provide some locale like English, Chinese, Russian, German, French and etc, all locale packages can be found in [here](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/).
|
||||
|
||||
Note: if you need to use antd's UMD dist file, please import `antd/dist/antd-with-locales.js`:
|
||||
|
||||
```jsx
|
||||
const { LocaleProvider, locales } = window.antd;
|
||||
|
||||
...
|
||||
|
||||
return <LocaleProvider locale={locales.en_US}><App /></LocaleProvider>;
|
||||
```
|
||||
|
||||
### Add a new language
|
||||
|
||||
If you can't find your language, you are welcome to create a locale package based on [en_US](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/en_US.tsx) and send us a pull request.
|
||||
|
@ -23,6 +23,16 @@ return <LocaleProvider locale={enUS}><App /></LocaleProvider>;
|
||||
|
||||
我们提供了英语,中文,俄语,法语,德语等多种语言支持,所有语言包可以在 [这里](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/) 找到。
|
||||
|
||||
注意:如果你需要使用 UMD 版的 dist 文件,应该引入 `antd/dist/antd-with-locales.js`,然后按以下方式使用:
|
||||
|
||||
```jsx
|
||||
const { LocaleProvider, locales } = window.antd;
|
||||
|
||||
...
|
||||
|
||||
return <LocaleProvider locale={locales.en_US}><App /></LocaleProvider>;
|
||||
```
|
||||
|
||||
### 增加语言包
|
||||
|
||||
如果你找不到你需要的语言包,欢迎你在 [英文语言包](https://github.com/ant-design/ant-design/blob/master/components/locale-provider/en_US.tsx) 的基础上创建一个新的语言包,并给我们 Pull Request。
|
||||
|
Loading…
Reference in New Issue
Block a user