Merge "Special:ChangeContentModel: Run EditFilterMergedContent hook"
[lhc/web/wiklou.git] / resources / lib / moment / locale / be.js
1 // moment.js locale configuration
2 // locale : belarusian (be)
3 // author : Dmitry Demidov : https://github.com/demidov91
4 // author: Praleska: http://praleska.pro/
5 // Author : Menelion Elensúle : https://github.com/Oire
6
7 (function (factory) {
8 // Comment out broken wrapper, see T145382
9 /*if (typeof define === 'function' && define.amd) {
10 define(['moment'], factory); // AMD
11 } else if (typeof exports === 'object') {
12 module.exports = factory(require('../moment')); // Node
13 } else {
14 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
15 }*/
16 factory(this.moment);
17 }(function (moment) {
18 function plural(word, num) {
19 var forms = word.split('_');
20 return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
21 }
22
23 function relativeTimeWithPlural(number, withoutSuffix, key) {
24 var format = {
25 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
26 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
27 'dd': 'дзень_дні_дзён',
28 'MM': 'месяц_месяцы_месяцаў',
29 'yy': 'год_гады_гадоў'
30 };
31 if (key === 'm') {
32 return withoutSuffix ? 'хвіліна' : 'хвіліну';
33 }
34 else if (key === 'h') {
35 return withoutSuffix ? 'гадзіна' : 'гадзіну';
36 }
37 else {
38 return number + ' ' + plural(format[key], +number);
39 }
40 }
41
42 function monthsCaseReplace(m, format) {
43 var months = {
44 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'),
45 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_')
46 },
47
48 nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ?
49 'accusative' :
50 'nominative';
51
52 return months[nounCase][m.month()];
53 }
54
55 function weekdaysCaseReplace(m, format) {
56 var weekdays = {
57 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'),
58 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_')
59 },
60
61 nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ?
62 'accusative' :
63 'nominative';
64
65 return weekdays[nounCase][m.day()];
66 }
67
68 return moment.defineLocale('be', {
69 months : monthsCaseReplace,
70 monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
71 weekdays : weekdaysCaseReplace,
72 weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
73 weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
74 longDateFormat : {
75 LT : 'HH:mm',
76 LTS : 'LT:ss',
77 L : 'DD.MM.YYYY',
78 LL : 'D MMMM YYYY г.',
79 LLL : 'D MMMM YYYY г., LT',
80 LLLL : 'dddd, D MMMM YYYY г., LT'
81 },
82 calendar : {
83 sameDay: '[Сёння ў] LT',
84 nextDay: '[Заўтра ў] LT',
85 lastDay: '[Учора ў] LT',
86 nextWeek: function () {
87 return '[У] dddd [ў] LT';
88 },
89 lastWeek: function () {
90 switch (this.day()) {
91 case 0:
92 case 3:
93 case 5:
94 case 6:
95 return '[У мінулую] dddd [ў] LT';
96 case 1:
97 case 2:
98 case 4:
99 return '[У мінулы] dddd [ў] LT';
100 }
101 },
102 sameElse: 'L'
103 },
104 relativeTime : {
105 future : 'праз %s',
106 past : '%s таму',
107 s : 'некалькі секунд',
108 m : relativeTimeWithPlural,
109 mm : relativeTimeWithPlural,
110 h : relativeTimeWithPlural,
111 hh : relativeTimeWithPlural,
112 d : 'дзень',
113 dd : relativeTimeWithPlural,
114 M : 'месяц',
115 MM : relativeTimeWithPlural,
116 y : 'год',
117 yy : relativeTimeWithPlural
118 },
119
120
121 meridiem : function (hour, minute, isLower) {
122 if (hour < 4) {
123 return 'ночы';
124 } else if (hour < 12) {
125 return 'раніцы';
126 } else if (hour < 17) {
127 return 'дня';
128 } else {
129 return 'вечара';
130 }
131 },
132
133 ordinalParse: /\d{1,2}-(і|ы|га)/,
134 ordinal: function (number, period) {
135 switch (period) {
136 case 'M':
137 case 'd':
138 case 'DDD':
139 case 'w':
140 case 'W':
141 return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
142 case 'D':
143 return number + '-га';
144 default:
145 return number;
146 }
147 },
148
149 week : {
150 dow : 1, // Monday is the first day of the week.
151 doy : 7 // The week that contains Jan 1st is the first week of the year.
152 }
153 });
154 }));