Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kohenkatz opened this issue May 5, 2020 · 3 comments
Closed

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

kohenkatz opened this issue May 5, 2020 · 3 comments
Assignees
Milestone

Comments

@kohenkatz
Copy link

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.
@stelgenhof
Copy link
Member

@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 stelgenhof added this to the v2.3.0 milestone Jun 3, 2020
@stelgenhof stelgenhof self-assigned this Jun 3, 2020
@stelgenhof
Copy link
Member

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

@stelgenhof
Copy link
Member

Fixed in 2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants