angular-locale_is.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. function getWT(v, f) {
  19. if (f === 0) {
  20. return {w: 0, t: 0};
  21. }
  22. while ((f % 10) === 0) {
  23. f /= 10;
  24. v--;
  25. }
  26. return {w: v, t: f};
  27. }
  28. $provide.value("$locale", {
  29. "DATETIME_FORMATS": {
  30. "AMPMS": [
  31. "f.h.",
  32. "e.h."
  33. ],
  34. "DAY": [
  35. "sunnudagur",
  36. "m\u00e1nudagur",
  37. "\u00feri\u00f0judagur",
  38. "mi\u00f0vikudagur",
  39. "fimmtudagur",
  40. "f\u00f6studagur",
  41. "laugardagur"
  42. ],
  43. "ERANAMES": [
  44. "fyrir Krist",
  45. "eftir Krist"
  46. ],
  47. "ERAS": [
  48. "f.Kr.",
  49. "e.Kr."
  50. ],
  51. "FIRSTDAYOFWEEK": 0,
  52. "MONTH": [
  53. "jan\u00faar",
  54. "febr\u00faar",
  55. "mars",
  56. "apr\u00edl",
  57. "ma\u00ed",
  58. "j\u00fan\u00ed",
  59. "j\u00fal\u00ed",
  60. "\u00e1g\u00fast",
  61. "september",
  62. "okt\u00f3ber",
  63. "n\u00f3vember",
  64. "desember"
  65. ],
  66. "SHORTDAY": [
  67. "sun.",
  68. "m\u00e1n.",
  69. "\u00feri.",
  70. "mi\u00f0.",
  71. "fim.",
  72. "f\u00f6s.",
  73. "lau."
  74. ],
  75. "SHORTMONTH": [
  76. "jan.",
  77. "feb.",
  78. "mar.",
  79. "apr.",
  80. "ma\u00ed",
  81. "j\u00fan.",
  82. "j\u00fal.",
  83. "\u00e1g\u00fa.",
  84. "sep.",
  85. "okt.",
  86. "n\u00f3v.",
  87. "des."
  88. ],
  89. "STANDALONEMONTH": [
  90. "jan\u00faar",
  91. "febr\u00faar",
  92. "mars",
  93. "apr\u00edl",
  94. "ma\u00ed",
  95. "j\u00fan\u00ed",
  96. "j\u00fal\u00ed",
  97. "\u00e1g\u00fast",
  98. "september",
  99. "okt\u00f3ber",
  100. "n\u00f3vember",
  101. "desember"
  102. ],
  103. "WEEKENDRANGE": [
  104. 5,
  105. 6
  106. ],
  107. "fullDate": "EEEE, d. MMMM y",
  108. "longDate": "d. MMMM y",
  109. "medium": "d. MMM y HH:mm:ss",
  110. "mediumDate": "d. MMM y",
  111. "mediumTime": "HH:mm:ss",
  112. "short": "d.M.y HH:mm",
  113. "shortDate": "d.M.y",
  114. "shortTime": "HH:mm"
  115. },
  116. "NUMBER_FORMATS": {
  117. "CURRENCY_SYM": "kr",
  118. "DECIMAL_SEP": ",",
  119. "GROUP_SEP": ".",
  120. "PATTERNS": [
  121. {
  122. "gSize": 3,
  123. "lgSize": 3,
  124. "maxFrac": 3,
  125. "minFrac": 0,
  126. "minInt": 1,
  127. "negPre": "-",
  128. "negSuf": "",
  129. "posPre": "",
  130. "posSuf": ""
  131. },
  132. {
  133. "gSize": 3,
  134. "lgSize": 3,
  135. "maxFrac": 2,
  136. "minFrac": 2,
  137. "minInt": 1,
  138. "negPre": "-",
  139. "negSuf": "\u00a0\u00a4",
  140. "posPre": "",
  141. "posSuf": "\u00a0\u00a4"
  142. }
  143. ]
  144. },
  145. "id": "is",
  146. "localeID": "is",
  147. "pluralCat": function (n, opt_precision) {
  148. var i = n | 0;
  149. var vf = getVF(n, opt_precision);
  150. var wt = getWT(vf.v, vf.f);
  151. if (wt.t == 0 && i % 10 == 1 && i % 100 != 11 || wt.t != 0) {
  152. return PLURAL_CATEGORY.ONE;
  153. }
  154. return PLURAL_CATEGORY.OTHER;
  155. }
  156. });
  157. }]);