angular-locale_sh.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. 'use strict';
  2. angular.module("ngLocale", [], ["$provide", function ($provide) {
  3. var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
  4. function getDecimals(n) {
  5. n = n + '';
  6. var i = n.indexOf('.');
  7. return (i == -1) ? 0 : n.length - i - 1;
  8. }
  9. function getVF(n, opt_precision) {
  10. var v = opt_precision;
  11. if (undefined === v) {
  12. v = Math.min(getDecimals(n), 3);
  13. }
  14. var base = Math.pow(10, v);
  15. var f = ((n * base) | 0) % base;
  16. return {v: v, f: f};
  17. }
  18. $provide.value("$locale", {
  19. "DATETIME_FORMATS": {
  20. "AMPMS": [
  21. "pre podne",
  22. "po podne"
  23. ],
  24. "DAY": [
  25. "nedelja",
  26. "ponedeljak",
  27. "utorak",
  28. "sreda",
  29. "\u010detvrtak",
  30. "petak",
  31. "subota"
  32. ],
  33. "ERANAMES": [
  34. "pre nove ere",
  35. "nove ere"
  36. ],
  37. "ERAS": [
  38. "p. n. e.",
  39. "n. e."
  40. ],
  41. "FIRSTDAYOFWEEK": 0,
  42. "MONTH": [
  43. "januar",
  44. "februar",
  45. "mart",
  46. "april",
  47. "maj",
  48. "jun",
  49. "jul",
  50. "avgust",
  51. "septembar",
  52. "oktobar",
  53. "novembar",
  54. "decembar"
  55. ],
  56. "SHORTDAY": [
  57. "ned",
  58. "pon",
  59. "uto",
  60. "sre",
  61. "\u010det",
  62. "pet",
  63. "sub"
  64. ],
  65. "SHORTMONTH": [
  66. "jan",
  67. "feb",
  68. "mar",
  69. "apr",
  70. "maj",
  71. "jun",
  72. "jul",
  73. "avg",
  74. "sep",
  75. "okt",
  76. "nov",
  77. "dec"
  78. ],
  79. "STANDALONEMONTH": [
  80. "januar",
  81. "februar",
  82. "mart",
  83. "april",
  84. "maj",
  85. "jun",
  86. "jul",
  87. "avgust",
  88. "septembar",
  89. "oktobar",
  90. "novembar",
  91. "decembar"
  92. ],
  93. "WEEKENDRANGE": [
  94. 5,
  95. 6
  96. ],
  97. "fullDate": "EEEE, dd. MMMM y.",
  98. "longDate": "dd. MMMM y.",
  99. "medium": "dd.MM.y. HH:mm:ss",
  100. "mediumDate": "dd.MM.y.",
  101. "mediumTime": "HH:mm:ss",
  102. "short": "d.M.yy. HH:mm",
  103. "shortDate": "d.M.yy.",
  104. "shortTime": "HH:mm"
  105. },
  106. "NUMBER_FORMATS": {
  107. "CURRENCY_SYM": "din",
  108. "DECIMAL_SEP": ",",
  109. "GROUP_SEP": ".",
  110. "PATTERNS": [
  111. {
  112. "gSize": 3,
  113. "lgSize": 3,
  114. "maxFrac": 3,
  115. "minFrac": 0,
  116. "minInt": 1,
  117. "negPre": "-",
  118. "negSuf": "",
  119. "posPre": "",
  120. "posSuf": ""
  121. },
  122. {
  123. "gSize": 3,
  124. "lgSize": 3,
  125. "maxFrac": 2,
  126. "minFrac": 2,
  127. "minInt": 1,
  128. "negPre": "-",
  129. "negSuf": "\u00a0\u00a4",
  130. "posPre": "",
  131. "posSuf": "\u00a0\u00a4"
  132. }
  133. ]
  134. },
  135. "id": "sh",
  136. "localeID": "sh",
  137. "pluralCat": function (n, opt_precision) {
  138. var i = n | 0;
  139. var vf = getVF(n, opt_precision);
  140. if (vf.v == 0 && i % 10 == 1 && i % 100 != 11 || vf.f % 10 == 1 && vf.f % 100 != 11) {
  141. return PLURAL_CATEGORY.ONE;
  142. }
  143. if (vf.v == 0 && i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 12 || i % 100 > 14) || vf.f % 10 >= 2 && vf.f % 10 <= 4 && (vf.f % 100 < 12 || vf.f % 100 > 14)) {
  144. return PLURAL_CATEGORY.FEW;
  145. }
  146. return PLURAL_CATEGORY.OTHER;
  147. }
  148. });
  149. }]);