azuyalabs / yasumi

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

Missing translations for UK Substitutes #134

Closed gRoberts84 closed 5 years ago

gRoberts84 commented 5 years ago

Is there any particular reason why there aren't any translations for UK Substitutes?

object(Yasumi\Holiday)#861 (7) {
  ["shortName"]=>
  string(36) "substituteHoliday:secondChristmasDay"
  ["translations"]=>
  array(0) {
  }
  ["type":"Yasumi\Holiday":private]=>
  string(4) "bank"
  ["displayLocale":"Yasumi\Holiday":private]=>
  string(5) "en_GB"
  ["date"]=>
  string(26) "2027-12-28 00:00:00.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(13) "Europe/London"
}

Just trying to work out how to handle them, asides from ignoring them because they won't make any sense to a user?

stelgenhof commented 5 years ago

That shouldn't be the case I think. Just tested this with the USA holiday provider for the year 2016 (when Christmas Day had a substitution), and I can see the translations in the instance.

Would you perhaps share your code/script how you got these results? That would help me assist/debug this issue.

As for the substitutes: they are useful because sometimes you want to know when the original date of the holiday was and when it was substituted (i.e. observed). For example, Christmas in the USA in 2016 is still on the 25th of December, but the USA federal government has decided a non-working day was established on the 26th, since the 25th was on a Sunday.

If for your case the substitute holidays aren't needed, you can easily filter them out (using the prefix).

Cheers! Sacha

stelgenhof commented 5 years ago

@gRoberts84 Just wanted to check whether you had time to view my last comment.

stelgenhof commented 5 years ago

Closing this issue as there as been no activity/response for some time.