cscg24-guacamole

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

bs.js (4731B)


      1//! moment.js locale configuration
      2//! locale : Bosnian [bs]
      3//! author : Nedim Cholich : https://github.com/frontyard
      4//! author : Rasid Redzic : https://github.com/rasidre
      5//! based on (hr) translation by Bojan Marković
      6
      7import moment from '../moment';
      8
      9function processRelativeTime(number, withoutSuffix, key, isFuture) {
     10    switch (key) {
     11        case 'm':
     12            return withoutSuffix
     13                ? 'jedna minuta'
     14                : isFuture
     15                  ? 'jednu minutu'
     16                  : 'jedne minute';
     17    }
     18}
     19
     20function translate(number, withoutSuffix, key) {
     21    var result = number + ' ';
     22    switch (key) {
     23        case 'ss':
     24            if (number === 1) {
     25                result += 'sekunda';
     26            } else if (number === 2 || number === 3 || number === 4) {
     27                result += 'sekunde';
     28            } else {
     29                result += 'sekundi';
     30            }
     31            return result;
     32        case 'mm':
     33            if (number === 1) {
     34                result += 'minuta';
     35            } else if (number === 2 || number === 3 || number === 4) {
     36                result += 'minute';
     37            } else {
     38                result += 'minuta';
     39            }
     40            return result;
     41        case 'h':
     42            return withoutSuffix ? 'jedan sat' : 'jedan sat';
     43        case 'hh':
     44            if (number === 1) {
     45                result += 'sat';
     46            } else if (number === 2 || number === 3 || number === 4) {
     47                result += 'sata';
     48            } else {
     49                result += 'sati';
     50            }
     51            return result;
     52        case 'dd':
     53            if (number === 1) {
     54                result += 'dan';
     55            } else {
     56                result += 'dana';
     57            }
     58            return result;
     59        case 'MM':
     60            if (number === 1) {
     61                result += 'mjesec';
     62            } else if (number === 2 || number === 3 || number === 4) {
     63                result += 'mjeseca';
     64            } else {
     65                result += 'mjeseci';
     66            }
     67            return result;
     68        case 'yy':
     69            if (number === 1) {
     70                result += 'godina';
     71            } else if (number === 2 || number === 3 || number === 4) {
     72                result += 'godine';
     73            } else {
     74                result += 'godina';
     75            }
     76            return result;
     77    }
     78}
     79
     80export default moment.defineLocale('bs', {
     81    months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
     82        '_'
     83    ),
     84    monthsShort:
     85        'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
     86            '_'
     87        ),
     88    monthsParseExact: true,
     89    weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
     90        '_'
     91    ),
     92    weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
     93    weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
     94    weekdaysParseExact: true,
     95    longDateFormat: {
     96        LT: 'H:mm',
     97        LTS: 'H:mm:ss',
     98        L: 'DD.MM.YYYY',
     99        LL: 'D. MMMM YYYY',
    100        LLL: 'D. MMMM YYYY H:mm',
    101        LLLL: 'dddd, D. MMMM YYYY H:mm',
    102    },
    103    calendar: {
    104        sameDay: '[danas u] LT',
    105        nextDay: '[sutra u] LT',
    106        nextWeek: function () {
    107            switch (this.day()) {
    108                case 0:
    109                    return '[u] [nedjelju] [u] LT';
    110                case 3:
    111                    return '[u] [srijedu] [u] LT';
    112                case 6:
    113                    return '[u] [subotu] [u] LT';
    114                case 1:
    115                case 2:
    116                case 4:
    117                case 5:
    118                    return '[u] dddd [u] LT';
    119            }
    120        },
    121        lastDay: '[jučer u] LT',
    122        lastWeek: function () {
    123            switch (this.day()) {
    124                case 0:
    125                case 3:
    126                    return '[prošlu] dddd [u] LT';
    127                case 6:
    128                    return '[prošle] [subote] [u] LT';
    129                case 1:
    130                case 2:
    131                case 4:
    132                case 5:
    133                    return '[prošli] dddd [u] LT';
    134            }
    135        },
    136        sameElse: 'L',
    137    },
    138    relativeTime: {
    139        future: 'za %s',
    140        past: 'prije %s',
    141        s: 'par sekundi',
    142        ss: translate,
    143        m: processRelativeTime,
    144        mm: translate,
    145        h: translate,
    146        hh: translate,
    147        d: 'dan',
    148        dd: translate,
    149        M: 'mjesec',
    150        MM: translate,
    151        y: 'godinu',
    152        yy: translate,
    153    },
    154    dayOfMonthOrdinalParse: /\d{1,2}\./,
    155    ordinal: '%d.',
    156    week: {
    157        dow: 1, // Monday is the first day of the week.
    158        doy: 7, // The week that contains Jan 7th is the first week of the year.
    159    },
    160});