Skip to content

Commit

Permalink
Merge pull request #2524 from briannesbitt/fix/pl-translations
Browse files Browse the repository at this point in the history
Replace Polish ending in grouped units
  • Loading branch information
kylekatarnls authored Dec 9, 2021
2 parents 4218ff2 + 78f98be commit 28e0ec7
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 93 deletions.
27 changes: 5 additions & 22 deletions src/Carbon/Lang/pl.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,11 @@
's' => ':count sek.',
'ago' => ':time temu',
'from_now' => static function ($time) {
switch ($time) {
case '1 godzina':
return 'za 1 godzinę';

case '1 minuta':
return 'za 1 minutę';

case '1 sekunda':
return 'za 1 sekundę';

case 'godzina':
return 'za godzinę';

case 'minuta':
return 'za minutę';

case 'sekunda':
return 'za sekundę';

default:
return "za $time";
}
return 'za '.strtr($time, [
'godzina' => 'godzinę',
'minuta' => 'minutę',
'sekunda' => 'sekundę',
]);
},
'after' => ':time po',
'before' => ':time przed',
Expand Down
18 changes: 9 additions & 9 deletions src/Carbon/Lang/szl_PL.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
'm' => ':count mjeśůnc',
'a_month' => ':count mjeśůnc',

'week' => ':count Tydźyń',
'w' => ':count Tydźyń',
'a_week' => ':count Tydźyń',
'week' => ':count tydźyń',
'w' => ':count tydźyń',
'a_week' => ':count tydźyń',

'day' => ':count dźyń',
'd' => ':count dźyń',
Expand All @@ -45,11 +45,11 @@
'h' => ':count godzina',
'a_hour' => ':count godzina',

'minute' => ':count Minuta',
'min' => ':count Minuta',
'a_minute' => ':count Minuta',
'minute' => ':count minuta',
'min' => ':count minuta',
'a_minute' => ':count minuta',

