cscg24-guacamole

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

sk.js (6065B)


      1//! moment.js locale configuration
      2//! locale : Slovak [sk]
      3//! author : Martin Minka : https://github.com/k2s
      4//! based on work of petrbela : https://github.com/petrbela
      5
      6;(function (global, factory) {
      7   typeof exports === 'object' && typeof module !== 'undefined'
      8       && typeof require === 'function' ? factory(require('../moment')) :
      9   typeof define === 'function' && define.amd ? define(['../moment'], factory) :
     10   factory(global.moment)
     11}(this, (function (moment) { 'use strict';
     12
     13    //! moment.js locale configuration
     14
     15    var months =
     16            'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
     17                '_'
     18            ),
     19        monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
     20    function plural(n) {
     21        return n > 1 && n < 5;
     22    }
     23    function translate(number, withoutSuffix, key, isFuture) {
     24        var result = number + ' ';
     25        switch (key) {
     26            case 's': // a few seconds / in a few seconds / a few seconds ago
     27                return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
     28            case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
     29                if (withoutSuffix || isFuture) {
     30                    return result + (plural(number) ? 'sekundy' : 'sekúnd');
     31                } else {
     32                    return result + 'sekundami';
     33                }
     34            case 'm': // a minute / in a minute / a minute ago
     35                return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
     36            case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
     37                if (withoutSuffix || isFuture) {
     38                    return result + (plural(number) ? 'minúty' : 'minút');
     39                } else {
     40                    return result + 'minútami';
     41                }
     42            case 'h': // an hour / in an hour / an hour ago
     43                return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
     44            case 'hh': // 9 hours / in 9 hours / 9 hours ago
     45                if (withoutSuffix || isFuture) {
     46                    return result + (plural(number) ? 'hodiny' : 'hodín');
     47                } else {
     48                    return result + 'hodinami';
     49                }
     50            case 'd': // a day / in a day / a day ago
     51                return withoutSuffix || isFuture ? 'deň' : 'dňom';
     52            case 'dd': // 9 days / in 9 days / 9 days ago
     53                if (withoutSuffix || isFuture) {
     54                    return result + (plural(number) ? 'dni' : 'dní');
     55                } else {
     56                    return result + 'dňami';
     57                }
     58            case 'M': // a month / in a month / a month ago
     59                return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
     60            case 'MM': // 9 months / in 9 months / 9 months ago
     61                if (withoutSuffix || isFuture) {
     62                    return result + (plural(number) ? 'mesiace' : 'mesiacov');
     63                } else {
     64                    return result + 'mesiacmi';
     65                }
     66            case 'y': // a year / in a year / a year ago
     67                return withoutSuffix || isFuture ? 'rok' : 'rokom';
     68            case 'yy': // 9 years / in 9 years / 9 years ago
     69                if (withoutSuffix || isFuture) {
     70                    return result + (plural(number) ? 'roky' : 'rokov');
     71                } else {
     72                    return result + 'rokmi';
     73                }
     74        }
     75    }
     76
     77    var sk = moment.defineLocale('sk', {
     78        months: months,
     79        monthsShort: monthsShort,
     80        weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
     81        weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
     82        weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
     83        longDateFormat: {
     84            LT: 'H:mm',
     85            LTS: 'H:mm:ss',
     86            L: 'DD.MM.YYYY',
     87            LL: 'D. MMMM YYYY',
     88            LLL: 'D. MMMM YYYY H:mm',
     89            LLLL: 'dddd D. MMMM YYYY H:mm',
     90        },
     91        calendar: {
     92            sameDay: '[dnes o] LT',
     93            nextDay: '[zajtra o] LT',
     94            nextWeek: function () {
     95                switch (this.day()) {
     96                    case 0:
     97                        return '[v nedeľu o] LT';
     98                    case 1:
     99                    case 2:
    100                        return '[v] dddd [o] LT';
    101                    case 3:
    102                        return '[v stredu o] LT';
    103                    case 4:
    104                        return '[vo štvrtok o] LT';
    105                    case 5:
    106                        return '[v piatok o] LT';
    107                    case 6:
    108                        return '[v sobotu o] LT';
    109                }
    110            },
    111            lastDay: '[včera o] LT',
    112            lastWeek: function () {
    113                switch (this.day()) {
    114                    case 0:
    115                        return '[minulú nedeľu o] LT';
    116                    case 1:
    117                    case 2:
    118                        return '[minulý] dddd [o] LT';
    119                    case 3:
    120                        return '[minulú stredu o] LT';
    121                    case 4:
    122                    case 5:
    123                        return '[minulý] dddd [o] LT';
    124                    case 6:
    125                        return '[minulú sobotu o] LT';
    126                }
    127            },
    128            sameElse: 'L',
    129        },
    130        relativeTime: {
    131            future: 'za %s',
    132            past: 'pred %s',
    133            s: translate,
    134            ss: translate,
    135            m: translate,
    136            mm: translate,
    137            h: translate,
    138            hh: translate,
    139            d: translate,
    140            dd: translate,
    141            M: translate,
    142            MM: translate,
    143            y: translate,
    144            yy: translate,
    145        },
    146        dayOfMonthOrdinalParse: /\d{1,2}\./,
    147        ordinal: '%d.',
    148        week: {
    149            dow: 1, // Monday is the first day of the week.
    150            doy: 4, // The week that contains Jan 4th is the first week of the year.
    151        },
    152    });
    153
    154    return sk;
    155
    156})));