ant-design/components/locale-provider/index.en-US.md
ddcat1115 0baef0627e docs: 调整组件导航结构 (#3758)
- Layout 更名为 Grid
2016-11-09 14:43:32 +08:00

1.3 KiB

category type cols title
Components Localization 1 LocaleProvider

LocaleProvider provides a uniform localization support for built-in text of components.

Usage

LocaleProvider takes use of context, a feature of React, to accomplish global effectiveness by wrapping the app only once.

import enUS from 'antd/lib/locale-provider/en_US';

...

return <LocaleProvider locale={enUS}><App /></LocaleProvider>;

Add a language

We supply an English locale package. Other language users can create a locale package based on en_US and send us a pull request.

Other localization needs

This component aims for localization of the built-in text, if you want to support other documents, we recommend using react-intl, refer to Intl demo 1 and Intl demo 2.

API

Property Description Type Default
locale language package setting, you can find the packages in this path: antd/lib/locale-provider/ Object -