cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

be.js (6034B)


      1//! moment.js locale configuration
      2//! locale : Belarusian [be]
      3//! author : Dmitry Demidov : https://github.com/demidov91
      4//! author: Praleska: http://praleska.pro/
      5//! Author : Menelion Elensúle : https://github.com/Oire
      6
      7;(function (global, factory) {
      8   typeof exports === 'object' && typeof module !== 'undefined'
      9       && typeof require === 'function' ? factory(require('../moment')) :
     10   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
     11   factory(global.moment)
     12}(this, (function (moment) { 'use strict';
     13
     14    //! moment.js locale configuration
     15
     16    function plural(word, num) {
     17        var forms = word.split('_');
     18        return num % 10 === 1 && num % 100 !== 11
     19            ? forms[0]
     20            : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
     21              ? forms[1]
     22              : forms[2];
     23    }
     24    function relativeTimeWithPlural(number, withoutSuffix, key) {
     25        var format = {
     26            ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
     27            mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
     28            hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
     29            dd: 'дзень_дні_дзён',
     30            MM: 'месяц_месяцы_месяцаў',
     31            yy: 'год_гады_гадоў',
     32        };
     33        if (key === 'm') {
     34            return withoutSuffix ? 'хвіліна' : 'хвіліну';
     35        } else if (key === 'h') {
     36            return withoutSuffix ? 'гадзіна' : 'гадзіну';
     37        } else {
     38            return number + ' ' + plural(format[key], +number);
     39        }
     40    }
     41
     42    var be = moment.defineLocale('be', {
     43        months: {
     44            format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
     45                '_'
     46            ),
     47            standalone:
     48                'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
     49                    '_'
     50                ),
     51        },
     52        monthsShort:
     53            'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
     54        weekdays: {
     55            format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
     56                '_'
     57            ),
     58            standalone:
     59                'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
     60                    '_'
     61                ),
     62            isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
     63        },
     64        weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
     65        weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
     66        longDateFormat: {
     67            LT: 'HH:mm',
     68            LTS: 'HH:mm:ss',
     69            L: 'DD.MM.YYYY',
     70            LL: 'D MMMM YYYY г.',
     71            LLL: 'D MMMM YYYY г., HH:mm',
     72            LLLL: 'dddd, D MMMM YYYY г., HH:mm',
     73        },
     74        calendar: {
     75            sameDay: '[Сёння ў] LT',
     76            nextDay: '[Заўтра ў] LT',
     77            lastDay: '[Учора ў] LT',
     78            nextWeek: function () {
     79                return '[У] dddd [ў] LT';
     80            },
     81            lastWeek: function () {
     82                switch (this.day()) {
     83                    case 0:
     84                    case 3:
     85                    case 5:
     86                    case 6:
     87                        return '[У мінулую] dddd [ў] LT';
     88                    case 1:
     89                    case 2:
     90                    case 4:
     91                        return '[У мінулы] dddd [ў] LT';
     92                }
     93            },
     94            sameElse: 'L',
     95        },
     96        relativeTime: {
     97            future: 'праз %s',
     98            past: '%s таму',
     99            s: 'некалькі секунд',
    100            m: relativeTimeWithPlural,
    101            mm: relativeTimeWithPlural,
    102            h: relativeTimeWithPlural,
    103            hh: relativeTimeWithPlural,
    104            d: 'дзень',
    105            dd: relativeTimeWithPlural,
    106            M: 'месяц',
    107            MM: relativeTimeWithPlural,
    108            y: 'год',
    109            yy: relativeTimeWithPlural,
    110        },
    111        meridiemParse: /ночы|раніцы|дня|вечара/,
    112        isPM: function (input) {
    113            return /^(дня|вечара)$/.test(input);
    114        },
    115        meridiem: function (hour, minute, isLower) {
    116            if (hour < 4) {
    117                return 'ночы';
    118            } else if (hour < 12) {
    119                return 'раніцы';
    120            } else if (hour < 17) {
    121                return 'дня';
    122            } else {
    123                return 'вечара';
    124            }
    125        },
    126        dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
    127        ordinal: function (number, period) {
    128            switch (period) {
    129                case 'M':
    130                case 'd':
    131                case 'DDD':
    132                case 'w':
    133                case 'W':
    134                    return (number % 10 === 2 || number % 10 === 3) &&
    135                        number % 100 !== 12 &&
    136                        number % 100 !== 13
    137                        ? number + '-і'
    138                        : number + '-ы';
    139                case 'D':
    140                    return number + '-га';
    141                default:
    142                    return number;
    143            }
    144        },
    145        week: {
    146            dow: 1, // Monday is the first day of the week.
    147            doy: 7, // The week that contains Jan 7th is the first week of the year.
    148        },
    149    });
    150
    151    return be;
    152
    153})));