+
Skip to content

Conversation

Roshan-1024
Copy link
Contributor

@Roshan-1024 Roshan-1024 commented Apr 2, 2025

Proposed change

Add Trinidad and Tobago holidays

Resolves #1289 .

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 Apr 2, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Trinidad and Tobago holidays, including public and optional holidays, with coverage from 1963 onward.
    • Introduced aliases and language support for "en_TT" (default) and "en_US" locales.
    • Provided localized holiday names for Trinidad and Tobago in both English (Trinidad and Tobago) and English (US).
  • Documentation

    • Updated documentation to reflect the addition of Trinidad and Tobago as a supported country.
  • Tests

    • Added comprehensive tests to verify Trinidad and Tobago holiday calculations, aliases, optional holidays, and localization.

Summary by CodeRabbit

  • New Features

    • Added support for Trinidad and Tobago holidays, including both public and optional holidays such as Carnival Monday and Tuesday.
    • Trinidad and Tobago is now available as a selectable country, with support for English (en_TT, en_US) language localizations.
  • Localization

    • Introduced English (Trinidad and Tobago) and English (US) translations for all Trinidad and Tobago holiday names.
  • Documentation

    • Updated documentation to list Trinidad and Tobago as a supported country.
  • Tests

    • Added comprehensive tests to ensure correct holiday calculation and localization for Trinidad and Tobago.

Walkthrough

This pull request introduces comprehensive support for Trinidad and Tobago within the holidays library. It updates the documentation to reflect the addition of the country, adds holiday-related classes, and modifies import statements accordingly. The country registry is enhanced to recognize Trinidad and Tobago, and unit tests are created to ensure the new functionality works correctly. Additionally, localization files are included for both English (Trinidad and Tobago) and English (US).

Changes

File(s) Change Summary
README.md Added entry for Trinidad and Tobago with code TT and languages en_TT, en_US.
holidays/countries/init.py Added import for Trinidad and Tobago: from .trinidad_and_tobago import TrinidadAndTobago, TT, TTO.
holidays/countries/trinidad_and_tobago.py Added new module defining TrinidadAndTobago class with public and optional holidays, aliases, and custom holiday classes for Islamic and Hindu holidays.
holidays/registry.py Added "trinidad_and_tobago": ("TrinidadAndTobago", "TT", "TTO") entry to the COUNTRIES dictionary.
tests/countries/test_trinidad_and_tobago.py Added comprehensive test suite covering holiday presence, aliases, localization, and optional holidays for Trinidad and Tobago.
holidays/locale/en_TT/LC_MESSAGES/TT.po Added localization strings for Trinidad and Tobago holidays (English Trinidad and Tobago).
holidays/locale/en_US/LC_MESSAGES/TT.po Added localization strings for Trinidad and Tobago holidays (English US).

Assessment against linked issues

Objective Addressed Explanation
Add Trinidad and Tobago holidays (#1289)

Suggested reviewers

  • KJhellico
  • PPsyrius
  • arkid15r
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@github-actions github-actions bot added the test label Apr 2, 2025
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: 4

🔭 Outside diff range comments (1)
holidays/countries/trinidad_and_tobago.py (1)

13-34: 💡 Verification agent

🧩 Analysis chain

Verify completeness of implementation against other country classes.

This implementation doesn't include any actual holiday definitions, which is essential for the library to function properly. Please review other country implementations in the repository for the expected structure and holiday definition pattern.


🏁 Script executed:

#!/bin/bash
# Check structure of another country implementation for reference
echo "Examining how holidays are implemented in another country file:"
fd --type file --extension py --exclude __init__.py --exclude __pycache__ --max-depth 1 . holidays/countries | head -n 1 | xargs cat | head -n 50

Length of output: 1822


Missing Essential Holiday Definitions

The Trinidad and Tobago module only sets the country code and alias classes without implementing any holiday definitions—unlike other country files (e.g., Afghanistan) where holiday definitions and additional attributes (like default_language, start_year, etc.) are provided.

  • Action Required:
    • Review the structure and holiday definition patterns used in other country modules.
    • Implement the missing holiday logic (e.g., override the relevant method to add Trinidad and Tobago holidays) to ensure the library functions correctly.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b870ccf and 457d1e7.

📒 Files selected for processing (5)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_trinidad_and_tobago.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
holidays/countries/__init__.py (1)
holidays/countries/trinidad_and_tobago.py (3)
  • TrinidadAndTobago (16-25)
  • TT (28-29)
  • TTO (32-33)
tests/countries/test_trinidad_and_tobago.py (1)
holidays/countries/trinidad_and_tobago.py (3)
  • TrinidadAndTobago (16-25)
  • TT (28-29)
  • TTO (32-33)
🔇 Additional comments (5)
holidays/registry.py (1)

168-168: Trinidad and Tobago entry added correctly

The entry for Trinidad and Tobago follows the established pattern with proper mapping of country name to class name and ISO codes (TT, TTO). The entry is also inserted in alphabetical order.

README.md (2)

102-102: Correct update to supported country count

The update from 162 to 163 accurately reflects the addition of Trinidad and Tobago to the supported countries list.


1159-1164: Trinidad and Tobago entry added correctly

The entry follows the established table format with proper country name, code (TT), and supported language (en_US).

holidays/countries/__init__.py (1)

160-160: Appropriate import for Trinidad and Tobago holiday classes

The import statement correctly references the holiday classes in alphabetical order, consistent with the pattern used for other countries.

tests/countries/test_trinidad_and_tobago.py (1)

20-26: Test implementation looks good

The test correctly sets up and verifies the country aliases (TT and TTO) for Trinidad and Tobago.

Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d46f3e1) to head (2ec7665).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2402   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          215       216    +1     
  Lines        13600     13657   +57     
  Branches      1931      1930    -1     
