index.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var formatDistanceLocale = {
  7. lessThanXSeconds: {
  8. one: 'bir saniyeden az',
  9. other: '{{count}} saniyeden az'
  10. },
  11. xSeconds: {
  12. one: '1 saniye',
  13. other: '{{count}} saniye'
  14. },
  15. halfAMinute: 'yarım dakika',
  16. lessThanXMinutes: {
  17. one: 'bir dakikadan az',
  18. other: '{{count}} dakikadan az'
  19. },
  20. xMinutes: {
  21. one: '1 dakika',
  22. other: '{{count}} dakika'
  23. },
  24. aboutXHours: {
  25. one: 'yaklaşık 1 saat',
  26. other: 'yaklaşık {{count}} saat'
  27. },
  28. xHours: {
  29. one: '1 saat',
  30. other: '{{count}} saat'
  31. },
  32. xDays: {
  33. one: '1 gün',
  34. other: '{{count}} gün'
  35. },
  36. aboutXWeeks: {
  37. one: 'yaklaşık 1 hafta',
  38. other: 'yaklaşık {{count}} hafta'
  39. },
  40. xWeeks: {
  41. one: '1 hafta',
  42. other: '{{count}} hafta'
  43. },
  44. aboutXMonths: {
  45. one: 'yaklaşık 1 ay',
  46. other: 'yaklaşık {{count}} ay'
  47. },
  48. xMonths: {
  49. one: '1 ay',
  50. other: '{{count}} ay'
  51. },
  52. aboutXYears: {
  53. one: 'yaklaşık 1 yıl',
  54. other: 'yaklaşık {{count}} yıl'
  55. },
  56. xYears: {
  57. one: '1 yıl',
  58. other: '{{count}} yıl'
  59. },
  60. overXYears: {
  61. one: '1 yıldan fazla',
  62. other: '{{count}} yıldan fazla'
  63. },
  64. almostXYears: {
  65. one: 'neredeyse 1 yıl',
  66. other: 'neredeyse {{count}} yıl'
  67. }
  68. };
  69. var formatDistance = function formatDistance(token, count, options) {
  70. var result;
  71. var tokenValue = formatDistanceLocale[token];
  72. if (typeof tokenValue === 'string') {
  73. result = tokenValue;
  74. } else if (count === 1) {
  75. result = tokenValue.one;
  76. } else {
  77. result = tokenValue.other.replace('{{count}}', count.toString());
  78. }
  79. if (options !== null && options !== void 0 && options.addSuffix) {
  80. if (options.comparison && options.comparison > 0) {
  81. return result + ' sonra';
  82. } else {
  83. return result + ' önce';
  84. }
  85. }
  86. return result;
  87. };
  88. var _default = formatDistance;
  89. exports.default = _default;
  90. module.exports = exports.default;