Liu Yanbo 6 anni fa
parent
commit
752cfd421e
4 ha cambiato i file con 46 aggiunte e 6 eliminazioni
  1. 2 1
      CHANGELOG.md
  2. 3 1
      README.md
  3. 40 3
      lib/src/i18n_model.dart
  4. 1 1
      pubspec.yaml

+ 2 - 1
CHANGELOG.md

@@ -23,4 +23,5 @@
 ## [1.1.1] - add 3 more languages
 ## [1.1.2] - add Portuguese
 ## [1.1.3] - update date picker format
-## [1.1.4] - add 2 more languages
+## [1.1.4] - add 2 more languages
+## [1.1.5] - add japanese

+ 3 - 1
README.md

@@ -7,8 +7,8 @@ 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)
-- Dutch(nl)
 - Chinese(zh)
+- Dutch(nl)
 - Russian(ru)
 - Italian(it)
 - French(fr)
@@ -16,6 +16,8 @@ you can choose date / time / date&time in multiple languages:
 - Portuguese(pt)
 - Korean(ko)
 - Arabic(ar)
+- Turkish(tr)
+- Japanese(jp)
 
 and you can also custom your own picker content
 

+ 40 - 3
lib/src/i18n_model.dart

@@ -1,7 +1,6 @@
-enum LocaleType { en, zh, nl, ru, it, fr, es, pt, ko, ar, tr }
+enum LocaleType { en, zh, nl, ru, it, fr, es, pt, ko, ar, tr, jp }
 final _i18nModel = {
   'en': {
-    //default
     'cancel': 'Cancel',
     'done': 'Done',
     'today': 'Today',
@@ -380,7 +379,6 @@ final _i18nModel = {
     'pm': 'م'
   },
   'tr': {
-    //default
     'cancel': 'İptal',
     'done': 'Tamam',
     'today': 'Bugün',
@@ -416,6 +414,43 @@ final _i18nModel = {
     'am': 'ÖÖ',
     'pm': 'ÖS'
   },
+  'jp': {
+    //Japanese
+    'cancel': 'キャンセル',
+    'done': '決定する',
+    'today': '今日',
+    'monthShort': [
+      '一月',
+      '二月',
+      '三月',
+      '四月',
+      '五月',
+      '六月',
+      '七月',
+      '八月',
+      '九月',
+      '十月',
+      '十一月',
+      '十二月'
+    ],
+    'monthLong': [
+      '一月',
+      '二月',
+      '三月',
+      '四月',
+      '五月',
+      '六月',
+      '七月',
+      '八月',
+      '九月',
+      '十月',
+      '十一月',
+      '十二月'
+    ],
+    'day': ['月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日', '日曜日'],
+    'am': '朝',
+    'pm': '午後'
+  },
 };
 //get international object
 Map<String, dynamic> i18nObjInLocale(LocaleType type) {
@@ -440,6 +475,8 @@ Map<String, dynamic> i18nObjInLocale(LocaleType type) {
       return _i18nModel['ar'];
     case LocaleType.tr:
       return _i18nModel['tr'];
+    case LocaleType.jp:
+      return _i18nModel['jp'];
     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.1.4
+version: 1.1.5
 author: Realank <realank@126.com>
 homepage: https://github.com/Realank/flutter_datetime_picker