Skip to content

Commit

Permalink
pagination translation, ref ant-design#329 (ant-design#1291)
Browse files Browse the repository at this point in the history
* pagination translation, ref ant-design#329

* update
  • Loading branch information
silentcloud authored and lixiaoyang1992 committed Apr 26, 2018
1 parent 4d2f12a commit 4ed4027
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<p
class="sub-title"
>
按钮内带文本
Button with text
</p>
<div
class="am-pagination"
Expand All @@ -24,7 +24,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
role="button"
>
<span>
上一步
Prev
</span>
</a>
</div>
Expand All @@ -51,7 +51,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
role="button"
>
<span>
下一步
Next
</span>
</a>
</div>
Expand All @@ -60,7 +60,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<p
class="sub-title"
>
带文本和icon
Button with text and icon
</p>
<div
class="am-pagination"
Expand Down Expand Up @@ -131,7 +131,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<p
class="sub-title"
>
隐藏数字
Hide number
</p>
<div
class="am-pagination"
Expand All @@ -148,7 +148,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
role="button"
>
<span>
上一步
Prev
</span>
</a>
</div>
Expand All @@ -161,7 +161,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
role="button"
>
<span>
下一步
Next
</span>
</a>
</div>
Expand All @@ -170,7 +170,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<p
class="sub-title"
>
只显示数字
Show number only
</p>
<div
class="am-pagination"
Expand All @@ -192,7 +192,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<p
class="sub-title"
>
点状
Point Style
</p>
<div
class="am-pagination"
Expand Down
20 changes: 13 additions & 7 deletions components/pagination/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,43 @@ title:
en-US: Basic
---

## zh-CN

基本的分页器。

## en-US

Basic Pagination

````jsx
import { Pagination, Icon } from 'antd-mobile';

const locale = {
prevText: '上一步',
nextText: '下一步',
prevText: 'Prev',
nextText: 'Next',
};


const App = () => (
<div className="pagination-container" >
<p className="sub-title">按钮内带文本</p>
<p className="sub-title">Button with text</p>
<Pagination total={5} current={1} locale={locale} />

<p className="sub-title">带文本和icon</p>
<p className="sub-title">Button with text and icon</p>
<Pagination total={5} current={1}
locale={{
prevText: (<div className="arrow-align"><Icon type="left" />上一步</div>),
nextText: (<div className="arrow-align">下一步<Icon type="right" /></div>),
}}
/>

<p className="sub-title">隐藏数字</p>
<p className="sub-title">Hide number</p>
<Pagination simple total={5} current={1} locale={locale} />

<p className="sub-title">只显示数字</p>
<p className="sub-title">Show number only</p>
<Pagination mode="number" total={5} current={3} />

<p className="sub-title">点状</p>
<p className="sub-title">Point Style</p>
<Pagination mode="pointer" total={5} current={2} style={{ marginBottom: '0.32rem' }} />
</div>
);
Expand Down
21 changes: 11 additions & 10 deletions components/pagination/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ type: Navigation
title: Pagination
---

分隔长列表,每次只加载一个页面。
A long list can be divided into several pages by `Pagination`, and only one page will be loaded at a time.

### 规则
- 当加载/渲染所有数据将花费很多时间或者流量时使用
### Rule

- When it will take a long time to load/render all items.

## API

Support WEB, React-Native.

Properties | Descrition | Type | Default
-----------|------------|------|--------
| mode | 形态,可选`button`,`number`,`pointer` | string | `button` |
| current | 当前索引(注意索引是从0开始计数的) | number | |
| total | 数据总数 | number | 0 |
| simple | 是否隐藏数值 | boolean | false |
| disabled | 禁用状态 | boolean | false |
| locale | 国际化, 可以覆盖全局`LocaleProvider`的配置 | Object:{prevText, nextText} | |
| onChange | change 事件触发的回调函数 | (e: Object): void | |
| mode | the mode of `Pagination` which can be one of `button`,`number`,`pointer` | string | `button` |
| current | current page index(Note: the index is counted from 0) | number | |
| total | total number of data | number | 0 |
| simple | whether to hide number | boolean | false |
| disabled | whether is disabled | boolean | false |
| locale | [i18n](/components/locale-provider/) setting, you can override the configuration of the global `LocaleProvider | Object:{prevText, nextText} | |
| onChange | invoked with the new index when the value changes. | (index: Number): void | |

0 comments on commit 4ed4027

Please sign in to comment.