br.js 5.4 KB

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