-
-
Notifications
You must be signed in to change notification settings - Fork 558
Add Trinidad and Tobago holidays #2402
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
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThis 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
Assessment against linked issues
Suggested reviewers
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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 50Length 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
📒 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 correctlyThe 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 countThe 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 correctlyThe 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 classesThe 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 goodThe test correctly sets up and verifies the country aliases (TT and TTO) for Trinidad and Tobago.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📒 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.
ThesetUpClass
pattern matches other country tests, ensuringTrinidadAndTobago
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.
Definingcountry = "TT"
is consistent. The docstring references are helpful.
89-94
: Alias classes follow project conventions.
No docstrings are necessary based on existing guidelines.
There was a problem hiding this 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
📒 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.
There was a problem hiding this 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
📒 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.
Includingdefault_language
,supported_languages
, andstart_year
aligns with best practices for consistency in the library.
48-62
: Constructor calls are well-structured.
Calling each parent class before callingsuper().__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
…tist Shouter Liberation Day
There was a problem hiding this 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
📒 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 3Length 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.
There was a problem hiding this 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 suggestionConsider 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
📒 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 5Length 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
andDIWALI_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.
There was a problem hiding this 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
📒 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.
There was a problem hiding this 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 !
Signed-off-by: Roshan Pradhan <roshanpradhan1024@gmail.com> Co-authored-by: ~Jhellico <jhellico@gmail.com>
Proposed change
Add Trinidad and Tobago holidays
Resolves #1289 .
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green