index.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import buildLocalizeFn from "../../../_lib/buildLocalizeFn/index.js"; // https://www.unicode.org/cldr/charts/32/summary/gu.html
  2. // #1621 - #1630
  3. var eraValues = {
  4. narrow: ['ઈસપૂ', 'ઈસ'],
  5. abbreviated: ['ઈ.સ.પૂર્વે', 'ઈ.સ.'],
  6. wide: ['ઈસવીસન પૂર્વે', 'ઈસવીસન']
  7. };
  8. // https://www.unicode.org/cldr/charts/32/summary/gu.html
  9. // #1631 - #1654
  10. var quarterValues = {
  11. narrow: ['1', '2', '3', '4'],
  12. abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
  13. wide: ['1લો ત્રિમાસ', '2જો ત્રિમાસ', '3જો ત્રિમાસ', '4થો ત્રિમાસ']
  14. };
  15. // Note: in English, the names of days of the week and months are capitalized.
  16. // If you are making a new locale based on this one, check if the same is true for the language you're working on.
  17. // Generally, formatted dates should look like they are in the middle of a sentence,
  18. // e.g. in Spanish language the weekdays and months should be in the lowercase.
  19. // https://www.unicode.org/cldr/charts/32/summary/gu.html
  20. // #1655 - #1726
  21. var monthValues = {
  22. narrow: ['જા', 'ફે', 'મા', 'એ', 'મે', 'જૂ', 'જુ', 'ઓ', 'સ', 'ઓ', 'ન', 'ડિ'],
  23. abbreviated: ['જાન્યુ', 'ફેબ્રુ', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટે', 'ઓક્ટો', 'નવે', 'ડિસે'],
  24. wide: ['જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઇ', 'ઓગસ્ટ', 'સપ્ટેમ્બર', 'ઓક્ટોબર', 'નવેમ્બર', 'ડિસેમ્બર']
  25. };
  26. // https://www.unicode.org/cldr/charts/32/summary/gu.html
  27. // #1727 - #1768
  28. var dayValues = {
  29. narrow: ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
  30. short: ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
  31. abbreviated: ['રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ'],
  32. wide: ['રવિવાર' /* Sunday */, 'સોમવાર' /* Monday */, 'મંગળવાર' /* Tuesday */, 'બુધવાર' /* Wednesday */, 'ગુરુવાર' /* Thursday */, 'શુક્રવાર' /* Friday */, 'શનિવાર' /* Saturday */]
  33. };
  34. // https://www.unicode.org/cldr/charts/32/summary/gu.html
  35. // #1783 - #1824
  36. var dayPeriodValues = {
  37. narrow: {
  38. am: 'AM',
  39. pm: 'PM',
  40. midnight: 'મ.રાત્રિ',
  41. noon: 'બ.',
  42. morning: 'સવારે',
  43. afternoon: 'બપોરે',
  44. evening: 'સાંજે',
  45. night: 'રાત્રે'
  46. },
  47. abbreviated: {
  48. am: 'AM',
  49. pm: 'PM',
  50. midnight: '​મધ્યરાત્રિ',
  51. noon: 'બપોરે',
  52. morning: 'સવારે',
  53. afternoon: 'બપોરે',
  54. evening: 'સાંજે',
  55. night: 'રાત્રે'
  56. },
  57. wide: {
  58. am: 'AM',
  59. pm: 'PM',
  60. midnight: '​મધ્યરાત્રિ',
  61. noon: 'બપોરે',
  62. morning: 'સવારે',
  63. afternoon: 'બપોરે',
  64. evening: 'સાંજે',
  65. night: 'રાત્રે'
  66. }
  67. };
  68. var formattingDayPeriodValues = {
  69. narrow: {
  70. am: 'AM',
  71. pm: 'PM',
  72. midnight: 'મ.રાત્રિ',
  73. noon: 'બપોરે',
  74. morning: 'સવારે',
  75. afternoon: 'બપોરે',
  76. evening: 'સાંજે',
  77. night: 'રાત્રે'
  78. },
  79. abbreviated: {
  80. am: 'AM',
  81. pm: 'PM',
  82. midnight: 'મધ્યરાત્રિ',
  83. noon: 'બપોરે',
  84. morning: 'સવારે',
  85. afternoon: 'બપોરે',
  86. evening: 'સાંજે',
  87. night: 'રાત્રે'
  88. },
  89. wide: {
  90. am: 'AM',
  91. pm: 'PM',
  92. midnight: '​મધ્યરાત્રિ',
  93. noon: 'બપોરે',
  94. morning: 'સવારે',
  95. afternoon: 'બપોરે',
  96. evening: 'સાંજે',
  97. night: 'રાત્રે'
  98. }
  99. };
  100. var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
  101. return String(dirtyNumber);
  102. };
  103. var localize = {
  104. ordinalNumber: ordinalNumber,
  105. era: buildLocalizeFn({
  106. values: eraValues,
  107. defaultWidth: 'wide'
  108. }),
  109. quarter: buildLocalizeFn({
  110. values: quarterValues,
  111. defaultWidth: 'wide',
  112. argumentCallback: function argumentCallback(quarter) {
  113. return quarter - 1;
  114. }
  115. }),
  116. month: buildLocalizeFn({
  117. values: monthValues,
  118. defaultWidth: 'wide'
  119. }),
  120. day: buildLocalizeFn({
  121. values: dayValues,
  122. defaultWidth: 'wide'
  123. }),
  124. dayPeriod: buildLocalizeFn({
  125. values: dayPeriodValues,
  126. defaultWidth: 'wide',
  127. formattingValues: formattingDayPeriodValues,
  128. defaultFormattingWidth: 'wide'
  129. })
  130. };
  131. export default localize;