diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:26:46 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:43:56 -0700 |
| commit | e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch) | |
| tree | 06284a538a6008eca75051399e47db4e5d50301c /node_modules/date-fns/locale/be/_lib/formatDistance/index.js | |
initial commit: scaffolding
Diffstat (limited to 'node_modules/date-fns/locale/be/_lib/formatDistance/index.js')
| -rw-r--r-- | node_modules/date-fns/locale/be/_lib/formatDistance/index.js | 253 |
1 files changed, 253 insertions, 0 deletions
diff --git a/node_modules/date-fns/locale/be/_lib/formatDistance/index.js b/node_modules/date-fns/locale/be/_lib/formatDistance/index.js new file mode 100644 index 0000000..06f948f --- /dev/null +++ b/node_modules/date-fns/locale/be/_lib/formatDistance/index.js @@ -0,0 +1,253 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; +function declension(scheme, count) { + // scheme for count=1 exists + if (scheme.one !== undefined && count === 1) { + return scheme.one; + } + var rem10 = count % 10; + var rem100 = count % 100; + + // 1, 21, 31, ... + if (rem10 === 1 && rem100 !== 11) { + return scheme.singularNominative.replace('{{count}}', String(count)); + + // 2, 3, 4, 22, 23, 24, 32 ... + } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) { + return scheme.singularGenitive.replace('{{count}}', String(count)); + + // 5, 6, 7, 8, 9, 10, 11, ... + } else { + return scheme.pluralGenitive.replace('{{count}}', String(count)); + } +} +function buildLocalizeTokenFn(scheme) { + return function (count, options) { + if (options && options.addSuffix) { + if (options.comparison && options.comparison > 0) { + if (scheme.future) { + return declension(scheme.future, count); + } else { + return 'праз ' + declension(scheme.regular, count); + } + } else { + if (scheme.past) { + return declension(scheme.past, count); + } else { + return declension(scheme.regular, count) + ' таму'; + } + } + } else { + return declension(scheme.regular, count); + } + }; +} +var halfAMinute = function halfAMinute(_, options) { + if (options && options.addSuffix) { + if (options.comparison && options.comparison > 0) { + return 'праз паўхвіліны'; + } else { + return 'паўхвіліны таму'; + } + } + return 'паўхвіліны'; +}; +var formatDistanceLocale = { + lessThanXSeconds: buildLocalizeTokenFn({ + regular: { + one: 'менш за секунду', + singularNominative: 'менш за {{count}} секунду', + singularGenitive: 'менш за {{count}} секунды', + pluralGenitive: 'менш за {{count}} секунд' + }, + future: { + one: 'менш, чым праз секунду', + singularNominative: 'менш, чым праз {{count}} секунду', + singularGenitive: 'менш, чым праз {{count}} секунды', + pluralGenitive: 'менш, чым праз {{count}} секунд' + } + }), + xSeconds: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} секунда', + singularGenitive: '{{count}} секунды', + pluralGenitive: '{{count}} секунд' + }, + past: { + singularNominative: '{{count}} секунду таму', + singularGenitive: '{{count}} секунды таму', + pluralGenitive: '{{count}} секунд таму' + }, + future: { + singularNominative: 'праз {{count}} секунду', + singularGenitive: 'праз {{count}} секунды', + pluralGenitive: 'праз {{count}} секунд' + } + }), + halfAMinute: halfAMinute, + lessThanXMinutes: buildLocalizeTokenFn({ + regular: { + one: 'менш за хвіліну', + singularNominative: 'менш за {{count}} хвіліну', + singularGenitive: 'менш за {{count}} хвіліны', + pluralGenitive: 'менш за {{count}} хвілін' + }, + future: { + one: 'менш, чым праз хвіліну', + singularNominative: 'менш, чым праз {{count}} хвіліну', + singularGenitive: 'менш, чым праз {{count}} хвіліны', + pluralGenitive: 'менш, чым праз {{count}} хвілін' + } + }), + xMinutes: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} хвіліна', + singularGenitive: '{{count}} хвіліны', + pluralGenitive: '{{count}} хвілін' + }, + past: { + singularNominative: '{{count}} хвіліну таму', + singularGenitive: '{{count}} хвіліны таму', + pluralGenitive: '{{count}} хвілін таму' + }, + future: { + singularNominative: 'праз {{count}} хвіліну', + singularGenitive: 'праз {{count}} хвіліны', + pluralGenitive: 'праз {{count}} хвілін' + } + }), + aboutXHours: buildLocalizeTokenFn({ + regular: { + singularNominative: 'каля {{count}} гадзіны', + singularGenitive: 'каля {{count}} гадзін', + pluralGenitive: 'каля {{count}} гадзін' + }, + future: { + singularNominative: 'прыблізна праз {{count}} гадзіну', + singularGenitive: 'прыблізна праз {{count}} гадзіны', + pluralGenitive: 'прыблізна праз {{count}} гадзін' + } + }), + xHours: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} гадзіна', + singularGenitive: '{{count}} гадзіны', + pluralGenitive: '{{count}} гадзін' + }, + past: { + singularNominative: '{{count}} гадзіну таму', + singularGenitive: '{{count}} гадзіны таму', + pluralGenitive: '{{count}} гадзін таму' + }, + future: { + singularNominative: 'праз {{count}} гадзіну', + singularGenitive: 'праз {{count}} гадзіны', + pluralGenitive: 'праз {{count}} гадзін' + } + }), + xDays: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} дзень', + singularGenitive: '{{count}} дні', + pluralGenitive: '{{count}} дзён' + } + }), + aboutXWeeks: buildLocalizeTokenFn({ + regular: { + singularNominative: 'каля {{count}} месяца', + // TODO + singularGenitive: 'каля {{count}} месяцаў', + // TODO + pluralGenitive: 'каля {{count}} месяцаў' // TODO + }, + + future: { + singularNominative: 'прыблізна праз {{count}} месяц', + // TODO + singularGenitive: 'прыблізна праз {{count}} месяцы', + // TODO + pluralGenitive: 'прыблізна праз {{count}} месяцаў' // TODO + } + }), + + xWeeks: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} месяц', + singularGenitive: '{{count}} месяцы', + pluralGenitive: '{{count}} месяцаў' + } + }), + aboutXMonths: buildLocalizeTokenFn({ + regular: { + singularNominative: 'каля {{count}} месяца', + singularGenitive: 'каля {{count}} месяцаў', + pluralGenitive: 'каля {{count}} месяцаў' + }, + future: { + singularNominative: 'прыблізна праз {{count}} месяц', + singularGenitive: 'прыблізна праз {{count}} месяцы', + pluralGenitive: 'прыблізна праз {{count}} месяцаў' + } + }), + xMonths: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} месяц', + singularGenitive: '{{count}} месяцы', + pluralGenitive: '{{count}} месяцаў' + } + }), + aboutXYears: buildLocalizeTokenFn({ + regular: { + singularNominative: 'каля {{count}} года', + singularGenitive: 'каля {{count}} гадоў', + pluralGenitive: 'каля {{count}} гадоў' + }, + future: { + singularNominative: 'прыблізна праз {{count}} год', + singularGenitive: 'прыблізна праз {{count}} гады', + pluralGenitive: 'прыблізна праз {{count}} гадоў' + } + }), + xYears: buildLocalizeTokenFn({ + regular: { + singularNominative: '{{count}} год', + singularGenitive: '{{count}} гады', + pluralGenitive: '{{count}} гадоў' + } + }), + overXYears: buildLocalizeTokenFn({ + regular: { + singularNominative: 'больш за {{count}} год', + singularGenitive: 'больш за {{count}} гады', + pluralGenitive: 'больш за {{count}} гадоў' + }, + future: { + singularNominative: 'больш, чым праз {{count}} год', + singularGenitive: 'больш, чым праз {{count}} гады', + pluralGenitive: 'больш, чым праз {{count}} гадоў' + } + }), + almostXYears: buildLocalizeTokenFn({ + regular: { + singularNominative: 'амаль {{count}} год', + singularGenitive: 'амаль {{count}} гады', + pluralGenitive: 'амаль {{count}} гадоў' + }, + future: { + singularNominative: 'амаль праз {{count}} год', + singularGenitive: 'амаль праз {{count}} гады', + pluralGenitive: 'амаль праз {{count}} гадоў' + } + }) +}; +var formatDistance = function formatDistance(token, count, options) { + options = options || {}; + return formatDistanceLocale[token](count, options); +}; +var _default = formatDistance; +exports.default = _default; +module.exports = exports.default;
\ No newline at end of file |
