[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/resources/lib/moment/locale/ -> pl.js (source)

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


Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1