'second' => ':count Sekůnda',
's' => ':count Sekůnda',
'a_second' => ':count Sekůnda',
'second' => ':count sekůnda',
's' => ':count sekůnda',
'a_second' => ':count sekůnda',
]);
62 changes: 31 additions & 31 deletions tests/Localization/SzlPlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ class SzlPlTest extends LocalizationTestCase
// Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
'0th',
// Carbon::now()->subSeconds(1)->diffForHumans()
'1 Sekůnda ago',
'1 sekůnda ago',
// Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
'1 Sekůnda ago',
'1 sekůnda ago',
// Carbon::now()->subSeconds(2)->diffForHumans()
'2 Sekůnda ago',
'2 sekůnda ago',
// Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
'2 Sekůnda ago',
'2 sekůnda ago',
// Carbon::now()->subMinutes(1)->diffForHumans()
'1 Minuta ago',
'1 minuta ago',
// Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
'1 Minuta ago',
'1 minuta ago',
// Carbon::now()->subMinutes(2)->diffForHumans()
'2 Minuta ago',
'2 minuta ago',
// Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
'2 Minuta ago',
'2 minuta ago',
// Carbon::now()->subHours(1)->diffForHumans()
'1 godzina ago',
// Carbon::now()->subHours(1)->diffForHumans(null, false, true)
Expand All @@ -156,13 +156,13 @@ class SzlPlTest extends LocalizationTestCase
// Carbon::now()->subDays(2)->diffForHumans(null, false, true)
'2 dźyń ago',
// Carbon::now()->subWeeks(1)->diffForHumans()
'1 Tydźyń ago',
'1 tydźyń ago',
// Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
'1 Tydźyń ago',
'1 tydźyń ago',
// Carbon::now()->subWeeks(2)->diffForHumans()
'2 Tydźyń ago',
'2 tydźyń ago',
// Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
'2 Tydźyń ago',
'2 tydźyń ago',
// Carbon::now()->subMonths(1)->diffForHumans()
'1 mjeśůnc ago',
// Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
Expand All @@ -180,47 +180,47 @@ class SzlPlTest extends LocalizationTestCase
// Carbon::now()->subYears(2)->diffForHumans(null, false, true)
'2 rok ago',
// Carbon::now()->addSecond()->diffForHumans()
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addSecond()->diffForHumans(null, false, true)
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now())
'1 Sekůnda after',
'1 sekůnda after',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 Sekůnda after',
'1 sekůnda after',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 Sekůnda before',
'1 sekůnda before',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 Sekůnda before',
'1 sekůnda before',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 Sekůnda',
'1 sekůnda',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
'1 Sekůnda',
'1 sekůnda',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
'2 Sekůnda',
'2 sekůnda',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
'2 Sekůnda',
'2 sekůnda',
// Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
'1 Minuta 1 Sekůnda',
'1 minuta 1 sekůnda',
// Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
'2 rok 3 mjeśůnc 1 dźyń 1 Sekůnda',
'2 rok 3 mjeśůnc 1 dźyń 1 sekůnda',
// Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
'3 rok from now',
// Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
'5 mjeśůnc ago',
// Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
'2 rok 3 mjeśůnc 1 dźyń 1 Sekůnda ago',
'2 rok 3 mjeśůnc 1 dźyń 1 sekůnda ago',
// Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
'1 Tydźyń 10 godzina',
'1 tydźyń 10 godzina',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 Tydźyń 6 dźyń',
'1 tydźyń 6 dźyń',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 Tydźyń 6 dźyń',
'1 tydźyń 6 dźyń',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
'1 Tydźyń and 6 dźyń from now',
'1 tydźyń and 6 dźyń from now',
// Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
'2 Tydźyń 1 godzina',
'2 tydźyń 1 godzina',
// Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
'1 godzina from now',
// CarbonInterval::days(2)->forHumans()
Expand Down
62 changes: 31 additions & 31 deletions tests/Localization/SzlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,21 @@ class SzlTest extends LocalizationTestCase
// Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
'0th',
// Carbon::now()->subSeconds(1)->diffForHumans()
'1 Sekůnda ago',
'1 sekůnda ago',
// Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
'1 Sekůnda ago',
'1 sekůnda ago',
// Carbon::now()->subSeconds(2)->diffForHumans()
'2 Sekůnda ago',
'2 sekůnda ago',
// Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
'2 Sekůnda ago',
'2 sekůnda ago',
// Carbon::now()->subMinutes(1)->diffForHumans()
'1 Minuta ago',
'1 minuta ago',
// Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
'1 Minuta ago',
'1 minuta ago',
// Carbon::now()->subMinutes(2)->diffForHumans()
'2 Minuta ago',
'2 minuta ago',
// Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
'2 Minuta ago',
'2 minuta ago',
// Carbon::now()->subHours(1)->diffForHumans()
'1 godzina ago',
// Carbon::now()->subHours(1)->diffForHumans(null, false, true)
Expand All @@ -156,13 +156,13 @@ class SzlTest extends LocalizationTestCase
// Carbon::now()->subDays(2)->diffForHumans(null, false, true)
'2 dźyń ago',
// Carbon::now()->subWeeks(1)->diffForHumans()
'1 Tydźyń ago',
'1 tydźyń ago',
// Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
'1 Tydźyń ago',
'1 tydźyń ago',
// Carbon::now()->subWeeks(2)->diffForHumans()
'2 Tydźyń ago',
'2 tydźyń ago',
// Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
'2 Tydźyń ago',
'2 tydźyń ago',
// Carbon::now()->subMonths(1)->diffForHumans()
'1 mjeśůnc ago',
// Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
Expand All @@ -180,47 +180,47 @@ class SzlTest extends LocalizationTestCase
// Carbon::now()->subYears(2)->diffForHumans(null, false, true)
'2 rok ago',
// Carbon::now()->addSecond()->diffForHumans()
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addSecond()->diffForHumans(null, false, true)
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now())
'1 Sekůnda after',
'1 sekůnda after',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
'1 Sekůnda after',
'1 sekůnda after',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond())
'1 Sekůnda before',
'1 sekůnda before',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
'1 Sekůnda before',
'1 sekůnda before',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
'1 Sekůnda',
'1 sekůnda',
// Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
'1 Sekůnda',
'1 sekůnda',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
'2 Sekůnda',
'2 sekůnda',
// Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
'2 Sekůnda',
'2 sekůnda',
// Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
'1 Sekůnda from now',
'1 sekůnda from now',
// Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
'1 Minuta 1 Sekůnda',
'1 minuta 1 sekůnda',
// Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
'2 rok 3 mjeśůnc 1 dźyń 1 Sekůnda',
'2 rok 3 mjeśůnc 1 dźyń 1 sekůnda',
// Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
'3 rok from now',
// Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
'5 mjeśůnc ago',
// Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
'2 rok 3 mjeśůnc 1 dźyń 1 Sekůnda ago',
'2 rok 3 mjeśůnc 1 dźyń 1 sekůnda ago',
// Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
'1 Tydźyń 10 godzina',
'1 tydźyń 10 godzina',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 Tydźyń 6 dźyń',
'1 tydźyń 6 dźyń',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
'1 Tydźyń 6 dźyń',
'1 tydźyń 6 dźyń',
// Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
'1 Tydźyń and 6 dźyń from now',
'1 tydźyń and 6 dźyń from now',
// Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
'2 Tydźyń 1 godzina',
'2 tydźyń 1 godzina',
// Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
'1 godzina from now',
// CarbonInterval::days(2)->forHumans()
Expand Down

0 comments on commit 28e0ec7

Please sign in to comment.