From 147eaf81adfaf4d8d3e2c854c808006d84663c29 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:31:42 +0100 Subject: [PATCH] fixes for Bosnia --- src/Countries/BosniaAndHerzegovina.php | 13 +++++++++++-- tests/Countries/BosniaAndHerzegovinaTest.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Countries/BosniaAndHerzegovina.php b/src/Countries/BosniaAndHerzegovina.php index 0e28ac74a..24021be13 100644 --- a/src/Countries/BosniaAndHerzegovina.php +++ b/src/Countries/BosniaAndHerzegovina.php @@ -3,11 +3,15 @@ namespace Spatie\Holidays\Countries; use Carbon\CarbonImmutable; +use Spatie\Holidays\Concerns\Translatable; +use Spatie\Holidays\Contracts\HasTranslations; use Spatie\Holidays\Exceptions\InvalidRegion; -class BosniaAndHerzegovina extends Country +class BosniaAndHerzegovina extends Country implements HasTranslations { - private const REGIONS = [ + use Translatable; + + protected const REGIONS = [ 'ba-rs', 'ba-fbih', 'ba-bd', @@ -25,6 +29,11 @@ public function countryCode(): string return 'ba'; } + public function defaultLocale(): string + { + return 'hr'; + } + protected function allHolidays(int $year): array { return array_merge([ diff --git a/tests/Countries/BosniaAndHerzegovinaTest.php b/tests/Countries/BosniaAndHerzegovinaTest.php index 9dcc2cf5d..1392ca2e8 100644 --- a/tests/Countries/BosniaAndHerzegovinaTest.php +++ b/tests/Countries/BosniaAndHerzegovinaTest.php @@ -34,7 +34,7 @@ }); it('can translate holidays into english', function () { - $holidays = Holidays::for(country: 'ba', locale: 'en', year: 2024)->get(); + $holidays = Holidays::for(country: 'ba', year: 2024, locale: 'en')->get(); expect($holidays) ->toBeArray()