Skip to content

Commit

Permalink
Add chinese localization (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
wowlusitong authored and javivelasco committed Apr 2, 2017
1 parent 5de4e73 commit 9a916e0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/date_picker/DatePicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export interface DatePickerProps extends ReactToolbox.Props {
* Sets locale for the Dialog.
* @default "en"
*/
locale?: "de" | "no" | "en" | "es" | "af" | "ar" | "be" | "bg" | "bn" | "bo" | "br" | "bs" | "ca" | "gl" | "eu" | "pt" | "it" | "fr" | "ru" | "ua" | DatePickerLocale;
locale?: "de" | "no" | "en" | "es" | "af" | "ar" | "be" | "bg" | "bn" | "bo" | "br" | "bs" | "ca" | "gl" | "eu" | "pt" | "it" | "fr" | "ru" | "ua" | "zh-cn" | "zh-hk" | "zh-tw" DatePickerLocale;
/**
* Date object with the maximum selectable date.
*/
Expand Down
21 changes: 21 additions & 0 deletions components/utils/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ const dateLocales = {
weekdaysShort: 'Нд_Пн_Вт_Ср_Чт_Пт_Сб'.split('_'),
weekdaysLetter: [],
},
'zh-cn': {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
weekdaysLetter: '日_一_二_三_四_五_六'.split('_'),
},
'zh-hk': {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysLetter: '日_一_二_三_四_五_六'.split('_'),
},
'zh-tw': {
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
weekdaysLetter: '日_一_二_三_四_五_六'.split('_'),
},
};

const time = {
Expand Down

0 comments on commit 9a916e0

Please sign in to comment.