localize.cjs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. "use strict";
  2. exports.localize = void 0;
  3. var _index = require("../../_lib/buildLocalizeFn.cjs");
  4. // https://www.unicode.org/cldr/charts/32/summary/sk.html#1772
  5. const eraValues = {
  6. narrow: ["pred Kr.", "po Kr."],
  7. abbreviated: ["pred Kr.", "po Kr."],
  8. wide: ["pred Kristom", "po Kristovi"],
  9. };
  10. // https://www.unicode.org/cldr/charts/32/summary/sk.html#1780
  11. const quarterValues = {
  12. narrow: ["1", "2", "3", "4"],
  13. abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  14. wide: ["1. štvrťrok", "2. štvrťrok", "3. štvrťrok", "4. štvrťrok"],
  15. };
  16. // https://www.unicode.org/cldr/charts/32/summary/sk.html#1804
  17. const monthValues = {
  18. narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
  19. abbreviated: [
  20. "jan",
  21. "feb",
  22. "mar",
  23. "apr",
  24. "máj",
  25. "jún",
  26. "júl",
  27. "aug",
  28. "sep",
  29. "okt",
  30. "nov",
  31. "dec",
  32. ],
  33. wide: [
  34. "január",
  35. "február",
  36. "marec",
  37. "apríl",
  38. "máj",
  39. "jún",
  40. "júl",
  41. "august",
  42. "september",
  43. "október",
  44. "november",
  45. "december",
  46. ],
  47. };
  48. const formattingMonthValues = {
  49. narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
  50. abbreviated: [
  51. "jan",
  52. "feb",
  53. "mar",
  54. "apr",
  55. "máj",
  56. "jún",
  57. "júl",
  58. "aug",
  59. "sep",
  60. "okt",
  61. "nov",
  62. "dec",
  63. ],
  64. wide: [
  65. "januára",
  66. "februára",
  67. "marca",
  68. "apríla",
  69. "mája",
  70. "júna",
  71. "júla",
  72. "augusta",
  73. "septembra",
  74. "októbra",
  75. "novembra",
  76. "decembra",
  77. ],
  78. };
  79. // https://www.unicode.org/cldr/charts/32/summary/sk.html#1876
  80. const dayValues = {
  81. narrow: ["n", "p", "u", "s", "š", "p", "s"],
  82. short: ["ne", "po", "ut", "st", "št", "pi", "so"],
  83. abbreviated: ["ne", "po", "ut", "st", "št", "pi", "so"],
  84. wide: [
  85. "nedeľa",
  86. "pondelok",
  87. "utorok",
  88. "streda",
  89. "štvrtok",
  90. "piatok",
  91. "sobota",
  92. ],
  93. };
  94. // https://www.unicode.org/cldr/charts/32/summary/sk.html#1932
  95. const dayPeriodValues = {
  96. narrow: {
  97. am: "AM",
  98. pm: "PM",
  99. midnight: "poln.",
  100. noon: "pol.",
  101. morning: "ráno",
  102. afternoon: "pop.",
  103. evening: "več.",
  104. night: "noc",
  105. },
  106. abbreviated: {
  107. am: "AM",
  108. pm: "PM",
  109. midnight: "poln.",
  110. noon: "pol.",
  111. morning: "ráno",
  112. afternoon: "popol.",
  113. evening: "večer",
  114. night: "noc",
  115. },
  116. wide: {
  117. am: "AM",
  118. pm: "PM",
  119. midnight: "polnoc",
  120. noon: "poludnie",
  121. morning: "ráno",
  122. afternoon: "popoludnie",
  123. evening: "večer",
  124. night: "noc",
  125. },
  126. };
  127. const formattingDayPeriodValues = {
  128. narrow: {
  129. am: "AM",
  130. pm: "PM",
  131. midnight: "o poln.",
  132. noon: "nap.",
  133. morning: "ráno",
  134. afternoon: "pop.",
  135. evening: "več.",
  136. night: "v n.",
  137. },
  138. abbreviated: {
  139. am: "AM",
  140. pm: "PM",
  141. midnight: "o poln.",
  142. noon: "napol.",
  143. morning: "ráno",
  144. afternoon: "popol.",
  145. evening: "večer",
  146. night: "v noci",
  147. },
  148. wide: {
  149. am: "AM",
  150. pm: "PM",
  151. midnight: "o polnoci",
  152. noon: "napoludnie",
  153. morning: "ráno",
  154. afternoon: "popoludní",
  155. evening: "večer",
  156. night: "v noci",
  157. },
  158. };
  159. const ordinalNumber = (dirtyNumber, _options) => {
  160. const number = Number(dirtyNumber);
  161. return number + ".";
  162. };
  163. const localize = (exports.localize = {
  164. ordinalNumber,
  165. era: (0, _index.buildLocalizeFn)({
  166. values: eraValues,
  167. defaultWidth: "wide",
  168. }),
  169. quarter: (0, _index.buildLocalizeFn)({
  170. values: quarterValues,
  171. defaultWidth: "wide",
  172. argumentCallback: (quarter) => quarter - 1,
  173. }),
  174. month: (0, _index.buildLocalizeFn)({
  175. values: monthValues,
  176. defaultWidth: "wide",
  177. formattingValues: formattingMonthValues,
  178. defaultFormattingWidth: "wide",
  179. }),
  180. day: (0, _index.buildLocalizeFn)({
  181. values: dayValues,
  182. defaultWidth: "wide",
  183. }),
  184. dayPeriod: (0, _index.buildLocalizeFn)({
  185. values: dayPeriodValues,
  186. defaultWidth: "wide",
  187. formattingValues: formattingDayPeriodValues,
  188. defaultFormattingWidth: "wide",
  189. }),
  190. });