Skip to content

Commit

Permalink
fixes for Bosnia
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Mar 22, 2024
1 parent 6ce8f02 commit 147eaf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/Countries/BosniaAndHerzegovina.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion tests/Countries/BosniaAndHerzegovinaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 147eaf8

Please sign in to comment.