corrade-nucleus-nucleons – Blame information for rev 38
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
38 | office | 1 | //! moment.js locale configuration |
2 | //! locale : Breton [br] |
||
3 | //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou |
||
4 | |||
5 | import moment from '../moment'; |
||
6 | |||
7 | function relativeTimeWithMutation(number, withoutSuffix, key) { |
||
8 | var format = { |
||
9 | 'mm': 'munutenn', |
||
10 | 'MM': 'miz', |
||
11 | 'dd': 'devezh' |
||
12 | }; |
||
13 | return number + ' ' + mutation(format[key], number); |
||
14 | } |
||
15 | function specialMutationForYears(number) { |
||
16 | switch (lastNumber(number)) { |
||
17 | case 1: |
||
18 | case 3: |
||
19 | case 4: |
||
20 | case 5: |
||
21 | case 9: |
||
22 | return number + ' bloaz'; |
||
23 | default: |
||
24 | return number + ' vloaz'; |
||
25 | } |
||
26 | } |
||
27 | function lastNumber(number) { |
||
28 | if (number > 9) { |
||
29 | return lastNumber(number % 10); |
||
30 | } |
||
31 | return number; |
||
32 | } |
||
33 | function mutation(text, number) { |
||
34 | if (number === 2) { |
||
35 | return softMutation(text); |
||
36 | } |
||
37 | return text; |
||
38 | } |
||
39 | function softMutation(text) { |
||
40 | var mutationTable = { |
||
41 | 'm': 'v', |
||
42 | 'b': 'v', |
||
43 | 'd': 'z' |
||
44 | }; |
||
45 | if (mutationTable[text.charAt(0)] === undefined) { |
||
46 | return text; |
||
47 | } |
||
48 | return mutationTable[text.charAt(0)] + text.substring(1); |
||
49 | } |
||
50 | |||
51 | export default moment.defineLocale('br', { |
||
52 | months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), |
||
53 | monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), |
||
54 | weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'), |
||
55 | weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), |
||
56 | weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), |
||
57 | weekdaysParseExact : true, |
||
58 | longDateFormat : { |
||
59 | LT : 'h[e]mm A', |
||
60 | LTS : 'h[e]mm:ss A', |
||
61 | L : 'DD/MM/YYYY', |
||
62 | LL : 'D [a viz] MMMM YYYY', |
||
63 | LLL : 'D [a viz] MMMM YYYY h[e]mm A', |
||
64 | LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A' |
||
65 | }, |
||
66 | calendar : { |
||
67 | sameDay : '[Hiziv da] LT', |
||
68 | nextDay : '[Warc\'hoazh da] LT', |
||
69 | nextWeek : 'dddd [da] LT', |
||
70 | lastDay : '[Dec\'h da] LT', |
||
71 | lastWeek : 'dddd [paset da] LT', |
||
72 | sameElse : 'L' |
||
73 | }, |
||
74 | relativeTime : { |
||
75 | future : 'a-benn %s', |
||
76 | past : '%s \'zo', |
||
77 | s : 'un nebeud segondennoù', |
||
78 | m : 'ur vunutenn', |
||
79 | mm : relativeTimeWithMutation, |
||
80 | h : 'un eur', |
||
81 | hh : '%d eur', |
||
82 | d : 'un devezh', |
||
83 | dd : relativeTimeWithMutation, |
||
84 | M : 'ur miz', |
||
85 | MM : relativeTimeWithMutation, |
||
86 | y : 'ur bloaz', |
||
87 | yy : specialMutationForYears |
||
88 | }, |
||
89 | dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/, |
||
90 | ordinal : function (number) { |
||
91 | var output = (number === 1) ? 'añ' : 'vet'; |
||
92 | return number + output; |
||
93 | }, |
||
94 | week : { |
||
95 | dow : 1, // Monday is the first day of the week. |
||
96 | doy : 4 // The week that contains Jan 4th is the first week of the year. |
||
97 | } |
||
98 | }); |
||
99 |