You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.8 KiB

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