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