+
Skip to content

Conversation

KJhellico
Copy link
Collaborator

Proposed change

Update North Macedonia holidays, add l10n support (en_US, mk, uk).

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
Contributor

coderabbitai bot commented May 20, 2025

Summary by CodeRabbit

  • New Features

    • Expanded North Macedonia holiday support with detailed year-based rules and new ethnic/religious categories (Albanian, Bosnian, Catholic, Hebrew, Islamic, Orthodox, Roma, Serbian, Turkish, Vlach).
    • Added observed holiday handling and comprehensive localization for Macedonian, English (US), and Ukrainian.
    • Updated and standardized holiday data for North Macedonia, including new holidays, election days, and improved naming.
  • Documentation

    • Updated documentation to reflect new supported languages and holiday categories for North Macedonia.
  • Tests

    • Significantly expanded and restructured tests to cover all new holiday categories, year ranges, and localization scenarios.

Walkthrough

This update introduces comprehensive support for North Macedonia holidays. It expands and refactors the holiday logic, adds new ethnic and religious holiday categories, implements detailed localization in Macedonian, English, and Ukrainian, and revises the holiday dataset. The test suite is rewritten to cover all new features and localizations.

Changes

File(s) Change Summary
README.md Updated the North Macedonia entry in the documentation, specifying supported languages (en_US, mk, uk) and listing supported holiday categories (ALBANIAN, BOSNIAN, CATHOLIC, HEBREW, ISLAMIC, ORTHODOX, ROMA, SERBIAN, TURKISH, VLACH).
holidays/constants.py Added new holiday category constants: ALBANIAN, BOSNIAN, ROMA, SERBIAN, TURKISH, VLACH. Moved ARMENIAN constant to a new position alongside these additions.
holidays/countries/north_macedonia.py Refactored and expanded the North Macedonia holiday logic. The main class now inherits from additional holiday group classes, initializes new holiday groups, and uses a custom Islamic holidays class. Public holidays are redefined with year-based logic and localization. Observed holidays and new ethnic/religious holiday categories (Albanian, Bosnian, Catholic, Hebrew, Islamic, Orthodox, Roma, Serbian, Turkish, Vlach) are implemented. Orthodox holidays are split by year. Islamic holidays use fixed-date mappings. Special election days are added for 2024.
holidays/locale/en_US/LC_MESSAGES/MK.po
holidays/locale/mk/LC_MESSAGES/MK.po
holidays/locale/uk/LC_MESSAGES/MK.po
Added new localization files for North Macedonia holidays in English (en_US), Macedonian (mk), and Ukrainian (uk), providing translations for all relevant holiday names and annotations.
snapshots/countries/MK_COMMON.json Updated and expanded the holiday dataset for North Macedonia (1999–2050). Standardized and Anglicized holiday names, added new religious and ethnic holidays, included observed days, election days, and improved date mappings for Islamic holidays.
tests/countries/test_north_macedonia.py Rewrote and expanded the test suite. Added category-specific, year-based, and localization-aware tests for all supported holidays and categories. Tests verify presence, absence, observed status, and correct translations in Macedonian, English, and Ukrainian.

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch upd-north-macedonia
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7abea7a) to head (ce28995).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2554   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          219       219           
  Lines        13956     14033   +77     
  Branches      1956      1975   +19     
=========================================
+ Hits         13956     14033   +77     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (1)
holidays/locale/mk/LC_MESSAGES/MK.po (1)

1-148: ⚠️ Potential issue

Macedonian locale file missing translations.
All msgstr fields are empty, so users of the mk locale will see no holiday names. Populate each msgstr (typically identical to its msgid) to provide proper Macedonian translations.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7abea7a and ce28995.

📒 Files selected for processing (8)
  • README.md (1 hunks)
  • holidays/constants.py (1 hunks)
  • holidays/countries/north_macedonia.py (3 hunks)
  • holidays/locale/en_US/LC_MESSAGES/MK.po (1 hunks)
  • holidays/locale/mk/LC_MESSAGES/MK.po (1 hunks)
  • holidays/locale/uk/LC_MESSAGES/MK.po (1 hunks)
  • snapshots/countries/MK_COMMON.json (1 hunks)
  • tests/countries/test_north_macedonia.py (1 hunks)
