diff --git a/lang/germany/en/holidays.json b/lang/germany/en/holidays.json new file mode 100644 index 000000000..4202f709f --- /dev/null +++ b/lang/germany/en/holidays.json @@ -0,0 +1,21 @@ +{ + "Neujahr": "New Year", + "Heilige Drei Könige": "Epiphany", + "Tag der Arbeit": "Labour Day", + "Himmelfahrt": "Ascension Day", + "Pfingstmontag": "Whit Monday", + "Pfingstsonntag": "Whit Sunday", + "Fronleichnam": "Corpus Christi", + "Mariä Himmelfahrt": "Assumption of Mary", + "Tag der Deutschen Einheit": "German Unity Day", + "Reformationstag": "Reformation Day", + "Allerheiligen": "All Saints' Day", + "Buß- und Bettag": "Repentance and Prayer Day", + "1. Weihnachtstag": "Christmas Day", + "2. Weihnachtstag": "Second Day of Christmas", + "Ostermontag": "Easter Monday", + "Karfreitag": "Good Friday", + "Ostersonntag": "Easter Sunday", + "Internationaler Frauentag": "International Women's Day", + "Weltkindertag": "World Children's Day" +} \ No newline at end of file diff --git a/lang/germany/fr/holidays.json b/lang/germany/fr/holidays.json new file mode 100644 index 000000000..e260be7f5 --- /dev/null +++ b/lang/germany/fr/holidays.json @@ -0,0 +1,21 @@ +{ + "Neujahr": "Jour de l'An", + "Heilige Drei Könige": "Épiphanie", + "Tag der Arbeit": "Fête du Travail", + "Himmelfahrt": "Ascension", + "Pfingstmontag": "Lundi de Pentecôte", + "Pfingstsonntag": "Dimanche de Pentecôte", + "Fronleichnam": "Fête-Dieu", + "Mariä Himmelfahrt": "Assomption", + "Tag der Deutschen Einheit": "Jour de l'Unité allemande", + "Reformationstag": "Fête de la Réformation", + "Allerheiligen": "Toussaint", + "Buß- und Bettag": "Jour de pénitence et de prières", + "1. Weihnachtstag": "Noël", + "2. Weihnachtstag": "Lendemain de Noël", + "Ostermontag": "Lundi de Pâques", + "Karfreitag": "Vendredi Saint", + "Ostersonntag": "Dimanche de Pâques", + "Internationaler Frauentag": "Journée internationale des femmes", + "Weltkindertag": "Journée de l'enfance" +} \ No newline at end of file diff --git a/lang/germany/nl/holidays.json b/lang/germany/nl/holidays.json new file mode 100644 index 000000000..98f8a17cb --- /dev/null +++ b/lang/germany/nl/holidays.json @@ -0,0 +1,21 @@ +{ + "Neujahr": "Nieuwjaar", + "Heilige Drei Könige": "Driekoningen", + "Tag der Arbeit": "Dag van de Arbeid", + "Himmelfahrt": "Hemelvaart", + "Pfingstmontag": "Tweede pinksterdag", + "Pfingstsonntag": "Eerste Pinksterdag", + "Fronleichnam": "Sacramentsdag", + "Mariä Himmelfahrt": "Mariahemelvaart", + "Tag der Deutschen Einheit": "Dag van de Duitse eenheid", + "Reformationstag": "Hervormingsdag", + "Allerheiligen": "Allerheiligen", + "Buß- und Bettag": "Boete- en Biddag", + "1. Weihnachtstag": "Eerste kerstdag", + "2. Weihnachtstag": "Tweede kerstdag", + "Ostermontag": "Tweede paasdag", + "Karfreitag": "Goede Vrijdag", + "Ostersonntag": "Eerste paasdag", + "Internationaler Frauentag": "Internationale vrouwendag", + "Weltkindertag": "Kinderdag" +} \ No newline at end of file diff --git a/tests/Countries/GermanyTest.php b/tests/Countries/GermanyTest.php index b6a4f710f..9ae4e1489 100644 --- a/tests/Countries/GermanyTest.php +++ b/tests/Countries/GermanyTest.php @@ -4,6 +4,7 @@ use Carbon\CarbonImmutable; use Spatie\Holidays\Countries\Germany; +use Spatie\Holidays\Exceptions\InvalidLocale; use Spatie\Holidays\Holidays; it('can calculate german holidays', function () { @@ -78,3 +79,17 @@ ['SH', 10], ['TH', 11]] ); + +it('can calculate german holidays in local', function (string $locale, string $newYearsDayName) { + CarbonImmutable::setTestNow('2024-01-01'); + $result = Holidays::for(country: 'de', year: 2024, locale: $locale)->get(); + + expect($result)->toBeArray(); + expect($result[0]['name'])->toBe($newYearsDayName); +})->with( + [ + ['en','New Year'], + ['nl','Nieuwjaar'], + ['fr','Jour de l\'An'] + ] +); \ No newline at end of file