Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / resources / lib / moment / locale / pl.js
1 // moment.js locale configuration
2 // locale : polish (pl)
3 // author : Rafal Hirsz : https://github.com/evoL
4
5 (function (factory) {
6 // Comment out broken wrapper, see T145382
7 /*if (typeof define === 'function' && define.amd) {
8 define(['moment'], factory); // AMD
9 } else if (typeof exports === 'object') {
10 module.exports = factory(require('../moment')); // Node
11 } else {
12 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
13 }*/
14 factory(this.moment);
15 }(function (moment) {
16 var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'),
17 monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
18
19 function plural(n) {
20 return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
21 }
22
23 function translate(number, withoutSuffix, key) {
24 var result = number + ' ';
25 switch (key) {
26 case 'm':
27 return withoutSuffix ? 'minuta' : 'minutę';
28 case 'mm':
29 return result + (plural(number) ? 'minuty' : 'minut');
30 case 'h':
31 return withoutSuffix ? 'godzina' : 'godzinę';
32 case 'hh':
33 return result + (plural(number) ? 'godziny' : 'godzin');
34 case 'MM':
35 return result + (plural(number) ? 'miesiące' : 'miesięcy');
36 case 'yy':
37 return result + (plural(number) ? 'lata' : 'lat');
38 }
39 }
40
41 return moment.defineLocale('pl', {
42 months : function (momentToFormat, format) {
43 if (/D MMMM/.test(format)) {
44 return monthsSubjective[momentToFormat.month()];
45 } else {
46 return monthsNominative[momentToFormat.month()];
47 }
48 },
49 monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
50 weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
51 weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'),
52 weekdaysMin : 'N_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
53 longDateFormat : {
54 LT : 'HH:mm',
55 LTS : 'LT:ss',
56 L : 'DD.MM.YYYY',
57 LL : 'D MMMM YYYY',
58 LLL : 'D MMMM YYYY LT',
59 LLLL : 'dddd, D MMMM YYYY LT'
60 },
61 calendar : {
62 sameDay: '[Dziś o] LT',
63 nextDay: '[Jutro o] LT',
64 nextWeek: '[W] dddd [o] LT',
65 lastDay: '[Wczoraj o] LT',
66 lastWeek: function () {
67 switch (this.day()) {
68 case 0:
69 return '[W zeszłą niedzielę o] LT';
70 case 3:
71 return '[W zeszłą środę o] LT';
72 case 6:
73 return '[W zeszłą sobotę o] LT';
74 default:
75 return '[W zeszły] dddd [o] LT';
76 }
77 },
78 sameElse: 'L'
79 },
80 relativeTime : {
81 future : 'za %s',
82 past : '%s temu',
83 s : 'kilka sekund',
84 m : translate,
85 mm : translate,
86 h : translate,
87 hh : translate,
88 d : '1 dzień',
89 dd : '%d dni',
90 M : 'miesiąc',
91 MM : translate,
92 y : 'rok',
93 yy : translate
94 },
95 ordinalParse: /\d{1,2}\./,
96 ordinal : '%d.',
97 week : {
98 dow : 1, // Monday is the first day of the week.
99 doy : 4 // The week that contains Jan 4th is the first week of the year.
100 }
101 });
102 }));