Procházet zdrojové kódy

add more languages

Liu Yanbo před 6 roky
rodič
revize
e3e7405a91
4 změnil soubory, kde provedl 55 přidání a 106 odebrání
  1. 2 1
      CHANGELOG.md
  2. 3 0
      README.md
  3. 49 104
      lib/src/i18n_model.dart
  4. 1 1
      pubspec.yaml

+ 2 - 1
CHANGELOG.md

@@ -29,4 +29,5 @@
 ## [1.1.7] - update something
 ## [1.1.8] - update something
 ## [1.1.9] - add German
-## [1.2.09] - add support for time zone
+## [1.2.0] - add support for time zone
+## [1.2.1] - add more languages

+ 3 - 0
README.md

@@ -7,6 +7,7 @@ A flutter date time picker inspired by [flutter-cupertino-date-picker](https://g
 you can choose date / time / date&time in multiple languages:
 
 - English(en)
+- Persian(fa)
 - Chinese(zh)
 - Dutch(nl)
 - Russian(ru)
@@ -19,6 +20,8 @@ you can choose date / time / date&time in multiple languages:
 - Arabic(ar)
 - Turkish(tr)
 - Japanese(jp)
+- German(de)
+- Danish(da)
 
 and you can also custom your own picker content
 

+ 49 - 104
lib/src/i18n_model.dart

@@ -1,4 +1,4 @@
-enum LocaleType { en, fa ,zh, nl, ru, it, fr, es, pl, pt, ko, ar, tr, jp, de }
+enum LocaleType { en, fa, zh, nl, ru, it, fr, es, pl, pt, ko, ar, tr, jp, de, da }
 
 final _i18nModel = {
   'en': {
@@ -69,15 +69,7 @@ final _i18nModel = {
       'بهمن',
       'اسفند'
     ],
-    'day': [
-      'دوشنبه',
-      'سه شنبه',
-      'چهارشنبه',
-      'پنج شنبه',
-      'جمعه',
-      'شنبه',
-      'یکشنبه'
-    ],
+    'day': ['دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنج شنبه', 'جمعه', 'شنبه', 'یکشنبه'],
     'am': 'صبح',
     'pm': 'عصر'
   },
@@ -86,34 +78,8 @@ final _i18nModel = {
     'cancel': '取消',
     'done': '确定',
     'today': '今天',
-    'monthShort': [
-      '一月',
-      '二月',
-      '三月',
-      '四月',
-      '五月',
-      '六月',
-      '七月',
-      '八月',
-      '九月',
-      '十月',
-      '十一月',
-      '十二月'
-    ],
-    'monthLong': [
-      '一月',
-      '二月',
-      '三月',
-      '四月',
-      '五月',
-      '六月',
-      '七月',
-      '八月',
-      '九月',
-      '十月',
-      '十一月',
-      '十二月'
-    ],
+    'monthShort': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+    'monthLong': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
     'day': ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
     'am': '上午',
     'pm': '下午'
@@ -383,34 +349,8 @@ final _i18nModel = {
     'cancel': '취소',
     'done': '완료',
     'today': '오늘',
-    'monthShort': [
-      '1월',
-      '2월',
-      '3월',
-      '4월',
-      '5월',
-      '6월',
-      '7월',
-      '8월',
-      '9월',
-      '10월',
-      '11월',
-      '12월'
-    ],
-    'monthLong': [
-      '1월',
-      '2월',
-      '3월',
-      '4월',
-      '5월',
-      '6월',
-      '7월',
-      '8월',
-      '9월',
-      '10월',
-      '11월',
-      '12월'
-    ],
+    'monthShort': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
+    'monthLong': ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
     'day': ['월', '화', '수', '목', '금', '토', '일'],
     'am': '오전',
     'pm': '오후'
@@ -447,15 +387,7 @@ final _i18nModel = {
       'نوفمبر',
       'ديسمبر'
     ],
-    'day': [
-      'الإثنين',
-      'الثلاثاء',
-      'الأربعاء',
-      'الخميس',
-      'الجمعه',
-      'السبت',
-      'الاحد'
-    ],
+    'day': ['الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعه', 'السبت', 'الاحد'],
     'am': 'ص',
     'pm': 'م'
   },
@@ -500,34 +432,8 @@ final _i18nModel = {
     'cancel': 'キャンセル',
     'done': '決定する',
     'today': '今日',
-    'monthShort': [
-      '一月',
-      '二月',
-      '三月',
-      '四月',
-      '五月',
-      '六月',
-      '七月',
-      '八月',
-      '九月',
-      '十月',
-      '十一月',
-      '十二月'
-    ],
-    'monthLong': [
-      '一月',
-      '二月',
-      '三月',
-      '四月',
-      '五月',
-      '六月',
-      '七月',
-      '八月',
-      '九月',
-      '十月',
-      '十一月',
-      '十二月'
-    ],
+    'monthShort': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+    'monthLong': ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
     'day': ['月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日'],
     'am': '朝',
     'pm': '午後'
@@ -569,6 +475,43 @@ final _i18nModel = {
     'am': 'AM',
     'pm': 'PM'
   },
+  'da': {
+//Danish
+    'cancel': 'Annullér',
+    'done': 'OK',
+    'today': 'I dag',
+    'monthShort': [
+      'jan',
+      'feb',
+      'mar',
+      'apr',
+      'maj',
+      'juni',
+      'juli',
+      'aug',
+      'sept',
+      'okt',
+      'nov',
+      'dec'
+    ],
+    'monthLong': [
+      'januar',
+      'februar',
+      'marts',
+      'april',
+      'maj',
+      'juni',
+      'juli',
+      'august',
+      'september',
+      'oktober',
+      'november',
+      'december'
+    ],
+    'day': ['man', 'tirs', 'ons', 'tors', 'fre', 'lør', 'søn'],
+    'am': 'AM',
+    'pm': 'PM'
+  },
 };
 //get international object
 Map<String, dynamic> i18nObjInLocale(LocaleType type) {
@@ -601,7 +544,9 @@ Map<String, dynamic> i18nObjInLocale(LocaleType type) {
       return _i18nModel['jp'];
     case LocaleType.de:
       return _i18nModel['de'];
+    case LocaleType.da:
+      return _i18nModel['da'];
     default:
       return _i18nModel['en'];
   }
-}-
+}

+ 1 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: flutter_datetime_picker
 description: A date time picker for flutter, you can choose date / time / date&time in English Dutch and Chinese, and you can also custom your own picker content
-version: 1.2.0
+version: 1.2.1
 author: Realank <realank@126.com>
 homepage: https://github.com/Realank/flutter_datetime_picker