123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = void 0;
- function isPluralType(val) {
- return val.one !== undefined;
- }
- var formatDistanceLocale = {
- lessThanXSeconds: {
- present: {
- one: 'manj kot {{count}} sekunda',
- two: 'manj kot {{count}} sekundi',
- few: 'manj kot {{count}} sekunde',
- other: 'manj kot {{count}} sekund'
- },
- past: {
- one: 'manj kot {{count}} sekundo',
- two: 'manj kot {{count}} sekundama',
- few: 'manj kot {{count}} sekundami',
- other: 'manj kot {{count}} sekundami'
- },
- future: {
- one: 'manj kot {{count}} sekundo',
- two: 'manj kot {{count}} sekundi',
- few: 'manj kot {{count}} sekunde',
- other: 'manj kot {{count}} sekund'
- }
- },
- xSeconds: {
- present: {
- one: '{{count}} sekunda',
- two: '{{count}} sekundi',
- few: '{{count}} sekunde',
- other: '{{count}} sekund'
- },
- past: {
- one: '{{count}} sekundo',
- two: '{{count}} sekundama',
- few: '{{count}} sekundami',
- other: '{{count}} sekundami'
- },
- future: {
- one: '{{count}} sekundo',
- two: '{{count}} sekundi',
- few: '{{count}} sekunde',
- other: '{{count}} sekund'
- }
- },
- halfAMinute: 'pol minute',
- lessThanXMinutes: {
- present: {
- one: 'manj kot {{count}} minuta',
- two: 'manj kot {{count}} minuti',
- few: 'manj kot {{count}} minute',
- other: 'manj kot {{count}} minut'
- },
- past: {
- one: 'manj kot {{count}} minuto',
- two: 'manj kot {{count}} minutama',
- few: 'manj kot {{count}} minutami',
- other: 'manj kot {{count}} minutami'
- },
- future: {
- one: 'manj kot {{count}} minuto',
- two: 'manj kot {{count}} minuti',
- few: 'manj kot {{count}} minute',
- other: 'manj kot {{count}} minut'
- }
- },
- xMinutes: {
- present: {
- one: '{{count}} minuta',
- two: '{{count}} minuti',
- few: '{{count}} minute',
- other: '{{count}} minut'
- },
- past: {
- one: '{{count}} minuto',
- two: '{{count}} minutama',
- few: '{{count}} minutami',
- other: '{{count}} minutami'
- },
- future: {
- one: '{{count}} minuto',
- two: '{{count}} minuti',
- few: '{{count}} minute',
- other: '{{count}} minut'
- }
- },
- aboutXHours: {
- present: {
- one: 'približno {{count}} ura',
- two: 'približno {{count}} uri',
- few: 'približno {{count}} ure',
- other: 'približno {{count}} ur'
- },
- past: {
- one: 'približno {{count}} uro',
- two: 'približno {{count}} urama',
- few: 'približno {{count}} urami',
- other: 'približno {{count}} urami'
- },
- future: {
- one: 'približno {{count}} uro',
- two: 'približno {{count}} uri',
- few: 'približno {{count}} ure',
- other: 'približno {{count}} ur'
- }
- },
- xHours: {
- present: {
- one: '{{count}} ura',
- two: '{{count}} uri',
- few: '{{count}} ure',
- other: '{{count}} ur'
- },
- past: {
- one: '{{count}} uro',
- two: '{{count}} urama',
- few: '{{count}} urami',
- other: '{{count}} urami'
- },
- future: {
- one: '{{count}} uro',
- two: '{{count}} uri',
- few: '{{count}} ure',
- other: '{{count}} ur'
- }
- },
- xDays: {
- present: {
- one: '{{count}} dan',
- two: '{{count}} dni',
- few: '{{count}} dni',
- other: '{{count}} dni'
- },
- past: {
- one: '{{count}} dnem',
- two: '{{count}} dnevoma',
- few: '{{count}} dnevi',
- other: '{{count}} dnevi'
- },
- future: {
- one: '{{count}} dan',
- two: '{{count}} dni',
- few: '{{count}} dni',
- other: '{{count}} dni'
- }
- },
- // no tenses for weeks?
- aboutXWeeks: {
- one: 'približno {{count}} teden',
- two: 'približno {{count}} tedna',
- few: 'približno {{count}} tedne',
- other: 'približno {{count}} tednov'
- },
- // no tenses for weeks?
- xWeeks: {
- one: '{{count}} teden',
- two: '{{count}} tedna',
- few: '{{count}} tedne',
- other: '{{count}} tednov'
- },
- aboutXMonths: {
- present: {
- one: 'približno {{count}} mesec',
- two: 'približno {{count}} meseca',
- few: 'približno {{count}} mesece',
- other: 'približno {{count}} mesecev'
- },
- past: {
- one: 'približno {{count}} mesecem',
- two: 'približno {{count}} mesecema',
- few: 'približno {{count}} meseci',
- other: 'približno {{count}} meseci'
- },
- future: {
- one: 'približno {{count}} mesec',
- two: 'približno {{count}} meseca',
- few: 'približno {{count}} mesece',
- other: 'približno {{count}} mesecev'
- }
- },
- xMonths: {
- present: {
- one: '{{count}} mesec',
- two: '{{count}} meseca',
- few: '{{count}} meseci',
- other: '{{count}} mesecev'
- },
- past: {
- one: '{{count}} mesecem',
- two: '{{count}} mesecema',
- few: '{{count}} meseci',
- other: '{{count}} meseci'
- },
- future: {
- one: '{{count}} mesec',
- two: '{{count}} meseca',
- few: '{{count}} mesece',
- other: '{{count}} mesecev'
- }
- },
- aboutXYears: {
- present: {
- one: 'približno {{count}} leto',
- two: 'približno {{count}} leti',
- few: 'približno {{count}} leta',
- other: 'približno {{count}} let'
- },
- past: {
- one: 'približno {{count}} letom',
- two: 'približno {{count}} letoma',
- few: 'približno {{count}} leti',
- other: 'približno {{count}} leti'
- },
- future: {
- one: 'približno {{count}} leto',
- two: 'približno {{count}} leti',
- few: 'približno {{count}} leta',
- other: 'približno {{count}} let'
- }
- },
- xYears: {
- present: {
- one: '{{count}} leto',
- two: '{{count}} leti',
- few: '{{count}} leta',
- other: '{{count}} let'
- },
- past: {
- one: '{{count}} letom',
- two: '{{count}} letoma',
- few: '{{count}} leti',
- other: '{{count}} leti'
- },
- future: {
- one: '{{count}} leto',
- two: '{{count}} leti',
- few: '{{count}} leta',
- other: '{{count}} let'
- }
- },
- overXYears: {
- present: {
- one: 'več kot {{count}} leto',
- two: 'več kot {{count}} leti',
- few: 'več kot {{count}} leta',
- other: 'več kot {{count}} let'
- },
- past: {
- one: 'več kot {{count}} letom',
- two: 'več kot {{count}} letoma',
- few: 'več kot {{count}} leti',
- other: 'več kot {{count}} leti'
- },
- future: {
- one: 'več kot {{count}} leto',
- two: 'več kot {{count}} leti',
- few: 'več kot {{count}} leta',
- other: 'več kot {{count}} let'
- }
- },
- almostXYears: {
- present: {
- one: 'skoraj {{count}} leto',
- two: 'skoraj {{count}} leti',
- few: 'skoraj {{count}} leta',
- other: 'skoraj {{count}} let'
- },
- past: {
- one: 'skoraj {{count}} letom',
- two: 'skoraj {{count}} letoma',
- few: 'skoraj {{count}} leti',
- other: 'skoraj {{count}} leti'
- },
- future: {
- one: 'skoraj {{count}} leto',
- two: 'skoraj {{count}} leti',
- few: 'skoraj {{count}} leta',
- other: 'skoraj {{count}} let'
- }
- }
- };
- function getFormFromCount(count) {
- switch (count % 100) {
- case 1:
- return 'one';
- case 2:
- return 'two';
- case 3:
- case 4:
- return 'few';
- default:
- return 'other';
- }
- }
- var formatDistance = function formatDistance(token, count, options) {
- var result = '';
- var tense = 'present';
- if (options !== null && options !== void 0 && options.addSuffix) {
- if (options.comparison && options.comparison > 0) {
- tense = 'future';
- result = 'čez ';
- } else {
- tense = 'past';
- result = 'pred ';
- }
- }
- var tokenValue = formatDistanceLocale[token];
- if (typeof tokenValue === 'string') {
- result += tokenValue;
- } else {
- var form = getFormFromCount(count);
- if (isPluralType(tokenValue)) {
- result += tokenValue[form].replace('{{count}}', String(count));
- } else {
- result += tokenValue[tense][form].replace('{{count}}', String(count));
- }
- }
- return result;
- };
- var _default = formatDistance;
- exports.default = _default;
- module.exports = exports.default;
|