index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _index = require("../localize/index.js");
  7. // Source: https://www.unicode.org/cldr/charts/32/summary/hi.html
  8. var formatDistanceLocale = {
  9. lessThanXSeconds: {
  10. one: '१ सेकंड से कम',
  11. // CLDR #1310
  12. other: '{{count}} सेकंड से कम'
  13. },
  14. xSeconds: {
  15. one: '१ सेकंड',
  16. other: '{{count}} सेकंड'
  17. },
  18. halfAMinute: 'आधा मिनट',
  19. lessThanXMinutes: {
  20. one: '१ मिनट से कम',
  21. other: '{{count}} मिनट से कम'
  22. },
  23. xMinutes: {
  24. one: '१ मिनट',
  25. // CLDR #1307
  26. other: '{{count}} मिनट'
  27. },
  28. aboutXHours: {
  29. one: 'लगभग १ घंटा',
  30. other: 'लगभग {{count}} घंटे'
  31. },
  32. xHours: {
  33. one: '१ घंटा',
  34. // CLDR #1304
  35. other: '{{count}} घंटे' // CLDR #4467
  36. },
  37. xDays: {
  38. one: '१ दिन',
  39. // CLDR #1286
  40. other: '{{count}} दिन'
  41. },
  42. aboutXWeeks: {
  43. one: 'लगभग १ सप्ताह',
  44. other: 'लगभग {{count}} सप्ताह'
  45. },
  46. xWeeks: {
  47. one: '१ सप्ताह',
  48. other: '{{count}} सप्ताह'
  49. },
  50. aboutXMonths: {
  51. one: 'लगभग १ महीना',
  52. other: 'लगभग {{count}} महीने'
  53. },
  54. xMonths: {
  55. one: '१ महीना',
  56. other: '{{count}} महीने'
  57. },
  58. aboutXYears: {
  59. one: 'लगभग १ वर्ष',
  60. other: 'लगभग {{count}} वर्ष' // CLDR #4823
  61. },
  62. xYears: {
  63. one: '१ वर्ष',
  64. other: '{{count}} वर्ष'
  65. },
  66. overXYears: {
  67. one: '१ वर्ष से अधिक',
  68. other: '{{count}} वर्ष से अधिक'
  69. },
  70. almostXYears: {
  71. one: 'लगभग १ वर्ष',
  72. other: 'लगभग {{count}} वर्ष'
  73. }
  74. };
  75. var formatDistance = function formatDistance(token, count, options) {
  76. var result;
  77. var tokenValue = formatDistanceLocale[token];
  78. if (typeof tokenValue === 'string') {
  79. result = tokenValue;
  80. } else if (count === 1) {
  81. result = tokenValue.one;
  82. } else {
  83. result = tokenValue.other.replace('{{count}}', (0, _index.numberToLocale)(count));
  84. }
  85. if (options !== null && options !== void 0 && options.addSuffix) {
  86. if (options.comparison && options.comparison > 0) {
  87. return result + 'मे ';
  88. } else {
  89. return result + ' पहले';
  90. }
  91. }
  92. return result;
  93. };
  94. var _default = formatDistance;
  95. exports.default = _default;
  96. module.exports = exports.default;