azuyalabs/yasumi

American "Labor Day" should be spelled the American way

kohenkatz opened this issue · 3 comments

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:

  • I would put it in Yasumi\Provider\USA since I think Americans should see the other countries' version with a "u" and other countries should see the American holiday without a "u", but that requires also duplicating data/translations/labourDay.php as data/translations/laborDay.php.
  • I thought of just adding a line 'en_US' => 'Labor Day' to the translation file, but that would make other countries' Labour Days also spelled the American way when viewed by an American, and that's not what we want.

@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

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

Fixed in 2.3.0