Skip to content

Commit

Permalink
chore: update docs and code style, ref: ant-design#7553#issuecomment-…
Browse files Browse the repository at this point in the history
…335009581
  • Loading branch information
benjycui committed Oct 10, 2017
1 parent a3c3ec8 commit 91fc781
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
14 changes: 8 additions & 6 deletions components/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import Item from './Item';

export { ListItemProps, ListItemMetaProps } from './Item';

export type ColumnType = 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;

export interface ListGridType {
gutter?: number;
column?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
xs?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
sm?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
md?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
lg?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
xl?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
column?: ColumnType;
xs?: ColumnType;
sm?: ColumnType;
md?: ColumnType;
lg?: ColumnType;
xl?: ColumnType;
}

export type ListSize = 'small' | 'default' | 'large';
Expand Down
13 changes: 7 additions & 6 deletions docs/react/i18n.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ order: 8
title: Internationalization
---

The default language of `[email protected]` is Chinese as of yet.
If you want to use English or other languages, you can follow the instructions below.
The default language of `[email protected]` is English as of yet.
If you want to use other languages, you can follow the instructions below.

## LocaleProvider

antd provides a React Component [LocaleProvider](/components/locale-provider) for configuring antd locale text globally.

```jsx
import { LocaleProvider } from 'antd';
import enUS from 'antd/lib/locale-provider/en_US';
import frFR from 'antd/lib/locale-provider/fr_FR';

return (
<LocaleProvider locale={enUS}>
<LocaleProvider locale={frFR}>
<App />
</LocaleProvider>
);
```

Note: `en_US` is the filename, follow below.
Note: `fr_FR` is the filename, follow below.

Supported languages:

Expand All @@ -30,6 +30,7 @@ Supported languages:
|Bulgarian|bg_BG|
|Catalan|ca_ES|
|Chinese (Traditional)|zh_TW|
|Chinese (Simplified)|zh_CN|
|Czech|cs_CZ|
|Dutch (Belgium)|nl_BE|
|Dutch|nl_NL|
Expand All @@ -55,9 +56,9 @@ Supported languages:
|Slovak|sk_SK|
|Spanish|es_ES|
|Swedish|sv_SE|
|Thai|th_TH|
|Turkish|tr_TR|
|Vietnamese|vi_VN|
|Thai|th_TH|

See usage and ways to contribute a new locale package at [LocaleProvider](/components/locale-provider).

Expand Down
11 changes: 6 additions & 5 deletions docs/react/i18n.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ order: 8
title: 国际化
---

`antd` 目前的默认文案是中文,如果需要使用英文或其他语言,可以参考下面的方案。
`antd` 目前的默认文案是英文,如果需要使用其他语言,可以参考下面的方案。

## LocaleProvider

antd 提供了一个 React 组件 [LocaleProvider](/components/locale-provider) 用于全局配置国际化文案。

```jsx
import enUS from 'antd/lib/locale-provider/en_US';
import zhCN from 'antd/lib/locale-provider/zh_CN';

return (
<LocaleProvider locale={enUS}>
<LocaleProvider locale={zhCN}>
<App />
</LocaleProvider>
);
```

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

目前支持以下语言:

Expand All @@ -28,6 +28,7 @@ return (
|保加利亚语|bg_BG|
|加泰罗尼亚语|ca_ES|
|繁体中文|zh_TW|
|简体中文|zh_CN|
|捷克语|cs_CZ|
|比利时荷兰语|nl_BE|
|荷兰语|nl_NL|
Expand All @@ -51,9 +52,9 @@ return (
|斯洛伐克语|sk_SK|
|西班牙语|es_ES|
|瑞典语|sv_SE|
|泰语|th_TH|
|土耳其语|tr_TR|
|越南语|vi_VN|
|泰语|th_TH|

具体的使用方法和新语言包贡献方式请参考 [LocaleProvider 文档](/components/locale-provider)

Expand Down

0 comments on commit 91fc781

Please sign in to comment.