azuyalabs / yasumi

The easy PHP Library for calculating holidays
https://www.yasumi.dev
Other
1.04k stars 152 forks source link

American "Labor Day" should be spelled the American way #216

Closed kohenkatz closed 4 years ago

kohenkatz commented 4 years ago

For other countries that have a "Labour Day", using the British/Canadian/Australian/etc spelling makes sense.

However, in the USA, the spelling should be "Labor Day".

I would make a PR for this, except that I'm not sure what is the best way to handle it:

stelgenhof commented 4 years ago

@kohenkatz Thank you for noticing this. The way to handle this by Yasumi is to add translations of a holiday in the respective file (in this case labourDay.php (Not that the filename just represents the internal name used by Yasumi and not it's translations)

For displaying the correct spelling depending on the user, you can pass a locale parameter with the getName() method. This accepts an array of locales to be searched for translations. E.g if ['en_US', 'de_AT'] is provided, the following lookup priority is used: en_US → en → de_AT → de.

So. simply adding the en_US translation to the labourDay file is sufficient to allow for any possible situation :)

Cheers! Sacha

stelgenhof commented 4 years ago

@kohenkatz I've added a correct spelling in the 'dev' branch. It will be part of the upcoming 2.3.0 release.

stelgenhof commented 4 years ago

Fixed in 2.3.0