Skip to content

Commit 147eaf8

Browse files
committed
fixes for Bosnia
1 parent 6ce8f02 commit 147eaf8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Countries/BosniaAndHerzegovina.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
namespace Spatie\Holidays\Countries;
44

55
use Carbon\CarbonImmutable;
6+
use Spatie\Holidays\Concerns\Translatable;
7+
use Spatie\Holidays\Contracts\HasTranslations;
68
use Spatie\Holidays\Exceptions\InvalidRegion;
79

8-
class BosniaAndHerzegovina extends Country
10+
class BosniaAndHerzegovina extends Country implements HasTranslations
911
{
10-
private const REGIONS = [
12+
use Translatable;
13+
14+
protected const REGIONS = [
1115
'ba-rs',
1216
'ba-fbih',
1317
'ba-bd',
@@ -25,6 +29,11 @@ public function countryCode(): string
2529
return 'ba';
2630
}
2731

32+
public function defaultLocale(): string
33+
{
34+
return 'hr';
35+
}
36+
2837
protected function allHolidays(int $year): array
2938
{
3039
return array_merge([

tests/Countries/BosniaAndHerzegovinaTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
});
3535

3636
it('can translate holidays into english', function () {
37-
$holidays = Holidays::for(country: 'ba', locale: 'en', year: 2024)->get();
37+
$holidays = Holidays::for(country: 'ba', year: 2024, locale: 'en')->get();
3838

3939
expect($holidays)
4040
->toBeArray()

0 commit comments

Comments
 (0)