From 9a916e0176350eebb65d7a8df0223e29be165e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=80=9D=E4=BE=97?= <499422444@qq.com> Date: Sun, 2 Apr 2017 20:08:45 +0800 Subject: [PATCH] Add chinese localization (#1290) --- components/date_picker/DatePicker.d.ts | 2 +- components/utils/time.js | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/components/date_picker/DatePicker.d.ts b/components/date_picker/DatePicker.d.ts index eccbb72f..597f1060 100644 --- a/components/date_picker/DatePicker.d.ts +++ b/components/date_picker/DatePicker.d.ts @@ -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. */ diff --git a/components/utils/time.js b/components/utils/time.js index 4cee80e3..aea60d76 100644 --- a/components/utils/time.js +++ b/components/utils/time.js @@ -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 = {