From ba923f2df6fa6e12b66ac11de993eb46fbc541de Mon Sep 17 00:00:00 2001 From: lixiaochou077 Date: Tue, 9 May 2017 13:59:45 +0800 Subject: [PATCH] tranlate locale-provider ref #329 (#1282) * tranlate locale-provider ref #329 * update --- .../__snapshots__/demo.test.web.js.snap | 4 ++-- components/locale-provider/demo/basic.md | 8 ++++---- components/locale-provider/index.en-US.md | 20 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.web.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.web.js.snap index 7be01598b07..e2f84e079b0 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.web.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.web.js.snap @@ -83,12 +83,12 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
- 日期 + date
- 点击查看国际化 + Click to see i18n text
diff --git a/components/locale-provider/index.en-US.md b/components/locale-provider/index.en-US.md index cd95fd27cb2..d1673f75e98 100644 --- a/components/locale-provider/index.en-US.md +++ b/components/locale-provider/index.en-US.md @@ -4,11 +4,11 @@ title: LocaleProvider type: Other --- -为组件内建文案提供统一的国际化支持。 +`LocaleProvider` provides a uniform localization support for built-in text of components. -## 使用 +## Usage -LocaleProvider 使用 React 的 [context](https://facebook.github.io/react/docs/context.html) 特性,只需在应用外围包裹一次即可全局生效。 +`LocaleProvider` takes use of [context](https://facebook.github.io/react/docs/context.html), a feature of React, to accomplish global effectiveness by wrapping the app only once. ```jsx @@ -19,18 +19,18 @@ import enUS from 'antd-mobile/lib/locale-provider/en_US'; return ; ``` -我们暂时只提供英语,中文两种语言支持(`默认语言是中文`),所有语言包可以在 [这里](https://github.com/ant-design/ant-design-mobile/blob/master/components/locale-provider/) 找到。 +We support English and Chinese temporarily, all locale packages can be found in [here](https://github.com/ant-design/ant-design-mobile/blob/master/components/locale-provider/). -### 增加语言包 +### Add a new language -如果你找不到你需要的语言包,欢迎你在 [英文语言包](https://github.com/ant-design/ant-design-mobile/blob/master/components/locale-provider/en_US.tsx) 的基础上创建一个新的语言包,并给我们 Pull Request。 +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-mobile/blob/master/components/locale-provider/en_US.tsx)) and send us a pull request. -### 其他国际化需求 +### Other localization needs -本模块仅用于组件的内建文案,若有业务文案的国际化需求,建议使用 [react-intl](https://github.com/yahoo/react-intl),可参考示例:[Intl demo 1](http://github.com/ant-design/intl-example) 和 [Intl demo 2](http://yiminghe.me/learning-react/examples/react-intl.html?locale=en-US)。 +This component aims for localization of the built-in text, if you want to support other documents, we recommend using [react-intl](https://github.com/yahoo/react-intl), refer to [Intl demo 1](http://github.com/ant-design/intl-example) and [Intl demo 2](http://yiminghe.me/learning-react/examples/react-intl.html?locale=en-US). ## API -| 参数 | 说明 | 类型 | 默认值 | +| Property | Description | Type | Default | |--------|----------------|------------------|--------------| -| locale | 语言包配置,语言包可到 `antd-mobile/lib/locale-provider/` 目录下寻找 | object | - | +| locale | anguage package setting, you can find the packages in this path: `antd-mobile/lib/locale-provider/` | object | - |