Skip to content

Commit 2e8d5ce

Browse files
authored
Merge branch 'master' into master
2 parents 7681e20 + 22cfd57 commit 2e8d5ce

File tree

4 files changed

+151
-13
lines changed

4 files changed

+151
-13
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ you can choose date / time / date&time in multiple languages:
3434
- Thai(th)
3535
- Turkish(tr)
3636
- Vietnamese(vi)
37+
- Khmer(kh)
3738

3839

3940
and you can also custom your own picker content

lib/flutter_datetime_picker.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,12 @@ class _DatePickerState extends State<_DatePickerComponent> {
408408
rightScrollCtrl,
409409
widget.pickerModel.layoutProportions()[2], (index) {
410410
widget.pickerModel.setRightIndex(index);
411-
_notifyDateChanged();
412-
}, null)
411+
}, (index) {
412+
setState(() {
413+
refreshScrollOffset();
414+
_notifyDateChanged();
415+
});
416+
})
413417
: null,
414418
),
415419
],

lib/src/date_model.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,9 @@ class Time12hPickerModel extends CommonPickerModel {
457457
@override
458458
String rightStringAtIndex(int index) {
459459
if (index == 0) {
460-
return "AM";
460+
return i18nObjInLocale(this.locale)["am"];
461461
} else if (index == 1) {
462-
return "PM";
462+
return i18nObjInLocale(this.locale)["pm"];
463463
} else {
464464
return null;
465465
}

lib/src/i18n_model.dart

Lines changed: 142 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,47 @@ enum LocaleType {
3131
no,
3232
sq,
3333
sv,
34+
kh,
3435
tw
3536
}
3637

3738
final _i18nModel = {
39+
'kh': {
40+
'cancel': 'បោះបង់',
41+
'done': 'រួចរាល់',
42+
'today': 'ថ្ងៃនេះ',
43+
'monthShort': [
44+
'មករា',
45+
'កុម្ភះ',
46+
'មិនា',
47+
'មេសា',
48+
'ឧសភា',
49+
'មិថុនា',
50+
'កក្កដា',
51+
'សីហា',
52+
'កញ្ញា',
53+
'តុលា',
54+
'វិច្ឆិកា',
55+
'ធ្នូ'
56+
],
57+
'monthLong': [
58+
'មករា',
59+
'កុម្ភះ',
60+
'មិនា',
61+
'មេសា',
62+
'ឧសភា',
63+
'មិថុនា',
64+
'កក្កដា',
65+
'សីហា',
66+
'កញ្ញា',
67+
'តុលា',
68+
'វិច្ឆិកា',
69+
'ធ្នូ'
70+
],
71+
'day': ['ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍', 'អាទិត្យ'],
72+
'am': 'ព្រឹក',
73+
'pm': 'ថ្ងៃ'
74+
},
3875
'en': {
3976
'cancel': 'Cancel',
4077
'done': 'Done',
@@ -139,7 +176,15 @@ final _i18nModel = {
139176
'آبان',
140177
'آذر',
141178
],
142-
'day': ['دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنج شنبه', 'جمعه', 'شنبه', 'یکشنبه'],
179+
'day': [
180+
'دوشنبه',
181+
'سه شنبه',
182+
'چهارشنبه',
183+
'پنج شنبه',
184+
'جمعه',
185+
'شنبه',
186+
'یکشنبه'
187+
],
143188
'am': 'صبح',
144189
'pm': 'عصر'
145190
},
@@ -148,8 +193,34 @@ final _i18nModel = {
148193
'cancel': '取消',
149194
'done': '确定',
150195
'today': '今天',
151-
'monthShort': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
152-
'monthLong': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
196+
'monthShort': [
197+
'一月',
198+
'二月',
199+
'三月',
200+
'四月',
201+
'五月',
202+
'六月',
203+
'七月',
204+
'八月',
205+
'九月',
206+
'十月',
207+
'十一月',
208+
'十二月'
209+
],
210+
'monthLong': [
211+
'一月',
212+
'二月',
213+
'三月',
214+
'四月',
215+
'五月',
216+
'六月',
217+
'七月',
218+
'八月',
219+
'九月',
220+
'十月',
221+
'十一月',
222+
'十二月'
223+
],
153224
'day': ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
154225
'am': '上午',
155226
'pm': '下午'
@@ -466,8 +537,34 @@ final _i18nModel = {
466537
'cancel': '취소',
467538
'done': '완료',
468539
'today': '오늘',
469-
'monthShort': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
470-
'monthLong': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
540+
'monthShort': [
541+
'1월',
542+
'2월',
543+
'3월',
544+
'4월',
545+
'5월',
546+
'6월',
547+
'7월',
548+
'8월',
549+
'9월',
550+
'10월',
551+
'11월',
552+
'12월'
553+
],
554+
'monthLong': [
555+
'1월',
556+
'2월',
557+
'3월',
558+
'4월',
559+
'5월',
560+
'6월',
561+
'7월',
562+
'8월',
563+
'9월',
564+
'10월',
565+
'11월',
566+
'12월'
567+
],
471568
'day': ['월', '화', '수', '목', '금', '토', '일'],
472569
'am': '오전',
473570
'pm': '오후'
@@ -540,7 +637,15 @@ final _i18nModel = {
540637
'نوفمبر',
541638
'ديسمبر'
542639
],
543-
'day': ['الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعه', 'السبت', 'الاحد'],
640+
'day': [
641+
'الإثنين',
642+
'الثلاثاء',
643+
'الأربعاء',
644+
'الخميس',
645+
'الجمعه',
646+
'السبت',
647+
'الاحد'
648+
],
544649
'am': 'ص',
545650
'pm': 'م'
546651
},
@@ -621,8 +726,34 @@ final _i18nModel = {
621726
'cancel': 'キャンセル',
622727
'done': '完了',
623728
'today': '今日',
624-
'monthShort': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
625-
'monthLong': ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
729+
'monthShort': [
730+
'1月',
731+
'2月',
732+
'3月',
733+
'4月',
734+
'5月',
735+
'6月',
736+
'7月',
737+
'8月',
738+
'9月',
739+
'10月',
740+
'11月',
741+
'12月'
742+
],
743+
'monthLong': [
744+
'1月',
745+
'2月',
746+
'3月',
747+
'4月',
748+
'5月',
749+
'6月',
750+
'7月',
751+
'8月',
752+
'9月',
753+
'10月',
754+
'11月',
755+
'12月'
756+
],
626757
'day': ['月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日'],
627758
'am': '午前',
628759
'pm': '午後'
@@ -959,7 +1090,7 @@ final _i18nModel = {
9591090
'Setembre',
9601091
'Octubre',
9611092
'Novembre',
962-
'Decembre'
1093+
'Desembre'
9631094
],
9641095
'day': ['Dl', 'Dt', 'Dc', 'Dj', 'Dv', 'Ds', 'Dg'],
9651096
'am': 'AM',
@@ -1213,6 +1344,8 @@ Map<String, dynamic> i18nObjInLocale(LocaleType type) {
12131344
return _i18nModel['sq'];
12141345
case LocaleType.sv:
12151346
return _i18nModel['sv'];
1347+
case LocaleType.kh:
1348+
return _i18nModel['kh'];
12161349
case LocaleType.tw:
12171350
return _i18nModel['tw'];
12181351
default:

0 commit comments

Comments
 (0)