Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 1 | <?php |
| 2 | |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 3 | /** |
| 4 | * This file is part of the Carbon package. |
| 5 | * |
| 6 | * (c) Brian Nesbitt <brian@nesbot.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 12 | use Carbon\CarbonInterface; |
| 13 | |
| 14 | /** |
| 15 | * This file is part of the Carbon package. |
| 16 | * |
| 17 | * (c) Brian Nesbitt <brian@nesbot.com> |
| 18 | * |
| 19 | * For the full copyright and license information, please view the LICENSE |
| 20 | * file that was distributed with this source code. |
| 21 | */ |
| 22 | |
| 23 | /* |
| 24 | * Authors: |
| 25 | * - Philippe Vaucher |
| 26 | * - pirminis |
| 27 | * - Tsutomu Kuroda |
| 28 | * - tjku |
| 29 | * - Andris Zāģeris |
| 30 | * - Max Melentiev |
| 31 | * - Edgars Beigarts |
| 32 | * - Juanito Fatas |
| 33 | * - Vitauts Stočka |
| 34 | * - Akira Matsuda |
| 35 | * - Christopher Dell |
| 36 | * - Enrique Vidal |
| 37 | * - Simone Carletti |
| 38 | * - Aaron Patterson |
| 39 | * - Kaspars Bankovskis |
| 40 | * - Nicolás Hock Isaza |
| 41 | * - Viesturs Kavacs (Kavacky) |
| 42 | * - zakse |
| 43 | * - Janis Eglitis (janiseglitis) |
| 44 | * - Guntars |
| 45 | * - Juris Sudmalis |
| 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 = function ($input) { |
| 51 | return strtr($input, [ |
| 52 | // Nominative => "pirms/pēc" Dative |
| 53 | 'gads' => 'gada', |
| 54 | 'gadi' => 'gadiem', |
| 55 | 'gadu' => 'gadiem', |
| 56 | 'mēnesis' => 'mēneša', |
| 57 | 'mēneši' => 'mēnešiem', |
| 58 | 'mēnešu' => 'mēnešiem', |
| 59 | 'nedēļa' => 'nedēļas', |
| 60 | 'nedēļas' => 'nedēļām', |
| 61 | 'nedēļu' => 'nedēļām', |
| 62 | 'diena' => 'dienas', |
| 63 | 'dienas' => 'dienām', |
| 64 | 'dienu' => 'dienām', |
| 65 | 'stunda' => 'stundas', |
| 66 | 'stundas' => 'stundām', |
| 67 | 'stundu' => 'stundām', |
| 68 | 'minūte' => 'minūtes', |
| 69 | 'minūtes' => 'minūtēm', |
| 70 | 'minūšu' => 'minūtēm', |
| 71 | 'sekunde' => 'sekundes', |
| 72 | 'sekundes' => 'sekundēm', |
| 73 | 'sekunžu' => 'sekundēm', |
| 74 | ]); |
| 75 | }; |
| 76 | |
| 77 | return [ |
| 78 | 'ago' => function ($time) use ($transformDiff) { |
| 79 | return 'pirms '.$transformDiff($time); |
| 80 | }, |
| 81 | 'from_now' => function ($time) use ($transformDiff) { |
| 82 | return 'pēc '.$transformDiff($time); |
| 83 | }, |
| 84 | |
| 85 | 'year' => '0 gadu|:count gads|:count gadi', |
| 86 | 'y' => ':count g.', |
| 87 | 'a_year' => '{1}gads|0 gadu|:count gads|:count gadi', |
| 88 | 'month' => '0 mēnešu|:count mēnesis|:count mēneši', |
| 89 | 'm' => ':count mēn.', |
| 90 | 'a_month' => '{1}mēnesis|0 mēnešu|:count mēnesis|:count mēneši', |
| 91 | 'week' => '0 nedēļu|:count nedēļa|:count nedēļas', |
| 92 | 'w' => ':count ned.', |
| 93 | 'a_week' => '{1}nedēļa|0 nedēļu|:count nedēļa|:count nedēļas', |
| 94 | 'day' => '0 dienu|:count diena|:count dienas', |
| 95 | 'd' => ':count d.', |
| 96 | 'a_day' => '{1}diena|0 dienu|:count diena|:count dienas', |
| 97 | 'hour' => '0 stundu|:count stunda|:count stundas', |
| 98 | 'h' => ':count st.', |
| 99 | 'a_hour' => '{1}stunda|0 stundu|:count stunda|:count stundas', |
| 100 | 'minute' => '0 minūšu|:count minūte|:count minūtes', |
| 101 | 'min' => ':count min.', |
| 102 | 'a_minute' => '{1}minūte|0 minūšu|:count minūte|:count minūtes', |
| 103 | 'second' => '0 sekunžu|:count sekunde|:count sekundes', |
| 104 | 's' => ':count sek.', |
| 105 | 'a_second' => '{1}sekunde|0 sekunžu|:count sekunde|:count sekundes', |
| 106 | |
| 107 | 'after' => ':time vēlāk', |
| 108 | 'year_after' => '0 gadus|:count gadu|:count gadus', |
| 109 | 'a_year_after' => '{1}gadu|0 gadus|:count gadu|:count gadus', |
| 110 | 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', |
| 111 | 'a_month_after' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', |
| 112 | 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', |
| 113 | 'a_week_after' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', |
| 114 | 'day_after' => '0 dienas|:count dienu|:count dienas', |
| 115 | 'a_day_after' => '{1}dienu|0 dienas|:count dienu|:count dienas', |
| 116 | 'hour_after' => '0 stundas|:count stundu|:count stundas', |
| 117 | 'a_hour_after' => '{1}stundu|0 stundas|:count stundu|:count stundas', |
| 118 | 'minute_after' => '0 minūtes|:count minūti|:count minūtes', |
| 119 | 'a_minute_after' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', |
| 120 | 'second_after' => '0 sekundes|:count sekundi|:count sekundes', |
| 121 | 'a_second_after' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', |
| 122 | |
| 123 | 'before' => ':time agrāk', |
| 124 | 'year_before' => '0 gadus|:count gadu|:count gadus', |
| 125 | 'a_year_before' => '{1}gadu|0 gadus|:count gadu|:count gadus', |
| 126 | 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', |
| 127 | 'a_month_before' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', |
| 128 | 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', |
| 129 | 'a_week_before' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', |
| 130 | 'day_before' => '0 dienas|:count dienu|:count dienas', |
| 131 | 'a_day_before' => '{1}dienu|0 dienas|:count dienu|:count dienas', |
| 132 | 'hour_before' => '0 stundas|:count stundu|:count stundas', |
| 133 | 'a_hour_before' => '{1}stundu|0 stundas|:count stundu|:count stundas', |
| 134 | 'minute_before' => '0 minūtes|:count minūti|:count minūtes', |
| 135 | 'a_minute_before' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', |
| 136 | 'second_before' => '0 sekundes|:count sekundi|:count sekundes', |
| 137 | 'a_second_before' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', |
| 138 | |
| 139 | 'first_day_of_week' => 1, |
| 140 | 'day_of_first_week_of_year' => 4, |
| 141 | 'list' => [', ', ' un '], |
| 142 | |
| 143 | 'diff_now' => 'tagad', |
| 144 | 'diff_today' => 'šodien', |
| 145 | 'diff_yesterday' => 'vakar', |
| 146 | 'diff_before_yesterday' => 'aizvakar', |
| 147 | 'diff_tomorrow' => 'rīt', |
| 148 | 'diff_after_tomorrow' => 'parīt', |
| 149 | |
| 150 | 'formats' => [ |
| 151 | 'LT' => 'HH:mm', |
| 152 | 'LTS' => 'HH:mm:ss', |
| 153 | 'L' => 'DD.MM.YYYY.', |
| 154 | 'LL' => 'YYYY. [gada] D. MMMM', |
| 155 | 'LLL' => 'DD.MM.YYYY., HH:mm', |
| 156 | 'LLLL' => 'YYYY. [gada] D. MMMM, HH:mm', |
| 157 | ], |
| 158 | |
| 159 | 'calendar' => [ |
| 160 | 'sameDay' => '[šodien] [plkst.] LT', |
| 161 | 'nextDay' => '[rīt] [plkst.] LT', |
| 162 | 'nextWeek' => function (CarbonInterface $current, CarbonInterface $other) use ($daysOfWeekLocativum) { |
| 163 | if ($current->week !== $other->week) { |
| 164 | return '[nākošo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 165 | } |
| 166 | |
| 167 | return '['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 168 | }, |
| 169 | 'lastDay' => '[vakar] [plkst.] LT', |
| 170 | 'lastWeek' => function (CarbonInterface $current) use ($daysOfWeekLocativum) { |
| 171 | return '[pagājušo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; |
| 172 | }, |
| 173 | 'sameElse' => 'L', |
| 174 | ], |
| 175 | |
| 176 | 'weekdays' => $daysOfWeek, |
| 177 | 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], |
| 178 | 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], |
| 179 | 'months' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 180 | 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 181 | 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], |
| 182 | ]; |