🔇 Additional comments (7)
holidays/constants.py (1)

60-67: Global holiday category constants added.
The new constants (ALBANIAN, ARMENIAN, BOSNIAN, ROMA, SERBIAN, TURKISH, VLACH) are introduced alphabetically and follow the existing lowercase naming convention. Please ensure these categories are consumed by the North Macedonia country class’s supported_categories list.

README.md (1)

966-967: README updated for North Macedonia.
The “Supported Languages” and “Supported Categories” columns now correctly list en_US, mk, uk and the expanded holiday categories (ALBANIAN, BOSNIAN, CATHOLIC, HEBREW, ISLAMIC, ORTHODOX, ROMA, SERBIAN, TURKISH, VLACH), matching the code changes in constants and locale files.

holidays/locale/en_US/LC_MESSAGES/MK.po (1)

1-148: New English localization file appears complete.
All msgstr entries are populated appropriately, and header metadata (Project-Id-Version, language, creation date) is correct. No untranslated strings detected.

holidays/locale/uk/LC_MESSAGES/MK.po (1)

1-148: Ukrainian localization added successfully.
The msgstr entries are fully populated with accurate Ukrainian translations, including status annotations (приблизна дата) and (вихідний). Header metadata is in order.

snapshots/countries/MK_COMMON.json (1)

1-15: Verify snapshot language consistency with new default mk.

The snapshot still stores English labels while NorthMacedonia.default_language is now "mk".
Double-check that the snapshot generator is explicitly instantiated with language="en_US"; otherwise, the CI “snapshot compare” step may start failing.
No action needed if the generator already forces the locale.

holidays/countries/north_macedonia.py (1)

264-303:

❓ Verification inconclusive

Extend fixed Islamic date tables beyond 2025.

Static mappings stop at 2025, yet the module serves data to 2050.
After 2025 every Eid is flagged estimated, sacrificing accuracy.
If authoritative dates are available, pre-populate the tables:

+    2029: (APR, 24),
+    2030: (APR, 13),
+    # … up to 2050

Apply the same treatment to EID_AL_FITR_DATES.


Extend static Islamic holiday mappings through 2050

The NorthMacedoniaIslamicHolidays class currently hard-codes Eid al-Adha and Eid al-Fitr only up to 2025; after that the library falls back to estimated dates. If you have authoritative dates through 2050, please add them to improve accuracy.

• File: holidays/countries/north_macedonia.py
Lines: 264–303

Suggested diff format:

 class NorthMacedoniaIslamicHolidays(_CustomIslamicHolidays):
     EID_AL_ADHA_DATES = {
         …,
         2025: (JUN, 6),
+        2026: (MAY, 27),
+        2027: (MAY, 17),
+        2028: (MAY, 6),
+        2029: (APR, 24),
+        # … continue through 2050
     }

     EID_AL_FITR_DATES = {
         …,
         2025: (MAR, 30),
+        2026: (MAR, 20),
+        2027: (MAR, 10),
+        2028: (FEB, 27),
+        2029: (FEB, 16),
+        # … continue through 2050
     }

Please confirm you have reliable sources for the post-2025 dates before merging.

tests/countries/test_north_macedonia.py (1)

110-112: range() objects may not be what assertHolidayName expects.

Several assertions pass range(...) directly (e.g. range(2007, 2050)).
Unless the helper expands those integers into concrete ISO-date strings, the comparison is effectively no-op.
Please verify and, if needed, replace with an explicit generator:

(f"{year}-04-20" for year in range(2007, 2050))

@arkid15r arkid15r enabled auto-merge May 21, 2025 18:59
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.

LGTM 👍

Copy link
Collaborator

@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.

LGTM, great work as always 🇲🇰

@arkid15r arkid15r added this pull request to the merge queue May 22, 2025
Merged via the queue into vacanza:dev with commit 5a1a219 May 22, 2025
33 checks passed
@KJhellico KJhellico deleted the upd-north-macedonia branch May 22, 2025 10:32
@arkid15r arkid15r mentioned this pull request Jun 2, 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

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载