=========================================
+ Hits         13600     13657   +57     

☔ 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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 457d1e7 and 5026bec.

📒 Files selected for processing (2)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
  • tests/countries/test_trinidad_and_tobago.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:16.563Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:16.563Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T04:54:07.204Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
🧬 Code Definitions (1)
tests/countries/test_trinidad_and_tobago.py (1)
holidays/countries/trinidad_and_tobago.py (3)
  • TrinidadAndTobago (23-86)
  • TT (89-90)
  • TTO (93-94)
🔇 Additional comments (5)
tests/countries/test_trinidad_and_tobago.py (2)

1-9: File header and imports look fine.
The license header and imports are aligned with existing test patterns.


19-23: Test class definition is consistent with library standards.
The setUpClass pattern matches other country tests, ensuring TrinidadAndTobago is properly instantiated.

holidays/countries/trinidad_and_tobago.py (3)

13-19: Imports appear correct.
The chosen mix of holiday groups matches Trinidad and Tobago’s observed holidays.


23-32: Main class structure is good.
Defining country = "TT" is consistent. The docstring references are helpful.


89-94: Alias classes follow project conventions.
No docstrings are necessary based on existing guidelines.

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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5026bec and 37ee67b.

📒 Files selected for processing (1)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:16.563Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:16.563Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T04:54:07.204Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
🔇 Additional comments (3)
holidays/countries/trinidad_and_tobago.py (3)

23-42: The TrinidadAndTobago class implementation looks good.

The class is well-structured with proper inheritance, docstring, references, and initialization. The country code is correctly set to "TT".


43-88: Holiday definitions implementation is correct and comprehensive.

The implementation includes all major holidays of Trinidad and Tobago following the library's helper method pattern. The code effectively handles various types of holidays including Christian, Hindu, and Islamic observances.


90-95: Alias classes correctly follow library conventions.

The alias classes TT and TTO are implemented as simple pass-through classes without docstrings, which is consistent with the library's conventions for country code aliases.

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: 4

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc0a525 and 82e45a7.

📒 Files selected for processing (7)
  • README.md (2 hunks)
  • holidays/countries/__init__.py (1 hunks)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
  • holidays/locale/en_TT/LC_MESSAGES/TT.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TT.po (1 hunks)
  • holidays/registry.py (1 hunks)
  • tests/countries/test_trinidad_and_tobago.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
