Sfoglia il codice sorgente

Merge pull request #108 from gomiunik/si_language_support

Slovenian language support
刘彦博 5 anni fa
parent
commit
388406c4f9
2 ha cambiato i file con 45 aggiunte e 1 eliminazioni
  1. 4 0
      lib/src/date_format.dart
  2. 41 1
      lib/src/i18n_model.dart

+ 4 - 0
lib/src/date_format.dart

@@ -241,6 +241,8 @@ String formatDate(DateTime date, List<String> formats, LocaleType locale) {
         return formatDate(date, [D, ', ', dd, ' ', M], locale);
       } else if (locale == LocaleType.jp) {
         return formatDate(date, [mm, '月', dd, '日', D], locale);
+      } else if (locale == LocaleType.si) {
+        return formatDate(date, [D, ', ', dd, '. ', M, '.'], locale);
       } else {
         return formatDate(date, [D, ' ', M, ' ', dd], locale);
       }
@@ -257,6 +259,8 @@ String formatDate(DateTime date, List<String> formats, LocaleType locale) {
         return formatDate(date, [D, ', ', dd, ' ', M, ' ', yyyy], locale);
       } else if (locale == LocaleType.jp) {
         return formatDate(date, [yyyy, '年', mm, '月', dd, '日', D], locale);
+      } else if (locale == LocaleType.si) {
+        return formatDate(date, [D, ', ', dd, '. ', M, '. ', yyyy], locale);
       } else {
         return formatDate(date, [D, ' ', M, ' ', dd, ', ', yyyy], locale);
       }

+ 41 - 1
lib/src/i18n_model.dart

@@ -25,7 +25,8 @@ enum LocaleType {
   bg,
   eu,
   cat,
-  th
+  th,
+  si
 }
 
 final _i18nModel = {
@@ -949,6 +950,43 @@ final _i18nModel = {
     'am': 'AM',
     'pm': 'PM'
   },
+  'si': {
+    //Slovenian
+    'cancel': 'Prekliči',
+    'done': 'V redu',
+    'today': 'Danes',
+    'monthShort': [
+      'jan',
+      'feb',
+      'mar',
+      'apr',
+      'maj',
+      'jun',
+      'jul',
+      'avg',
+      'sep',
+      'okt',
+      'nov',
+      'dec'
+    ],
+    'monthLong': [
+      'januar',
+      'februar',
+      'marec',
+      'april',
+      'maj',
+      'junij',
+      'julij',
+      'avgust',
+      'september',
+      'oktober',
+      'november',
+      'december'
+    ],
+    'day': ['pon', 'tor', 'sre', 'čet', 'pet', 'sob', 'ned'],
+    'am': '',
+    'pm': ''
+  },
 };
 //get international object
 Map<String, dynamic> i18nObjInLocale(LocaleType type) {
@@ -1005,6 +1043,8 @@ Map<String, dynamic> i18nObjInLocale(LocaleType type) {
       return _i18nModel['cat'];
     case LocaleType.th:
       return _i18nModel['th'];
+    case LocaleType.si:
+      return _i18nModel['si'];
     default:
       return _i18nModel['en'];
   }