localize.cjs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. "use strict";
  2. exports.localize = void 0;
  3. var _index = require("../../_lib/buildLocalizeFn.cjs");
  4. const eraValues = {
  5. narrow: ["aC", "dC"],
  6. abbreviated: ["a.C.", "d.C."],
  7. wide: ["avanti Cristo", "dopo Cristo"],
  8. };
  9. const quarterValues = {
  10. narrow: ["1", "2", "3", "4"],
  11. abbreviated: ["T1", "T2", "T3", "T4"],
  12. wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"],
  13. };
  14. const monthValues = {
  15. narrow: ["G", "F", "M", "A", "M", "G", "L", "A", "S", "O", "N", "D"],
  16. abbreviated: [
  17. "gen",
  18. "feb",
  19. "mar",
  20. "apr",
  21. "mag",
  22. "giu",
  23. "lug",
  24. "ago",
  25. "set",
  26. "ott",
  27. "nov",
  28. "dic",
  29. ],
  30. wide: [
  31. "gennaio",
  32. "febbraio",
  33. "marzo",
  34. "aprile",
  35. "maggio",
  36. "giugno",
  37. "luglio",
  38. "agosto",
  39. "settembre",
  40. "ottobre",
  41. "novembre",
  42. "dicembre",
  43. ],
  44. };
  45. const dayValues = {
  46. narrow: ["D", "L", "M", "M", "G", "V", "S"],
  47. short: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
  48. abbreviated: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
  49. wide: [
  50. "domenica",
  51. "lunedì",
  52. "martedì",
  53. "mercoledì",
  54. "giovedì",
  55. "venerdì",
  56. "sabato",
  57. ],
  58. };
  59. const dayPeriodValues = {
  60. narrow: {
  61. am: "m.",
  62. pm: "p.",
  63. midnight: "mezzanotte",
  64. noon: "mezzogiorno",
  65. morning: "mattina",
  66. afternoon: "pomeriggio",
  67. evening: "sera",
  68. night: "notte",
  69. },
  70. abbreviated: {
  71. am: "AM",
  72. pm: "PM",
  73. midnight: "mezzanotte",
  74. noon: "mezzogiorno",
  75. morning: "mattina",
  76. afternoon: "pomeriggio",
  77. evening: "sera",
  78. night: "notte",
  79. },
  80. wide: {
  81. am: "AM",
  82. pm: "PM",
  83. midnight: "mezzanotte",
  84. noon: "mezzogiorno",
  85. morning: "mattina",
  86. afternoon: "pomeriggio",
  87. evening: "sera",
  88. night: "notte",
  89. },
  90. };
  91. const formattingDayPeriodValues = {
  92. narrow: {
  93. am: "m.",
  94. pm: "p.",
  95. midnight: "mezzanotte",
  96. noon: "mezzogiorno",
  97. morning: "di mattina",
  98. afternoon: "del pomeriggio",
  99. evening: "di sera",
  100. night: "di notte",
  101. },
  102. abbreviated: {
  103. am: "AM",
  104. pm: "PM",
  105. midnight: "mezzanotte",
  106. noon: "mezzogiorno",
  107. morning: "di mattina",
  108. afternoon: "del pomeriggio",
  109. evening: "di sera",
  110. night: "di notte",
  111. },
  112. wide: {
  113. am: "AM",
  114. pm: "PM",
  115. midnight: "mezzanotte",
  116. noon: "mezzogiorno",
  117. morning: "di mattina",
  118. afternoon: "del pomeriggio",
  119. evening: "di sera",
  120. night: "di notte",
  121. },
  122. };
  123. const ordinalNumber = (dirtyNumber, _options) => {
  124. const number = Number(dirtyNumber);
  125. return String(number);
  126. };
  127. const localize = (exports.localize = {
  128. ordinalNumber,
  129. era: (0, _index.buildLocalizeFn)({
  130. values: eraValues,
  131. defaultWidth: "wide",
  132. }),
  133. quarter: (0, _index.buildLocalizeFn)({
  134. values: quarterValues,
  135. defaultWidth: "wide",
  136. argumentCallback: (quarter) => quarter - 1,
  137. }),
  138. month: (0, _index.buildLocalizeFn)({
  139. values: monthValues,
  140. defaultWidth: "wide",
  141. }),
  142. day: (0, _index.buildLocalizeFn)({
  143. values: dayValues,
  144. defaultWidth: "wide",
  145. }),
  146. dayPeriod: (0, _index.buildLocalizeFn)({
  147. values: dayPeriodValues,
  148. defaultWidth: "wide",
  149. formattingValues: formattingDayPeriodValues,
  150. defaultFormattingWidth: "wide",
  151. }),
  152. });