sl.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // moment.js language configuration
  2. // language : slovenian (sl)
  3. // author : Robert Sedovšek : https://github.com/sedovsek
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. define(['moment'], factory); // AMD
  7. } else if (typeof exports === 'object') {
  8. module.exports = factory(require('../moment')); // Node
  9. } else {
  10. factory(window.moment); // Browser global
  11. }
  12. }(function (moment) {
  13. function translate(number, withoutSuffix, key) {
  14. var result = number + " ";
  15. switch (key) {
  16. case 'm':
  17. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  18. case 'mm':
  19. if (number === 1) {
  20. result += 'minuta';
  21. } else if (number === 2) {
  22. result += 'minuti';
  23. } else if (number === 3 || number === 4) {
  24. result += 'minute';
  25. } else {
  26. result += 'minut';
  27. }
  28. return result;
  29. case 'h':
  30. return withoutSuffix ? 'ena ura' : 'eno uro';
  31. case 'hh':
  32. if (number === 1) {
  33. result += 'ura';
  34. } else if (number === 2) {
  35. result += 'uri';
  36. } else if (number === 3 || number === 4) {
  37. result += 'ure';
  38. } else {
  39. result += 'ur';
  40. }
  41. return result;
  42. case 'dd':
  43. if (number === 1) {
  44. result += 'dan';
  45. } else {
  46. result += 'dni';
  47. }
  48. return result;
  49. case 'MM':
  50. if (number === 1) {
  51. result += 'mesec';
  52. } else if (number === 2) {
  53. result += 'meseca';
  54. } else if (number === 3 || number === 4) {
  55. result += 'mesece';
  56. } else {
  57. result += 'mesecev';
  58. }
  59. return result;
  60. case 'yy':
  61. if (number === 1) {
  62. result += 'leto';
  63. } else if (number === 2) {
  64. result += 'leti';
  65. } else if (number === 3 || number === 4) {
  66. result += 'leta';
  67. } else {
  68. result += 'let';
  69. }
  70. return result;
  71. }
  72. }
  73. return moment.lang('sl', {
  74. months : "januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),
  75. monthsShort : "jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),
  76. weekdays : "nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),
  77. weekdaysShort : "ned._pon._tor._sre._čet._pet._sob.".split("_"),
  78. weekdaysMin : "ne_po_to_sr_če_pe_so".split("_"),
  79. longDateFormat : {
  80. LT : "H:mm",
  81. L : "DD. MM. YYYY",
  82. LL : "D. MMMM YYYY",
  83. LLL : "D. MMMM YYYY LT",
  84. LLLL : "dddd, D. MMMM YYYY LT"
  85. },
  86. calendar : {
  87. sameDay : '[danes ob] LT',
  88. nextDay : '[jutri ob] LT',
  89. nextWeek : function () {
  90. switch (this.day()) {
  91. case 0:
  92. return '[v] [nedeljo] [ob] LT';
  93. case 3:
  94. return '[v] [sredo] [ob] LT';
  95. case 6:
  96. return '[v] [soboto] [ob] LT';
  97. case 1:
  98. case 2:
  99. case 4:
  100. case 5:
  101. return '[v] dddd [ob] LT';
  102. }
  103. },
  104. lastDay : '[včeraj ob] LT',
  105. lastWeek : function () {
  106. switch (this.day()) {
  107. case 0:
  108. case 3:
  109. case 6:
  110. return '[prejšnja] dddd [ob] LT';
  111. case 1:
  112. case 2:
  113. case 4:
  114. case 5:
  115. return '[prejšnji] dddd [ob] LT';
  116. }
  117. },
  118. sameElse : 'L'
  119. },
  120. relativeTime : {
  121. future : "čez %s",
  122. past : "%s nazaj",
  123. s : "nekaj sekund",
  124. m : translate,
  125. mm : translate,
  126. h : translate,
  127. hh : translate,
  128. d : "en dan",
  129. dd : translate,
  130. M : "en mesec",
  131. MM : translate,
  132. y : "eno leto",
  133. yy : translate
  134. },
  135. ordinal : '%d.',
  136. week : {
  137. dow : 1, // Monday is the first day of the week.
  138. doy : 7 // The week that contains Jan 1st is the first week of the year.
  139. }
  140. });
  141. }));