generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
188 changed files
with
7,449 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: Fix PHP code style issues | ||
|
||
on: [push] | ||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: write | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Новы год": "Novy hod", | ||
"Новы год (другі дзень)": "Novy hod (druhi dzień)", | ||
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Naradžeńnie Chrystova (pravasłaŭnaje Rastvo)", | ||
"Дзень жанчын": "Dzień žančyn", | ||
"Свята працы": "Sviata pracy", | ||
"Дзень Перамогі": "Dzień Pieramohi", | ||
"Дзень Незалежнасці": "Dzień Niezaležnaści", | ||
"Дзень Кастрычніцкай рэвалюцыі": "Dzień Kastryčnickaj revalucyi", | ||
"Нараджэнне Хрыстова (каталіцкае Раство)": "Naradžeńnie Chrystova (katalickaje Rastvo)", | ||
"Радаўніца": "Radaŭnica" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Новы год": "New Year's Day", | ||
"Новы год (другі дзень)": "New Year's Day (second day)", | ||
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Orthodox Christmas", | ||
"Дзень жанчын": "Women's Day", | ||
"Свята працы": "Labor Day", | ||
"Дзень Перамогі": "Victory Day", | ||
"Дзень Незалежнасці": "Independence Day", | ||
"Дзень Кастрычніцкай рэвалюцыі": "October Revolution Day", | ||
"Нараджэнне Хрыстова (каталіцкае Раство)": "Catholic Christmas", | ||
"Радаўніца": "Radaunitsa" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Новы год": "Новый год", | ||
"Новы год (другі дзень)": "Новый год (второй день)", | ||
"Нараджэнне Хрыстова (праваслаўнае Раство)": "Православное Рождество", | ||
"Дзень жанчын": "Международный женский день", | ||
"Свята працы": "День труда", | ||
"Дзень Перамогі": "День Победы", | ||
"Дзень Незалежнасці": "День Независимости", | ||
"Дзень Кастрычніцкай рэвалюцыі": "День Октябрьской революции", | ||
"Нараджэнне Хрыстова (каталіцкае Раство)": "Католическое Рождество", | ||
"Радаўніца": "Радуница" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Nieuwjaar": "Jour de l'An", | ||
"Dag van de Arbeid": "Fête du Travail", | ||
"Nationale Feestdag": "Fête nationale", | ||
"OLV Hemelvaart": "Assomption", | ||
"Allerheiligen": "Toussaint", | ||
"Wapenstilstand": "Armistice", | ||
"Kerstmis": "Noël", | ||
"Paasmaandag": "Lundi de Pâques", | ||
"OLH Hemelvaart": "Ascension", | ||
"Pinkstermaandag": "Lundi de Pentecôte" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"Uudenvuodenpäivä": "Nyårsdagen", | ||
"Loppiainen": "Trettondagen", | ||
"Pitkäperjantai": "Långfredagen", | ||
"Pääsiäispäivä": "Påskdagen", | ||
"Toinen pääsiäispäivä": "Annandag påsk", | ||
"Vappu": "Första maj", | ||
"Helatorstai": "Kristi himmelsfärdsdag", | ||
"Helluntaipäivä": "Pingst", | ||
"Juhannuspäivä": "Midsommardagen", | ||
"Pyhäinpäivä": "Alla helgons dag", | ||
"Itsenäisyyspäivä": "Självständighetsdagen", | ||
"Joulupäivä": "Juldagen", | ||
"Tapaninpäivä": "Annandag jul" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"Nova godina - prvi dan": "New Year - first day", | ||
"Nova godina - drugi dan": "New Year - second day", | ||
"Badnji dan": "Christmas Eve", | ||
"Božić - prvi dan": "Christmas - first day", | ||
"Božić - drugi dan": "Christmas - second day", | ||
"Praznik rada - prvi dan": "Labour Day - first day", | ||
"Praznik rada - drugi dan": "Labour Day - second day", | ||
"Veliki petak": "Good Friday", | ||
"Vaskrs": "Easter", | ||
"Vaskršnji ponedjeljak": "Easter Monday", | ||
"Dan nezavisnosti - prvi dan": "Independence Day - first day", | ||
"Dan nezavisnosti - drugi dan": "Independence Day - second day", | ||
"Dan državnosti - prvi dan": "National Day - first day", | ||
"Dan državnosti - drugi dan": "National Day - second day", | ||
"Njegošev dan - prvi dan": "Njegoš's Day - first day", | ||
"Njegošev dan - drugi dan": "Njegoš's Day - second day" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"Nova godina - prvi dan": "Nova godina - prvi dan", | ||
"Nova godina - drugi dan": "Nova godina - drugi dan", | ||
"Badnji dan": "Badnji dan", | ||
"Božić - prvi dan": "Božić - prvi dan", | ||
"Božić - drugi dan": "Božić - drugi dan", | ||
"Praznik rada - prvi dan": "Praznik rada - prvi dan", | ||
"Praznik rada - drugi dan": "Praznik rada - drugi dan", | ||
"Veliki petak": "Veliki petak", | ||
"Vaskrs": "Vaskrs", | ||
"Vaskršnji ponedjeljak": "Vaskršnji ponedeljak", | ||
"Dan nezavisnosti - prvi dan": "Dan nezavisnosti - prvi dan", | ||
"Dan nezavisnosti - drugi dan": "Dan nezavisnosti - drugi dan", | ||
"Dan državnosti - prvi dan": "Dan državnosti - prvi dan", | ||
"Dan državnosti - drugi dan": "Dan državnosti - drugi dan", | ||
"Njegošev dan - prvi dan": "Njegošev dan - prvi dan", | ||
"Njegošev dan - drugi dan": "Njegošev dan - drugi dan" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Spatie\Holidays\Concerns; | ||
|
||
use Spatie\Holidays\Exceptions\InvalidLocale; | ||
|
||
trait Translatable | ||
{ | ||
protected function translate(string $country, string $name, ?string $locale = null): string | ||
{ | ||
if ($locale === null) { | ||
return $name; | ||
} | ||
|
||
$countryName = strtolower($country); | ||
$filePath = __DIR__."/../../lang/{$countryName}/{$locale}/holidays.json"; | ||
|
||
if (file_exists($filePath)) { | ||
$content = file_get_contents($filePath); | ||
} else { | ||
throw InvalidLocale::notFound($country, $locale); | ||
} | ||
|
||
if ($content === false) { | ||
throw InvalidLocale::notFound($country, $locale); | ||
} | ||
|
||
/** @var array<string, string> $data */ | ||
$data = json_decode($content, true); | ||
|
||
if (! isset($data[$name])) { | ||
return $name; | ||
} | ||
|
||
return $data[$name]; | ||
} | ||
} |
Oops, something went wrong.