br.js (5520B)
1//! moment.js locale configuration 2//! locale : Breton [br] 3//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou 4 5;(function (global, factory) { 6 typeof exports === 'object' && typeof module !== 'undefined' 7 && typeof require === 'function' ? factory(require('../moment')) : 8 typeof define === 'function' && define.amd ? define(['../moment'], factory) : 9 factory(global.moment) 10}(this, (function (moment) { 'use strict'; 11 12 //! moment.js locale configuration 13 14 function relativeTimeWithMutation(number, withoutSuffix, key) { 15 var format = { 16 mm: 'munutenn', 17 MM: 'miz', 18 dd: 'devezh', 19 }; 20 return number + ' ' + mutation(format[key], number); 21 } 22 function specialMutationForYears(number) { 23 switch (lastNumber(number)) { 24 case 1: 25 case 3: 26 case 4: 27 case 5: 28 case 9: 29 return number + ' bloaz'; 30 default: 31 return number + ' vloaz'; 32 } 33 } 34 function lastNumber(number) { 35 if (number > 9) { 36 return lastNumber(number % 10); 37 } 38 return number; 39 } 40 function mutation(text, number) { 41 if (number === 2) { 42 return softMutation(text); 43 } 44 return text; 45 } 46 function softMutation(text) { 47 var mutationTable = { 48 m: 'v', 49 b: 'v', 50 d: 'z', 51 }; 52 if (mutationTable[text.charAt(0)] === undefined) { 53 return text; 54 } 55 return mutationTable[text.charAt(0)] + text.substring(1); 56 } 57 58 var monthsParse = [ 59 /^gen/i, 60 /^c[ʼ\']hwe/i, 61 /^meu/i, 62 /^ebr/i, 63 /^mae/i, 64 /^(mez|eve)/i, 65 /^gou/i, 66 /^eos/i, 67 /^gwe/i, 68 /^her/i, 69 /^du/i, 70 /^ker/i, 71 ], 72 monthsRegex = 73 /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i, 74 monthsStrictRegex = 75 /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i, 76 monthsShortStrictRegex = 77 /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i, 78 fullWeekdaysParse = [ 79 /^sul/i, 80 /^lun/i, 81 /^meurzh/i, 82 /^merc[ʼ\']her/i, 83 /^yaou/i, 84 /^gwener/i, 85 /^sadorn/i, 86 ], 87 shortWeekdaysParse = [ 88 /^Sul/i, 89 /^Lun/i, 90 /^Meu/i, 91 /^Mer/i, 92 /^Yao/i, 93 /^Gwe/i, 94 /^Sad/i, 95 ], 96 minWeekdaysParse = [ 97 /^Su/i, 98 /^Lu/i, 99 /^Me([^r]|$)/i, 100 /^Mer/i, 101 /^Ya/i, 102 /^Gw/i, 103 /^Sa/i, 104 ]; 105 106 var br = moment.defineLocale('br', { 107 months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split( 108 '_' 109 ), 110 monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), 111 weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'), 112 weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), 113 weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), 114 weekdaysParse: minWeekdaysParse, 115 fullWeekdaysParse: fullWeekdaysParse, 116 shortWeekdaysParse: shortWeekdaysParse, 117 minWeekdaysParse: minWeekdaysParse, 118 119 monthsRegex: monthsRegex, 120 monthsShortRegex: monthsRegex, 121 monthsStrictRegex: monthsStrictRegex, 122 monthsShortStrictRegex: monthsShortStrictRegex, 123 monthsParse: monthsParse, 124 longMonthsParse: monthsParse, 125 shortMonthsParse: monthsParse, 126 127 longDateFormat: { 128 LT: 'HH:mm', 129 LTS: 'HH:mm:ss', 130 L: 'DD/MM/YYYY', 131 LL: 'D [a viz] MMMM YYYY', 132 LLL: 'D [a viz] MMMM YYYY HH:mm', 133 LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm', 134 }, 135 calendar: { 136 sameDay: '[Hiziv da] LT', 137 nextDay: '[Warcʼhoazh da] LT', 138 nextWeek: 'dddd [da] LT', 139 lastDay: '[Decʼh da] LT', 140 lastWeek: 'dddd [paset da] LT', 141 sameElse: 'L', 142 }, 143 relativeTime: { 144 future: 'a-benn %s', 145 past: '%s ʼzo', 146 s: 'un nebeud segondennoù', 147 ss: '%d eilenn', 148 m: 'ur vunutenn', 149 mm: relativeTimeWithMutation, 150 h: 'un eur', 151 hh: '%d eur', 152 d: 'un devezh', 153 dd: relativeTimeWithMutation, 154 M: 'ur miz', 155 MM: relativeTimeWithMutation, 156 y: 'ur bloaz', 157 yy: specialMutationForYears, 158 }, 159 dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/, 160 ordinal: function (number) { 161 var output = number === 1 ? 'añ' : 'vet'; 162 return number + output; 163 }, 164 week: { 165 dow: 1, // Monday is the first day of the week. 166 doy: 4, // The week that contains Jan 4th is the first week of the year. 167 }, 168 meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn 169 isPM: function (token) { 170 return token === 'g.m.'; 171 }, 172 meridiem: function (hour, minute, isLower) { 173 return hour < 12 ? 'a.m.' : 'g.m.'; 174 }, 175 }); 176 177 return br; 178 179})));