Traditional Chinese locale provider added (#5665)

This commit is contained in:
OAwan 2017-04-07 19:19:38 +08:00 committed by Wei Zhu
parent 85615771d5
commit 967bfd79c3
7 changed files with 77 additions and 2 deletions

View File

@ -0,0 +1,2 @@
import zh_TW from '../../date-picker/locale/zh_TW';
export default zh_TW;

View File

@ -0,0 +1,18 @@
import CalendarLocale from 'rc-calendar/lib/locale/zh_TW';
import TimePickerLocale from '../../time-picker/locale/zh_TW';
import assign from 'object-assign';
const locale = {
lang: assign({
placeholder: '請選擇日期',
rangePlaceholder: ['開始日期', '結束日期'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
locale.lang.ok = '確 定';
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@ -18,6 +18,7 @@ import etEE from '../et_EE';
import skSK from '../sk_SK';
import jaJP from '../ja_JP';
import trTR from '../tr_TR';
import zhTW from '../zh_TW';
const Option = Select.Option;
const RangePicker = DatePicker.RangePicker;
@ -63,7 +64,7 @@ const App = () => (
describe('Locale Provider', () => {
it('should display the text as locale changed', () => {
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR].forEach((locale) => {
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW].forEach((locale) => {
const wrapper = mount(
<LocaleProvider locale={locale}>
<App />
@ -85,7 +86,7 @@ describe('Locale Provider', () => {
return null;
}
}
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, trTR].forEach((locale) => {
[enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, trTR, zhTW].forEach((locale) => {
mount(
<LocaleProvider locale={locale}>
<ModalDemo />

View File

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('zh-tw');
import Pagination from 'rc-pagination/lib/locale/zh_TW';
import DatePicker from '../date-picker/locale/zh_TW';
import TimePicker from '../time-picker/locale/zh_TW';
import Calendar from '../calendar/locale/zh_TW';
export default {
locale: 'zh-tw',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: '篩選器',
filterConfirm: '確 定',
filterReset: '重 置',
emptyText: '目前尚無資料',
selectAll: '全部選取',
selectInvert: '反向選取',
},
Modal: {
okText: '確 定',
cancelText: '取 消',
justOkText: 'OK',
},
Popconfirm: {
okText: '確 定',
cancelText: '取 消',
},
Transfer: {
notFoundContent: '查無此資料',
searchPlaceholder: '搜尋資料',
itemUnit: '項目',
itemsUnit: '項目',
},
Select: {
notFoundContent: '查無此資料',
},
Upload: {
uploading: '正在上傳...',
removeFile: '刪除檔案',
uploadError: '上傳失敗',
previewFile: '檔案預覽',
},
};

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: '請選擇時間',
};
export default locale;

View File

@ -37,6 +37,7 @@ Supported languages:
- Turkish - tr_TR
- Slovak - sk_SK
- Estonian - et_EE
- Chinese (Traditional) - zh_TW
See usage and contributing way of a new locale package at [LocaleProvider](/components/locale-provider).

View File

@ -36,6 +36,7 @@ return (
- 土耳其语 - tr_TR
- 斯洛伐克语 - sk_SK
- 爱沙尼亚语 - et_EE
- 繁體中文 - zh_TW
具体的使用方法和新语言包贡献方式请参考 [LocaleProvider 文档](/components/locale-provider)。