CaItTest.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <?php
  2. declare(strict_types=1);
  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. namespace Tests\Localization;
  12. /**
  13. * @group localization
  14. */
  15. class CaItTest extends LocalizationTestCase
  16. {
  17. public const LOCALE = 'ca_IT'; // Catalan
  18. public const CASES = [
  19. // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  20. // 'Tomorrow at 12:00 AM',
  21. 'demà a les 0:00',
  22. // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  23. // 'Saturday at 12:00 AM',
  24. 'dissabte a les 0:00',
  25. // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  26. // 'Sunday at 12:00 AM',
  27. 'diumenge a les 0:00',
  28. // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  29. // 'Monday at 12:00 AM',
  30. 'dilluns a les 0:00',
  31. // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  32. // 'Tuesday at 12:00 AM',
  33. 'dimarts a les 0:00',
  34. // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  35. // 'Wednesday at 12:00 AM',
  36. 'dimecres a les 0:00',
  37. // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00'))
  38. // 'Thursday at 12:00 AM',
  39. 'dijous a les 0:00',
  40. // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00'))
  41. // 'Friday at 12:00 AM',
  42. 'divendres a les 0:00',
  43. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  44. // 'Tuesday at 12:00 AM',
  45. 'dimarts a les 0:00',
  46. // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  47. // 'Wednesday at 12:00 AM',
  48. 'dimecres a les 0:00',
  49. // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  50. // 'Thursday at 12:00 AM',
  51. 'dijous a les 0:00',
  52. // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  53. // 'Friday at 12:00 AM',
  54. 'divendres a les 0:00',
  55. // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  56. // 'Saturday at 12:00 AM',
  57. 'dissabte a les 0:00',
  58. // Carbon::now()->subDays(2)->calendar()
  59. // 'Last Sunday at 8:49 PM',
  60. 'el diumenge passat a les 20:49',
  61. // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  62. // 'Yesterday at 10:00 PM',
  63. 'ahir a les 22:00',
  64. // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00'))
  65. // 'Today at 10:00 AM',
  66. 'avui a les 10:00',
  67. // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  68. // 'Today at 2:00 AM',
  69. 'avui a les 2:00',
  70. // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00'))
  71. // 'Tomorrow at 1:00 AM',
  72. 'demà a les 1:00',
  73. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  74. // 'Tuesday at 12:00 AM',
  75. 'dimarts a les 0:00',
  76. // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00'))
  77. // 'Yesterday at 12:00 AM',
  78. 'ahir a les 0:00',
  79. // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  80. // 'Yesterday at 12:00 AM',
  81. 'ahir a les 0:00',
  82. // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  83. // 'Last Tuesday at 12:00 AM',
  84. 'el dimarts passat a les 0:00',
  85. // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  86. // 'Last Monday at 12:00 AM',
  87. 'el dilluns passat a les 0:00',
  88. // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  89. // 'Last Sunday at 12:00 AM',
  90. 'el diumenge passat a les 0:00',
  91. // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  92. // 'Last Saturday at 12:00 AM',
  93. 'el dissabte passat a les 0:00',
  94. // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  95. // 'Last Friday at 12:00 AM',
  96. 'el divendres passat a les 0:00',
  97. // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00'))
  98. // 'Last Thursday at 12:00 AM',
  99. 'el dijous passat a les 0:00',
  100. // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00'))
  101. // 'Last Wednesday at 12:00 AM',
  102. 'el dimecres passat a les 0:00',
  103. // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  104. // 'Last Friday at 12:00 AM',
  105. 'el divendres passat a les 0:00',
  106. // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo')
  107. // '1st 1st 1st 1st 1st',
  108. '1r 1r 1r 1a 1a',
  109. // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo')
  110. // '2nd 1st',
  111. '2n 1a',
  112. // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo')
  113. // '3rd 1st',
  114. '3r 1a',
  115. // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo')
  116. // '4th 1st',
  117. '4t 1a',
  118. // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo')
  119. // '5th 1st',
  120. '5è 1a',
  121. // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo')
  122. // '6th 1st',
  123. '6è 1a',
  124. // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo')
  125. // '7th 2nd',
  126. '7è 1a',
  127. // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo')
  128. // '11th 2nd',
  129. '11è 2a',
  130. // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo')
  131. // '40th',
  132. '40è',
  133. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo')
  134. // '41st',
  135. '41è',
  136. // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo')
  137. // '100th',
  138. '100è',
  139. // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z')
  140. // '12:00 am CET',
  141. '12:00 a. m. CET',
  142. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a')
  143. // '12:00 AM, 12:00 am',
  144. '12:00 a. m., 12:00 a. m.',
  145. // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a')
  146. // '1:30 AM, 1:30 am',
  147. '1:30 a. m., 1:30 a. m.',
  148. // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a')
  149. // '2:00 AM, 2:00 am',
  150. '2:00 a. m., 2:00 a. m.',
  151. // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a')
  152. // '6:00 AM, 6:00 am',
  153. '6:00 a. m., 6:00 a. m.',
  154. // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a')
  155. // '10:00 AM, 10:00 am',
  156. '10:00 a. m., 10:00 a. m.',
  157. // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a')
  158. // '12:00 PM, 12:00 pm',
  159. '12:00 p. m., 12:00 p. m.',
  160. // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a')
  161. // '5:00 PM, 5:00 pm',
  162. '5:00 p. m., 5:00 p. m.',
  163. // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a')
  164. // '9:30 PM, 9:30 pm',
  165. '9:30 p. m., 9:30 p. m.',
  166. // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a')
  167. // '11:00 PM, 11:00 pm',
  168. '11:00 p. m., 11:00 p. m.',
  169. // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
  170. // '0th',
  171. '0è',
  172. // Carbon::now()->subSeconds(1)->diffForHumans()
  173. // '1 second ago',
  174. 'fa 1 segon',
  175. // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
  176. // '1s ago',
  177. 'fa 1 s',
  178. // Carbon::now()->subSeconds(2)->diffForHumans()
  179. // '2 seconds ago',
  180. 'fa 2 segons',
  181. // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
  182. // '2s ago',
  183. 'fa 2 s',
  184. // Carbon::now()->subMinutes(1)->diffForHumans()
  185. // '1 minute ago',
  186. 'fa 1 minut',
  187. // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
  188. // '1m ago',
  189. 'fa 1 min',
  190. // Carbon::now()->subMinutes(2)->diffForHumans()
  191. // '2 minutes ago',
  192. 'fa 2 minuts',
  193. // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
  194. // '2m ago',
  195. 'fa 2 min',
  196. // Carbon::now()->subHours(1)->diffForHumans()
  197. // '1 hour ago',
  198. 'fa 1 hora',
  199. // Carbon::now()->subHours(1)->diffForHumans(null, false, true)
  200. // '1h ago',
  201. 'fa 1 h',
  202. // Carbon::now()->subHours(2)->diffForHumans()
  203. // '2 hours ago',
  204. 'fa 2 hores',
  205. // Carbon::now()->subHours(2)->diffForHumans(null, false, true)
  206. // '2h ago',
  207. 'fa 2 h',
  208. // Carbon::now()->subDays(1)->diffForHumans()
  209. // '1 day ago',
  210. 'fa 1 dia',
  211. // Carbon::now()->subDays(1)->diffForHumans(null, false, true)
  212. // '1d ago',
  213. 'fa 1 d',
  214. // Carbon::now()->subDays(2)->diffForHumans()
  215. // '2 days ago',
  216. 'fa 2 dies',
  217. // Carbon::now()->subDays(2)->diffForHumans(null, false, true)
  218. // '2d ago',
  219. 'fa 2 d',
  220. // Carbon::now()->subWeeks(1)->diffForHumans()
  221. // '1 week ago',
  222. 'fa 1 setmana',
  223. // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
  224. // '1w ago',
  225. 'fa 1 setmana',
  226. // Carbon::now()->subWeeks(2)->diffForHumans()
  227. // '2 weeks ago',
  228. 'fa 2 setmanes',
  229. // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
  230. // '2w ago',
  231. 'fa 2 setmanes',
  232. // Carbon::now()->subMonths(1)->diffForHumans()
  233. // '1 month ago',
  234. 'fa 1 mes',
  235. // Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
  236. // '1mo ago',
  237. 'fa 1 mes',
  238. // Carbon::now()->subMonths(2)->diffForHumans()
  239. // '2 months ago',
  240. 'fa 2 mesos',
  241. // Carbon::now()->subMonths(2)->diffForHumans(null, false, true)
  242. // '2mos ago',
  243. 'fa 2 mesos',
  244. // Carbon::now()->subYears(1)->diffForHumans()
  245. // '1 year ago',
  246. 'fa 1 any',
  247. // Carbon::now()->subYears(1)->diffForHumans(null, false, true)
  248. // '1yr ago',
  249. 'fa 1 any',
  250. // Carbon::now()->subYears(2)->diffForHumans()
  251. // '2 years ago',
  252. 'fa 2 anys',
  253. // Carbon::now()->subYears(2)->diffForHumans(null, false, true)
  254. // '2yrs ago',
  255. 'fa 2 anys',
  256. // Carbon::now()->addSecond()->diffForHumans()
  257. // '1 second from now',
  258. 'd\'aquí a 1 segon',
  259. // Carbon::now()->addSecond()->diffForHumans(null, false, true)
  260. // '1s from now',
  261. 'd\'aquí a 1 s',
  262. // Carbon::now()->addSecond()->diffForHumans(Carbon::now())
  263. // '1 second after',
  264. '1 segon després',
  265. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
  266. // '1s after',
  267. '1 s després',
  268. // Carbon::now()->diffForHumans(Carbon::now()->addSecond())
  269. // '1 second before',
  270. '1 segon abans',
  271. // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
  272. // '1s before',
  273. '1 s abans',
  274. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
  275. // '1 second',
  276. '1 segon',
  277. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
  278. // '1s',
  279. '1 s',
  280. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
  281. // '2 seconds',
  282. '2 segons',
  283. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
  284. // '2s',
  285. '2 s',
  286. // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
  287. // '1s from now',
  288. 'd\'aquí a 1 s',
  289. // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
  290. // '1 minute 1 second',
  291. '1 minut 1 segon',
  292. // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
  293. // '2yrs 3mos 1d 1s',
  294. '2 anys 3 mesos 1 d 1 s',
  295. // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
  296. // '3 years from now',
  297. 'd\'aquí a 3 anys',
  298. // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
  299. // '5mos ago',
  300. 'fa 5 mesos',
  301. // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
  302. // '2yrs 3mos 1d 1s ago',
  303. 'fa 2 anys 3 mesos 1 d 1 s',
  304. // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
  305. // '1 week 10 hours',
  306. '1 setmana 10 hores',
  307. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  308. // '1 week 6 days',
  309. '1 setmana 6 dies',
  310. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  311. // '1 week 6 days',
  312. '1 setmana 6 dies',
  313. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
  314. // '1 week and 6 days from now',
  315. 'd\'aquí a 1 setmana i 6 dies',
  316. // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
  317. // '2 weeks 1 hour',
  318. '2 setmanes 1 hora',
  319. // Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
  320. // 'an hour from now',
  321. 'd\'aquí a una hora',
  322. // CarbonInterval::days(2)->forHumans()
  323. // '2 days',
  324. '2 dies',
  325. // CarbonInterval::create('P1DT3H')->forHumans(true)
  326. // '1d 3h',
  327. '1 d 3 h',
  328. ];
  329. }