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

Update United Kingdom & Isle of Man holidays: add l10n support #2258

Merged
merged 8 commits into from
Feb 10, 2025

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Jan 31, 2025

Proposed change

Add en_GB, en_US, th localization for the United Kingdom (gb) and Isle of Man (im).

Note

  • As the Isle of Man is simply overriding UK's implementation at the moment, both need to have l10n support to work properly. This needs to be factored in for future French/US/Netherlands overseas territories as well i.e. Refactor Aruba/Curaçao as NL subdivision #1852 .
  • I have verified that the Isle of Man's government website uses British English (en_GB) rather than the Manx English (en_IM) dialect.
  • The current l10n implementation requires all relevant l10n entries to be copied to the overriding entity as well, rather than simply having 5 l10n entries for IM file. This limitation is hopefully resolved in the v1 implementation.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cb2a27d) to head (6f3a0a1).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2258   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          200       200           
  Lines        12200     12215   +15     
  Branches      1735      1737    +2     
=========================================
+ Hits         12200     12215   +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small fix:

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
Signed-off-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
arkid15r
arkid15r previously approved these changes Jan 31, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR 👍

@arkid15r arkid15r enabled auto-merge January 31, 2025 23:51
@arkid15r arkid15r added this pull request to the merge queue Jan 31, 2025
@arkid15r arkid15r removed this pull request from the merge queue due to a manual request Feb 1, 2025
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to merge it, added to the merge queue while test were green.

In parallel I was checking something locally. So it seems that at least at my localhost make l10n (technically it's scripts/l10n/generate_po_files.py) produces some changes specifically in IM.po files. It may be related to the derived from UK situation - the script keeps items that originate from isle_of_man.py file while removing everything else.

im

I had thought it'd be great if someone else looked at it and removed it from the queue before the CI/CD was done.

@KJhellico
Copy link
Collaborator

@PPsyrius, look at my PR in your repo. It seems to be working. 🙂

@PPsyrius PPsyrius marked this pull request as draft February 4, 2025 12:46
@PPsyrius PPsyrius marked this pull request as ready for review February 5, 2025 02:40
Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to use parent_entity in v1 so it may be a good idea to introduce it here too in order keep the parent translation logic simple. We can also migrate to composition approach for entities like IM.

@KJhellico @PPsyrius please review and test.

Copy link
Collaborator Author

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arkid15r I can confirm that it's now working as intended with your latest changes in ❤️

>>> import holidays
>>> print(holidays.IM(years=2024, language="th"))

{datetime.date(2024, 3, 29): 'วันศุกร์ประเสริฐ', datetime.date(2024, 5, 6): 'วันเมย์เดย์', datetime.date(2024, 5, 27): 'วันหยุดฤดูใบไม้ผลิของธนาคาร', datetime.date(2024, 4, 1): 'วันจันทร์อีสเตอร์', datetime.date(2024, 8, 26): 'วันหยุดช่วงปลายฤดูร้อนของธนาคาร', datetime.date(2024, 6, 7): 'วันแข่งไอร์ออฟแมน ทีที', datetime.date(2024, 7, 5): 'วันไทน์วอลด์', datetime.date(2024, 1, 1): 'วันขึ้นปีใหม่', datetime.date(2024, 12, 25): 'วันคริสต์มาส', datetime.date(2024, 12, 26): 'วันเปิดกล่องของขวัญ'}

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@arkid15r arkid15r added this pull request to the merge queue Feb 10, 2025
Merged via the queue into vacanza:dev with commit ecd0117 Feb 10, 2025
32 checks passed
@PPsyrius PPsyrius deleted the gb_l10n branch February 11, 2025 03:40
@KJhellico KJhellico mentioned this pull request Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants