[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/js/vendor/moment-js/locale/ -> lb.js (source)

   1  //! moment.js locale configuration
   2  //! locale : Luxembourgish [lb]
   3  //! author : mweimerskirch : https://github.com/mweimerskirch
   4  //! author : David Raison : https://github.com/kwisatz
   5  
   6  ;(function (global, factory) {
   7     typeof exports === 'object' && typeof module !== 'undefined'
   8         && typeof require === 'function' ? factory(require('../moment')) :
   9     typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  10     factory(global.moment)
  11  }(this, function (moment) { 'use strict';
  12  
  13  
  14      function processRelativeTime(number, withoutSuffix, key, isFuture) {
  15          var format = {
  16              'm': ['eng Minutt', 'enger Minutt'],
  17              'h': ['eng Stonn', 'enger Stonn'],
  18              'd': ['een Dag', 'engem Dag'],
  19              'M': ['ee Mount', 'engem Mount'],
  20              'y': ['ee Joer', 'engem Joer']
  21          };
  22          return withoutSuffix ? format[key][0] : format[key][1];
  23      }
  24      function processFutureTime(string) {
  25          var number = string.substr(0, string.indexOf(' '));
  26          if (eifelerRegelAppliesToNumber(number)) {
  27              return 'a ' + string;
  28          }
  29          return 'an ' + string;
  30      }
  31      function processPastTime(string) {
  32          var number = string.substr(0, string.indexOf(' '));
  33          if (eifelerRegelAppliesToNumber(number)) {
  34              return 'viru ' + string;
  35          }
  36          return 'virun ' + string;
  37      }
  38      /**
  39       * Returns true if the word before the given number loses the '-n' ending.
  40       * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  41       *
  42       * @param number {integer}
  43       * @returns {boolean}
  44       */
  45      function eifelerRegelAppliesToNumber(number) {
  46          number = parseInt(number, 10);
  47          if (isNaN(number)) {
  48              return false;
  49          }
  50          if (number < 0) {
  51              // Negative Number --> always true
  52              return true;
  53          } else if (number < 10) {
  54              // Only 1 digit
  55              if (4 <= number && number <= 7) {
  56                  return true;
  57              }
  58              return false;
  59          } else if (number < 100) {
  60              // 2 digits
  61              var lastDigit = number % 10, firstDigit = number / 10;
  62              if (lastDigit === 0) {
  63                  return eifelerRegelAppliesToNumber(firstDigit);
  64              }
  65              return eifelerRegelAppliesToNumber(lastDigit);
  66          } else if (number < 10000) {
  67              // 3 or 4 digits --> recursively check first digit
  68              while (number >= 10) {
  69                  number = number / 10;
  70              }
  71              return eifelerRegelAppliesToNumber(number);
  72          } else {
  73              // Anything larger than 4 digits: recursively check first n-3 digits
  74              number = number / 1000;
  75              return eifelerRegelAppliesToNumber(number);
  76          }
  77      }
  78  
  79      var lb = moment.defineLocale('lb', {
  80          months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  81          monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
  82          monthsParseExact : true,
  83          weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'),
  84          weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  85          weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  86          weekdaysParseExact : true,
  87          longDateFormat: {
  88              LT: 'H:mm [Auer]',
  89              LTS: 'H:mm:ss [Auer]',
  90              L: 'DD.MM.YYYY',
  91              LL: 'D. MMMM YYYY',
  92              LLL: 'D. MMMM YYYY H:mm [Auer]',
  93              LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
  94          },
  95          calendar: {
  96              sameDay: '[Haut um] LT',
  97              sameElse: 'L',
  98              nextDay: '[Muer um] LT',
  99              nextWeek: 'dddd [um] LT',
 100              lastDay: '[Gëschter um] LT',
 101              lastWeek: function () {
 102                  // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
 103                  switch (this.day()) {
 104                      case 2:
 105                      case 4:
 106                          return '[Leschten] dddd [um] LT';
 107                      default:
 108                          return '[Leschte] dddd [um] LT';
 109                  }
 110              }
 111          },
 112          relativeTime : {
 113              future : processFutureTime,
 114              past : processPastTime,
 115              s : 'e puer Sekonnen',
 116              m : processRelativeTime,
 117              mm : '%d Minutten',
 118              h : processRelativeTime,
 119              hh : '%d Stonnen',
 120              d : processRelativeTime,
 121              dd : '%d Deeg',
 122              M : processRelativeTime,
 123              MM : '%d Méint',
 124              y : processRelativeTime,
 125              yy : '%d Joer'
 126          },
 127          ordinalParse: /\d{1,2}\./,
 128          ordinal: '%d.',
 129          week: {
 130              dow: 1, // Monday is the first day of the week.
 131              doy: 4  // The week that contains Jan 4th is the first week of the year.
 132          }
 133      });
 134  
 135      return lb;
 136  
 137  }));


Generated: Wed Aug 12 01:01:32 2020 Cross-referenced by PHPXref 0.7.1