chore: update docs and code style, ref: #7553#issuecomment-335009581

This commit is contained in:
Benjy Cui 2017-10-10 10:04:03 +08:00
parent a3c3ec8070
commit 91fc781b6c
3 changed files with 21 additions and 17 deletions

View File

@ -10,14 +10,16 @@ import Item from './Item';
export { ListItemProps, ListItemMetaProps } from './Item'; export { ListItemProps, ListItemMetaProps } from './Item';
export type ColumnType = 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24;
export interface ListGridType { export interface ListGridType {
gutter?: number; gutter?: number;
column?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; column?: ColumnType;
xs?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; xs?: ColumnType;
sm?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; sm?: ColumnType;
md?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; md?: ColumnType;
lg?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; lg?: ColumnType;
xl?: 1 | 2 | 3 | 4 | 6 | 8 | 12 | 24; xl?: ColumnType;
} }
export type ListSize = 'small' | 'default' | 'large'; export type ListSize = 'small' | 'default' | 'large';

View File

@ -3,8 +3,8 @@ order: 8
title: Internationalization title: Internationalization
--- ---
The default language of `antd@2.x` is Chinese as of yet. The default language of `antd@2.x` is English as of yet.
If you want to use English or other languages, you can follow the instructions below. If you want to use other languages, you can follow the instructions below.
## LocaleProvider ## LocaleProvider
@ -12,16 +12,16 @@ antd provides a React Component [LocaleProvider](/components/locale-provider) fo
```jsx ```jsx
import { LocaleProvider } from 'antd'; import { LocaleProvider } from 'antd';
import enUS from 'antd/lib/locale-provider/en_US'; import frFR from 'antd/lib/locale-provider/fr_FR';
return ( return (
<LocaleProvider locale={enUS}> <LocaleProvider locale={frFR}>
<App /> <App />
</LocaleProvider> </LocaleProvider>
); );
``` ```
Note: `en_US` is the filename, follow below. Note: `fr_FR` is the filename, follow below.
Supported languages: Supported languages:
@ -30,6 +30,7 @@ Supported languages:
|Bulgarian|bg_BG| |Bulgarian|bg_BG|
|Catalan|ca_ES| |Catalan|ca_ES|
|Chinese (Traditional)|zh_TW| |Chinese (Traditional)|zh_TW|
|Chinese (Simplified)|zh_CN|
|Czech|cs_CZ| |Czech|cs_CZ|
|Dutch (Belgium)|nl_BE| |Dutch (Belgium)|nl_BE|
|Dutch|nl_NL| |Dutch|nl_NL|
@ -55,9 +56,9 @@ Supported languages:
|Slovak|sk_SK| |Slovak|sk_SK|
|Spanish|es_ES| |Spanish|es_ES|
|Swedish|sv_SE| |Swedish|sv_SE|
|Thai|th_TH|
|Turkish|tr_TR| |Turkish|tr_TR|
|Vietnamese|vi_VN| |Vietnamese|vi_VN|
|Thai|th_TH|
See usage and ways to contribute a new locale package at [LocaleProvider](/components/locale-provider). See usage and ways to contribute a new locale package at [LocaleProvider](/components/locale-provider).

View File

@ -3,23 +3,23 @@ order: 8
title: 国际化 title: 国际化
--- ---
`antd` 目前的默认文案是中文,如果需要使用英文或其他语言,可以参考下面的方案。 `antd` 目前的默认文案是英文,如果需要使用其他语言,可以参考下面的方案。
## LocaleProvider ## LocaleProvider
antd 提供了一个 React 组件 [LocaleProvider](/components/locale-provider) 用于全局配置国际化文案。 antd 提供了一个 React 组件 [LocaleProvider](/components/locale-provider) 用于全局配置国际化文案。
```jsx ```jsx
import enUS from 'antd/lib/locale-provider/en_US'; import zhCN from 'antd/lib/locale-provider/zh_CN';
return ( return (
<LocaleProvider locale={enUS}> <LocaleProvider locale={zhCN}>
<App /> <App />
</LocaleProvider> </LocaleProvider>
); );
``` ```
注意:`en_US` 是文件名,以下表格也遵循同样的规则。 注意:`zh_CN` 是文件名,以下表格也遵循同样的规则。
目前支持以下语言: 目前支持以下语言:
@ -28,6 +28,7 @@ return (
|保加利亚语|bg_BG| |保加利亚语|bg_BG|
|加泰罗尼亚语|ca_ES| |加泰罗尼亚语|ca_ES|
|繁体中文|zh_TW| |繁体中文|zh_TW|
|简体中文|zh_CN|
|捷克语|cs_CZ| |捷克语|cs_CZ|
|比利时荷兰语|nl_BE| |比利时荷兰语|nl_BE|
|荷兰语|nl_NL| |荷兰语|nl_NL|
@ -51,9 +52,9 @@ return (
|斯洛伐克语|sk_SK| |斯洛伐克语|sk_SK|
|西班牙语|es_ES| |西班牙语|es_ES|
|瑞典语|sv_SE| |瑞典语|sv_SE|
|泰语|th_TH|
|土耳其语|tr_TR| |土耳其语|tr_TR|
|越南语|vi_VN| |越南语|vi_VN|
|泰语|th_TH|
具体的使用方法和新语言包贡献方式请参考 [LocaleProvider 文档](/components/locale-provider)。 具体的使用方法和新语言包贡献方式请参考 [LocaleProvider 文档](/components/locale-provider)。