Skip to content

Commit

Permalink
feat: Add Bangla language support for Bangladeshi holidays (#182)
Browse files Browse the repository at this point in the history
* feat: Add Bangla language support for Bangladeshi holidays

* fix: Return Bengali Names in English by default insted Bangla font

* fix: Unit testing
  • Loading branch information
jfBiswajit authored Jan 30, 2024
1 parent 34f55ba commit 17c7849
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lang/bangladesh/bn/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"International Mother Language Day": "Antorjatik Matribhasha Dibos",
"Birthday of Sheikh Mujibur Rahman": "Shekh Mujibur Rahmaner Jonmodin",
"Independence Day": "Swadhinota Dibos",
"Bengali New Year": "Bangla Noboborsho",
"May Day": "Antorjatik Shrom Dibos",
"National Mourning Day": "Jatiyo Shok Dibos",
"Victory Day": "Bijoy Dibos",
"Christmas Day": "Borodin"
}
10 changes: 10 additions & 0 deletions lang/bangladesh/en/holidays.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"International Mother Language Day": "International Mother Language Day",
"Birthday of Sheikh Mujibur Rahman": "Birthday of Sheikh Mujibur Rahman",
"Independence Day": "Independence Day",
"Bengali New Year": "Bengali New Year",
"May Day": "May Day",
"National Mourning Day": "National Mourning Day",
"Victory Day": "Victory Day",
"Christmas Day": "Christmas Day"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"name": "Antorjatik Matribhasha Dibos",
"date": "2024-02-21"
},
{
"name": "Shekh Mujibur Rahmaner Jonmodin",
"date": "2024-03-17"
},
{
"name": "Swadhinota Dibos",
"date": "2024-03-26"
},
{
"name": "Bangla Noboborsho",
"date": "2024-04-14"
},
{
"name": "Antorjatik Shrom Dibos",
"date": "2024-05-01"
},
{
"name": "Jatiyo Shok Dibos",
"date": "2024-08-15"
},
{
"name": "Bijoy Dibos",
"date": "2024-12-16"
},
{
"name": "Borodin",
"date": "2024-12-25"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"name": "International Mother Language Day",
"date": "2024-02-21"
},
{
"name": "Birthday of Sheikh Mujibur Rahman",
"date": "2024-03-17"
},
{
"name": "Independence Day",
"date": "2024-03-26"
},
{
"name": "Bengali New Year",
"date": "2024-04-14"
},
{
"name": "May Day",
"date": "2024-05-01"
},
{
"name": "National Mourning Day",
"date": "2024-08-15"
},
{
"name": "Victory Day",
"date": "2024-12-16"
},
{
"name": "Christmas Day",
"date": "2024-12-25"
}
]
24 changes: 24 additions & 0 deletions tests/Countries/BangladeshTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,27 @@

expect(formatDates($holidays))->toMatchSnapshot();
});

it('can calculate bangladesh holidays in English', function () {
CarbonImmutable::setTestNow('2024-01-01');

$holidays = Holidays::for(country: 'bd', locale: 'en')->get();

expect($holidays)
->toBeArray()
->not()->toBeEmpty();

expect(formatDates($holidays))->toMatchSnapshot();
});

it('can calculate bangladesh holidays in Bangla', function () {
CarbonImmutable::setTestNow('2024-01-01');

$holidays = Holidays::for(country: 'bd', locale: 'bn')->get();

expect($holidays)
->toBeArray()
->not()->toBeEmpty();

expect(formatDates($holidays))->toMatchSnapshot();
});

0 comments on commit 17c7849

Please sign in to comment.