README.md (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
🧬 Code Definitions (2)
tests/countries/test_trinidad_and_tobago.py (1)
holidays/countries/trinidad_and_tobago.py (3)
  • TrinidadAndTobago (26-110)
  • TT (113-114)
  • TTO (117-118)
holidays/countries/__init__.py (1)
holidays/countries/trinidad_and_tobago.py (3)
  • TrinidadAndTobago (26-110)
  • TT (113-114)
  • TTO (117-118)
🔇 Additional comments (15)
holidays/registry.py (1)

169-169: Addition of Trinidad and Tobago to the COUNTRIES registry looks good.

The new entry follows the standard format used for other countries in the registry. The country name and ISO codes are correctly provided.

README.md (2)

102-102: Correctly updated country count.

The count of supported countries has been properly incremented from 163 to 164 to reflect the addition of Trinidad and Tobago.


1166-1171: Trinidad and Tobago entry looks good.

The table entry for Trinidad and Tobago includes all necessary information consistent with other country entries:

  • Country name: Trinidad and Tobago
  • ISO code: TT
  • Supported languages: en_TT (default), en_US

This implementation follows the guidance for English-speaking countries to include both the regional code variant (en_TT) and en_US.

holidays/countries/__init__.py (1)

161-161: Import for Trinidad and Tobago class and aliases looks good.

The import statement follows the pattern used for other countries and correctly imports the main class and its aliases.

tests/countries/test_trinidad_and_tobago.py (1)

19-23: Test class setup is correct.

The test class inherits from the appropriate base classes and properly initializes the test with the Trinidad and Tobago holiday class.

holidays/countries/trinidad_and_tobago.py (7)

13-22: Clean and relevant imports.
These imports cover all necessary modules for holiday calculations and translation, aligning well with the library’s structure.


26-38: Solid class definition and docstring.
Referencing official sources and providing an overview for TrinidadAndTobago holidays is clear and helpful.


40-46: Attributes are set thoughtfully.
Including default_language, supported_languages, and start_year aligns with best practices for consistency in the library.


48-62: Constructor calls are well-structured.
Calling each parent class before calling super().__init__ is correct for multiple inheritance.


63-111: Holiday population is thorough.
All major holidays appear covered with appropriate method calls. Please ensure that _add_carnival_monday and _add_carnival_tuesday methods exist in the library and are fully tested.


113-119: Alias classes comply with convention.
The minimal pass-through aliases match the standard approach for ISO 3166 codes.


121-165: Well-defined Islamic holiday data.
Storing known Eid al-Adha and Eid al-Fitr dates ensures accurate coverage for past and near-future years. Nicely done.

holidays/locale/en_TT/LC_MESSAGES/TT.po (2)

16-29: Metadata Block is Well-Structured
The header block correctly follows gettext conventions with all the required metadata fields. Please make sure to update placeholder fields (like translator and author details) before production if needed.


1-15: Overall PO File Structure Looks Good
The file includes detailed holiday entries and follows the standard PO file format. Each holiday entry is clearly labeled and the structure should integrate well within the localization framework for Trinidad and Tobago.

Also applies to: 30-38, 43-98

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

1-14: PO File Content is Consistent and Clear
The file mirrors the structure of the en_TT file with explicit translation values (which are identical to the msgid), making it appropriate for the en_US locale. The translations are clear and will help maintain consistency in holiday presentation.

Also applies to: 18-38, 43-98

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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26a833e and 764a4e4.

📒 Files selected for processing (1)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
🔇 Additional comments (4)
holidays/countries/trinidad_and_tobago.py (4)

42-46: Languages appear correctly configured.
Including both “en_TT” and “en_US” meets the library guidelines and user preferences for English-speaking countries.


115-120: Alias classes match library conventions.
The minimal pass-through alias classes match the standard approach.


65-113:

✅ Verification successful

Confirm that _populate_public_holidays is invoked.
Double-check that the _populate_public_holidays method is actually called by the inherited base logic. Otherwise, these holidays won’t be added.


🏁 Script executed:

#!/bin/bash
# Search for calls to _populate_public_holidays to confirm it’s triggered by the base class logic
rg "_populate_public_holidays" -A 3 -B 3

Length of output: 66344


_populate_public_holidays is correctly invoked by the base class logic.
Our repository search confirms that the Trinidad and Tobago holidays module follows the same pattern as other country modules—calling its base class initializer (using super().init(*args, **kwargs)) which in turn triggers the _populate_public_holidays method. No issues were found.


37-37:

❓ Verification inconclusive

Validate the Saudi Arabia reference.
The link at line 37 refers to Saudi Arabia’s holidays. Please confirm that referencing this source for Trinidad and Tobago is correct.


🏁 Script executed:

#!/bin/bash
# Verify that the Eid al-Adha dates match Trinidad and Tobago’s official sources.
# Use external references or official TnT government/press releases for cross-check.

echo "Checking official references for Eid al-Adha in TnT..."
# Potential approach:
# 1) Query official TnT Gov sources or the library's references for actual Eid al-Adha dates.
# 2) Compare with the dates used here to confirm correctness.
# (Implementation steps would go here)

Length of output: 118


Validate Trinidad and Tobago Holiday Reference

The Eid al-Adha link currently points to the Saudi Arabia holidays page. The verification script output didn’t confirm that this source is applicable for Trinidad and Tobago. Please double-check if Trinidad and Tobago’s official sources or press releases support using this reference. If not, update the link to point to a relevant Trinidad and Tobago resource.

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: 2

♻️ Duplicate comments (7)
holidays/countries/trinidad_and_tobago.py (1)

68-69: 🛠️ Refactor suggestion

Consider restricting the holiday to its introduction year.

"Spiritual Baptist Shouter Liberation Day" was officially implemented in 1996. A recommended approach is to add a year check to avoid adding it before 1996:

+if self._year >= 1996:
     self._add_holiday_mar_30(tr("Spiritual Baptist Shouter Liberation Day"))
holidays/locale/en_TT/LC_MESSAGES/TT.po (2)

12-15: 🧹 Nitpick (assertive)

Update the file header description.

Replace the generic header with a specific description for Trinidad and Tobago.

-# SOME DESCRIPTIVE TITLE
-# This file is distributed under the same license as the Holidays package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
+#
+# Trinidad and Tobago holidays.
+#

21-21: 🧹 Nitpick (assertive)

Add your contributor information.

Replace the placeholder with your name and contact information.

-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Last-Translator: Your Name <your.email@example.com>\n"
holidays/locale/en_US/LC_MESSAGES/TT.po (4)

12-15: 🧹 Nitpick (assertive)

Update the file header description.

Replace the generic header with a specific description for Trinidad and Tobago's US English localization.

-# SOME DESCRIPTIVE TITLE
-# This file is distributed under the same license as the Holidays package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
+#
+# Trinidad and Tobago holidays en_US localization.
+#

21-21: 🧹 Nitpick (assertive)

Add your contributor information.

Replace the placeholder with your name and contact information.

-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Last-Translator: Your Name <your.email@example.com>\n"

47-49: 🧹 Nitpick (assertive)

Use US English spelling for 'Labor Day'.

For the en_US localization, "Labour" should be spelled as "Labor" to follow US English conventions.

#. Labor Day.
msgid "Labour Day"
-msgstr "Labour Day"
+msgstr "Labor Day"

15-15: 🧹 Nitpick (assertive)

Remove the fuzzy flag for finalized translations.

The "#, fuzzy" flag indicates translations are not finalized. Since all translations have been provided, this flag can be removed.

-#, fuzzy
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee8073 and a2fbbb0.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
  • holidays/locale/en_TT/LC_MESSAGES/TT.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TT.po (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
holidays/locale/en_TT/LC_MESSAGES/TT.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
holidays/locale/en_US/LC_MESSAGES/TT.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
README.md (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
🔇 Additional comments (3)
holidays/countries/trinidad_and_tobago.py (1)

122-158:

✅ Verification successful

Confirm alignment with parent classes for custom holiday dates.

The dictionaries for EID_AL_FITR_DATES and DIWALI_DATES look good. Just confirm they align with _CustomIslamicHolidays and _CustomHinduHolidays usage patterns (e.g., no overlap or missed year).


🏁 Script executed:

#!/bin/bash
# Attempt to see references to these dictionaries in the parent classes
rg "EID_AL_FITR_DATES|DIWALI_DATES" -A 5 -B 5

Length of output: 21657


Review Confirmation: Parent Class Alignment Verified

The Trinidad and Tobago custom holiday classes now follow the same dictionary structure as similar implementations (e.g., in the Iran, Malaysia, and Pakistan modules). Both the EID_AL_FITR_DATES and DIWALI_DATES dictionaries cover consecutive years without any overlap or gaps, which aligns with the expected usage in _CustomIslamicHolidays and _CustomHinduHolidays.

README.md (1)

1173-1179: LGTM! Trinidad and Tobago added correctly.

The addition of Trinidad and Tobago to the supported countries list follows the correct alphabetical ordering and includes both the regional (en_TT) and US English (en_US) language codes as required.

holidays/locale/en_TT/LC_MESSAGES/TT.po (1)

39-41: LGTM! Holiday naming is consistent.

The comment and msgid for "Spiritual Baptist Shouter Liberation Day" are now consistent.

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: 1

♻️ Duplicate comments (3)
holidays/countries/trinidad_and_tobago.py (1)

74-75: 🧹 Nitpick (assertive)

Fix inconsistency between comment and code.

The comment uses American spelling "Labor Day" while the holiday name uses British spelling "Labour Day".

-# Labor Day.
+# Labour Day.
 self._add_holiday_jun_19(tr("Labour Day"))
holidays/locale/en_US/LC_MESSAGES/TT.po (2)

46-48: 🧹 Nitpick (assertive)

Use American spelling in en_US translation.

For en_US localization, "Labour Day" should be translated to "Labor Day" (American spelling).

 #. Labor Day.
 msgid "Labour Day"
-msgstr "Labour Day"
+msgstr "Labor Day"

90-92: 🧹 Nitpick (assertive)

Use standard American spelling for Eid al-Fitr in en_US translation.

For en_US localization, "Eid-Ul-Fitr" should be translated to "Eid al-Fitr" (more common form in US).

 #. Eid al-Fitr.
 msgid "Eid-Ul-Fitr"
-msgstr "Eid-Ul-Fitr"
+msgstr "Eid al-Fitr"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a2fbbb0 and 168e502.

📒 Files selected for processing (3)
  • holidays/countries/trinidad_and_tobago.py (1 hunks)
  • holidays/locale/en_TT/LC_MESSAGES/TT.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TT.po (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
holidays/locale/en_TT/LC_MESSAGES/TT.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
holidays/locale/en_US/LC_MESSAGES/TT.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
holidays/countries/trinidad_and_tobago.py (3)
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:25-25
Timestamp: 2025-04-02T17:22:27.207Z
Learning: For English-speaking countries in the holidays library (like Trinidad and Tobago), the `default_language` and `supported_languages` parameters are optional. If languages are added for such countries, ensure that `en_US` is included in the list alongside the regional code variant (e.g., `en_TT` for Trinidad and Tobago).
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
Learnt from: PPsyrius
PR: vacanza/holidays#2402
File: holidays/countries/trinidad_and_tobago.py:28-33
Timestamp: 2025-04-02T04:51:17.842Z
Learning: The library convention for country code aliases (like two-letter ISO 3166-1 alpha-2 and three-letter ISO 3166-1 alpha-3 codes) is to implement them as simple pass-through classes without docstrings.
🔇 Additional comments (3)
holidays/countries/trinidad_and_tobago.py (1)

1-158: Good implementation of Trinidad and Tobago holidays.

The implementation thoroughly covers all required holidays with appropriate structure. You've correctly:

  • Used the country code "TT"
  • Set default_language to "en_TT" with both "en_TT" and "en_US" in supported_languages
  • Implemented both ISO code aliases (TT, TTO) following library conventions
  • Provided custom Islamic and Hindu holiday implementations for specific dates
  • Added appropriate documentation and references
holidays/locale/en_TT/LC_MESSAGES/TT.po (1)

1-97: Well-structured localization file for en_TT.

The locale file is properly formatted with appropriate metadata and covers all Trinidad and Tobago holidays. The empty msgstr fields are correct for the default language (en_TT).

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

1-97: Well-structured localization file for en_US.

The locale file is properly formatted with appropriate metadata and covers all Trinidad and Tobago holidays.

@Roshan-1024 Roshan-1024 requested a review from KJhellico April 29, 2025 18:27
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.

Thank you and congrats on another great contribution @Roshan-1024 !

@arkid15r arkid15r added this pull request to the merge queue Apr 29, 2025
Merged via the queue into vacanza:dev with commit 386e148 Apr 29, 2025
33 checks passed
@KJhellico KJhellico mentioned this pull request May 3, 2025
@coderabbitai coderabbitai bot mentioned this pull request May 4, 2025
9 tasks
@arkid15r arkid15r mentioned this pull request May 5, 2025
kritibirda26 pushed a commit to kritibirda26/holidays that referenced this pull request May 7, 2025
Signed-off-by: Roshan Pradhan <roshanpradhan1024@gmail.com>
Co-authored-by: ~Jhellico <jhellico@gmail.com>
@KJhellico KJhellico moved this to Done in Task Tracker May 19, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jun 16, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Trinidad and Tobago holidays

4 participants

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