| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
use Carbon\CarbonInterface; |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
is |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
a |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
a |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
$daysOfWeek = ['svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena']; |
| 48 |
$daysOfWeekLocativum = ['svētdien', 'pirmdien', 'otrdien', 'trešdien', 'ceturtdien', 'piektdien', 'sestdien']; |
| 49 |
|
| 50 |
$transformDiff = static fn (string $input) => strtr($input, [ |
| 51 |
e |
| 52 |
'gads' => 'gada', |
| 53 |
'gadi' => 'gadiem', |
| 54 |
'gadu' => 'gadiem', |
| 55 |
'mēnesis' => 'mēneša', |
| 56 |
'mēneši' => 'mēnešiem', |
| 57 |
'mēnešu' => 'mēnešiem', |
| 58 |
'nedēļa' => 'nedēļas', |
| 59 |
'nedēļas' => 'nedēļām', |
| 60 |
'nedēļu' => 'nedēļām', |
| 61 |
'diena' => 'dienas', |
| 62 |
'dienas' => 'dienām', |
| 63 |
'dienu' => 'dienām', |
| 64 |
'stunda' => 'stundas', |
| 65 |
'stundas' => 'stundām', |
| 66 |
'stundu' => 'stundām', |
| 67 |
'minūte' => 'minūtes', |
| 68 |
'minūtes' => 'minūtēm', |
| 69 |
'minūšu' => 'minūtēm', |
| 70 |
'sekunde' => 'sekundes', |
| 71 |
'sekundes' => 'sekundēm', |
| 72 |
'sekunžu' => 'sekundēm', |
| 73 |
]); |
| 74 |
|
| 75 |
return [ |
| 76 |
'ago' => static fn (string $time) => 'pirms '.$transformDiff($time), |
| 77 |
'from_now' => static fn (string $time) => 'pēc '.$transformDiff($time), |
| 78 |
|
| 79 |
'year' => '0 gadu|:count gads|:count gadi', |
| 80 |
'y' => ':count g.', |
| 81 |
'a_year' => '{1}gads|0 gadu|:count gads|:count gadi', |
| 82 |
'month' => '0 mēnešu|:count mēnesis|:count mēneši', |
| 83 |
'm' => ':count mēn.', |
| 84 |
'a_month' => '{1}mēnesis|0 mēnešu|:count mēnesis|:count mēneši', |
| 85 |
'week' => '0 nedēļu|:count nedēļa|:count nedēļas', |
| 86 |
'w' => ':count ned.', |
| 87 |
'a_week' => '{1}nedēļa|0 nedēļu|:count nedēļa|:count nedēļas', |
| 88 |
'day' => '0 dienu|:count diena|:count dienas', |
| 89 |
'd' => ':count d.', |
| 90 |
'a_day' => '{1}diena|0 dienu|:count diena|:count dienas', |
| 91 |
'hour' => '0 stundu|:count stunda|:count stundas', |
| 92 |
'h' => ':count st.', |
| 93 |
'a_hour' => '{1}stunda|0 stundu|:count stunda|:count stundas', |
| 94 |
'minute' => '0 minūšu|:count minūte|:count minūtes', |
| 95 |
'min' => ':count min.', |
| 96 |
'a_minute' => '{1}minūte|0 minūšu|:count minūte|:count minūtes', |
| 97 |
'second' => '0 sekunžu|:count sekunde|:count sekundes', |
| 98 |
's' => ':count sek.', |
| 99 |
'a_second' => '{1}sekunde|0 sekunžu|:count sekunde|:count sekundes', |
| 100 |
|
| 101 |
'after' => ':time vēlāk', |
| 102 |
'year_after' => '0 gadus|:count gadu|:count gadus', |
| 103 |
'a_year_after' => '{1}gadu|0 gadus|:count gadu|:count gadus', |
| 104 |
'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', |
| 105 |
'a_month_after' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', |
| 106 |
'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', |
| 107 |
'a_week_after' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', |
| 108 |
'day_after' => '0 dienas|:count dienu|:count dienas', |
| 109 |
'a_day_after' => '{1}dienu|0 dienas|:count dienu|:count dienas', |
| 110 |
'hour_after' => '0 stundas|:count stundu|:count stundas', |
| 111 |
'a_hour_after' => '{1}stundu|0 stundas|:count stundu|:count stundas', |
| 112 |
'minute_after' => '0 minūtes|:count minūti|:count minūtes', |
| 113 |
'a_minute_after' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', |
| 114 |
'second_after' => '0 sekundes|:count sekundi|:count sekundes', |
| 115 |
'a_second_after' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', |
| 116 |
|
| 117 |
'before' => ':time agrāk', |
| 118 |
'year_before' => '0 gadus|:count gadu|:count gadus', |
| 119 |
'a_year_before' => '{1}gadu|0 gadus|:count gadu|:count gadus', |
| 120 |
'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', |
| 121 |
'a_month_before' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', |
| 122 |
'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', |
| 123 |
'a_week_before' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', |
| 124 |
'day_before' => '0 dienas|:count dienu|:count dienas', |
| 125 |
'a_day_before' => '{1}dienu|0 dienas|:count dienu|:count dienas', |
| 126 |
'hour_before' => '0 stundas|:count stundu|:count stundas', |
| 127 |
'a_hour_before' => '{1}stundu|0 stundas|:count stundu|:count stundas', |
| 128 |
'minute_before' => '0 minūtes|:count minūti|:count minūtes', |
| 129 |
'a_minute_before' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', |
| 130 |
'second_before' => '0 sekundes|:count sekundi|:count sekundes', |
| 131 |
'a_second_before' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', |
| 132 |
|
| 133 |
'first_day_of_week' => 1, |
| 134 |
'day_of_first_week_of_year' => 4, |
| 135 |
'list' => [', ', ' un '], |
| 136 |
|
| 137 |
'diff_now' => 'tagad', |
| 138 |
'diff_today' => 'šodien', |
| 139 |
'diff_yesterday' => 'vakar', |
| 140 |
'diff_before_yesterday' => 'aizvakar', |
| 141 |
'diff_tomorrow' => 'rīt', |
| 142 |
'diff_after_tomorrow' => 'parīt', |
| 143 |
|
| 144 |
'formats' => [ |
| 145 |
'LT' => 'HH:mm', |
| 146 |
'LTS' => 'HH:mm:ss', |
| 147 |
'L' => 'DD.MM.YYYY.', |
| 148 |
'LL' => 'YYYY. [gada] D. MMMM', |
| 149 |
'LLL' => 'DD.MM.YYYY., HH:mm', |
| 150 |
'LLLL' => 'YYYY. [gada] D. MMMM, HH:mm', |
| 151 |
], |
| 152 |
|
| 153 |
'calendar' => [ |
| 154 |
'sameDay' => '[šodien] [plkst.] LT', |
| 155 |
'nextDay' => '[rīt] [plkst.] LT', |
| 156 |
'nextWeek' => static function (CarbonInterface $current, CarbonInterface $other) use ($daysOfWeekLocativum) { |
| 157 |
if ($current->week !== $other->week) { |
| 158 |
return '[nākošo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 159 |
} |
| 160 |
|
| 161 |
return '['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 162 |
}, |
| 163 |
'lastDay' => '[vakar] [plkst.] LT', |
| 164 |
'lastWeek' => static function (CarbonInterface $current) use ($daysOfWeekLocativum) { |
| 165 |
return '[pagājušo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 166 |
}, |
| 167 |
'sameElse' => 'L', |
| 168 |
], |
| 169 |
|
| 170 |
'weekdays' => $daysOfWeek, |
| 171 |
'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], |
| 172 |
'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], |
| 173 |
'months' => ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'], |
| 174 |
'months_standalone' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], |
| 175 |
'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], |
| 176 |
'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], |
| 177 |
]; |