-
-
Notifications
You must be signed in to change notification settings - Fork 543
Add Cape Verde holidays #2394
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
Add Cape Verde holidays #2394
Conversation
Summary by CodeRabbit
WalkthroughThis pull request adds comprehensive holiday support for Cape Verde to the library. It introduces a new Changes
Assessment against linked issues
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Definitions (1)tests/countries/test_cape_verde.py (1)
🔇 Additional comments (18)
✨ Finishing Touches
🪧 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: 5
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
AUTHORS.md
(1 hunks)README.md
(2 hunks)holidays/countries/__init__.py
(1 hunks)holidays/countries/cape_verde.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/pt_PT/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/uk/LC_MESSAGES/CV.po
(1 hunks)holidays/registry.py
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-97)CV
(100-101)CAV
(104-105)
holidays/countries/__init__.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-97)CV
(100-101)CAV
(104-105)
🔇 Additional comments (17)
AUTHORS.md (1)
133-133
: Properly added new contributor to AUTHORS list.The addition of "Sindhura Kumbakonam Subramanian" to the AUTHORS.md file is correctly placed in alphabetical order.
holidays/countries/__init__.py (1)
45-45
: Import statement correctly added for Cape Verde.The import statement follows the established pattern in the file, correctly importing the CapeVerde class along with its country code aliases (CV and CAV).
holidays/registry.py (1)
53-53
: Cape Verde correctly added to COUNTRIES registry.The entry for Cape Verde has been properly added to the COUNTRIES dictionary, following the established pattern and in the correct alphabetical position.
README.md (2)
102-102
: Country count correctly updated.The count of supported countries has been properly incremented from 161 to 162 to reflect the addition of Cape Verde.
354-359
: Cape Verde entry correctly added to countries table.The Cape Verde entry follows the established formatting pattern and includes all required information:
- Country name and code
- Supported languages with pt_PT as default
- OPTIONAL category support in addition to the default PUBLIC category
This properly documents the new country support in alignment with the implementation.
holidays/locale/uk/LC_MESSAGES/CV.po (1)
1-101
: Holiday translations look accurateThe translations correctly map Portuguese holiday names to their English equivalents. The message format follows the standard gettext pattern with proper context comments.
holidays/locale/en_US/LC_MESSAGES/CV.po (1)
1-101
: Correct holiday definitionsThe translations properly map Portuguese holiday names to their English equivalents with appropriate context comments.
tests/countries/test_cape_verde.py (1)
32-122
: Test implementation looks comprehensiveThe test cases provide good coverage for Cape Verde holidays, including:
- Country aliases verification
- Date range validity checks
- Holiday-specific tests for Democracy Day, Independence Day, Heroes Day, and Youth Day
- Public and optional holiday category validation
This thorough approach ensures the Cape Verde holiday implementation works correctly.
holidays/countries/cape_verde.py (2)
20-97
: Well-implemented holiday definitionsThe CapeVerde class properly implements both public and optional holidays with appropriate conditions:
- Core holidays like New Year's Day, Labour Day, and Christmas Day
- Conditional holidays based on years (Democracy Day from 1991, Independence Day from 1975)
- Religious holidays from the Christian calendar
- Seasonal holidays like solstices and equinoxes
The code follows the project's pattern for holiday definitions and uses proper localization through gettext.
100-105
: Country code aliases correctly implementedThe CV and CAV classes are properly set up as aliases for the CapeVerde class, following the project's convention for country code alternatives.
holidays/locale/pt_PT/LC_MESSAGES/CV.po (7)
1-29
: Header information looks good but dates should be verified.The file header contains all required metadata for a proper .po file. The license information, author details, and language specifications are correctly structured.
However, the dates specified (POT-Creation-Date and PO-Revision-Date) are set to 2025-03-30, which is a future date. Please verify if this is intentional or needs to be updated to the current date.
15-15
: Confirm if the fuzzy flag is intentional.The "#, fuzzy" flag indicates that these translations are not confirmed/finalized. This is typically used during the initial translation process. Consider removing this flag if the translations are ready for production use.
30-48
: Standard holiday translations look correct.The translations for common public holidays (New Year's Day, Labour Day, Assumption of Mary, All Saints' Day, Christmas) appear to be correct in Portuguese. The empty msgstr fields are acceptable for a new locale file as they will be populated during the translation process.
50-64
: Cape Verde-specific holiday translations look accurate.The national holidays specific to Cape Verde (Democracy Day, Independence Day, Heroes Day, Youth Day) are properly identified and named in Portuguese. Good job on including the explanatory comments that provide context for each holiday.
63-64
: Verify "Dia Mundial da Criança" translation.The English comment refers to "Youth Day" but the Portuguese translation "Dia Mundial da Criança" literally means "World Children's Day". Please verify if this is the correct mapping for Cape Verde's Youth Day.
66-96
: Religious holidays and seasonal markers properly identified.The translations for religious observances (Good Friday, Ash Wednesday, Holy Thursday, Easter) and seasonal markers (March Equinox, June Solstice, September Equinox, Winter Solstice) appear to be correct in Portuguese.
16-29
:❓ Verification inconclusive
Double-check if any additional metadata fields are required.
The metadata block contains standard fields. However, consider checking if the project requires additional fields like Plural-Forms or X-Generator that might be present in other .po files in the project.
🏁 Script executed:
#!/bin/bash # Check if other .po files in the project have additional metadata fields find holidays/locale -name "*.po" | grep -v CV.po | head -n 1 | xargs cat | grep -A 30 "msgid \"\""Length of output: 705
PO Metadata Consistency: Verify Additional Fields
The primary CV.po file contains the standard metadata, but as seen in another PO file (e.g., the one for the 'am' locale), there’s an extra metadata field (
X-Generator
). Please review if our project's localization requirements call for additional fields—such asX-Generator
or possiblyPlural-Forms
—to maintain consistency across all .po files.
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.
Hi @sindhuraks thanks for the contribution!
I suggest starting from addressing relevant coderabbit's comments. This way your PR will be better positioned for review by project maintainers.
Thank you!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2394 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 208 209 +1
Lines 13244 13303 +59
Branches 1899 1900 +1
=========================================
+ Hits 13244 13303 +59 ☔ 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.
Nice to see new contributors ❤️
@PPsyrius , code review comments have been addressed. Kindly check it out and let me know if any more changes are required. |
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
🔭 Outside diff range comments (1)
holidays/locale/pt_PT/LC_MESSAGES/CV.po (1)
1-89
: 💡 Verification agent🧩 Analysis chain
Verify all Cape Verde public holidays are included
The current file includes major holidays like New Year's Day, Labor Day, and Christmas, but please verify that all official Cape Verde public holidays are represented.
🌐 Web query:
What are the official public holidays in Cape Verde?
💡 Result:
Cape Verde's official public holidays blend historical commemorations, religious observances, and cultural celebrations. The fixed-date national holidays include:
Fixed-Date Public Holidays
- January 1: New Year’s Day (Ano Novo) [1][3][10]
- January 13: Freedom and Democracy Day (Dia da Liberdade e Democracia), marking the first democratic elections in 1991 [1][3][5]
- January 20: National Heroes’ Day (Dia dos Heróis Nacionais), honoring Amílcar Cabral and other independence leaders [1][3][5]
- May 1: Labour Day (Dia do Trabalhador) [1][3][10]
- June 1: Children’s Day (Dia Mundial da Criança) [1][3][10]
- July 5: Independence Day (Dia da Independência Nacional), celebrating independence from Portugal in 1975 [1][2][3]
- August 15: Assumption of Mary (Dia da Assunção) [1][3][10]
- November 1: All Saints’ Day (Dia de Todos os Santos) [1][3][10]
- December 25: Christmas Day (Natal) [1][3][10]
Movable and Regional Observances
- Good Friday and Easter Sunday (dates vary annually), widely observed [1][9]
- Carnival (February/March), most prominent in Praia and Mindelo [2][5][7]
- Ash Wednesday (February/March), marking Lent’s start [1][7]
Cultural festivals like the Kriol Jazz Festival (April) and Baía das Gatas Music Festival (August) draw international crowds but are not public holidays [2][5]. Municipal holidays, such as Praia Municipal Day (May 19), are locally observed [5][7].
Citations:
- 1: https://day-off.app/tools/country/CV/2024
- 2: https://www.iexplore.com/articles/travel-guides/africa/cape-verde/festivals-and-events
- 3: https://en.wikipedia.org/wiki/Public_holidays_in_Cape_Verde
- 4: https://www.britannica.com/place/Cabo-Verde/Cultural-life
- 5: https://www.vista-verde.com/en/info-service/travel-faq/events-and-festivals/
- 6: https://calendarific.com/holidays/2041/CV
- 7: https://www.worldtravelguide.net/guides/africa/cape-verde/public-holidays/
- 8: https://www.qppstudio.net/public-holidays/cape_verde.htm
- 9: https://www.timeanddate.com/holidays/cape-verde/
- 10: https://www.officeholidays.com/countries/cape-verde/2025
- 11: https://www.officeholidays.com/guide/cape-verde/2025
- 12: https://www.bank-holidays.com/country/Cape-Verde_38.htm
Cape Verde Public Holidays Verification – Action Required
After verifying the official list from reliable sources, the translation file covers nearly all the expected public holidays. However, please address the following:
- Heroes Day Naming: The official name appears as “Dia dos Heróis Nacionais,” but the file uses “Dia da Nacionalidade e dos Heróis Nacionais.” Please verify and update this to match the official naming.
- Extra Observances: The file includes “Quinta-Feira Santa” (Holy Thursday), which isn’t clearly listed among the official public holidays. Confirm if its inclusion is intentional based on your holiday logic.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/countries/cape_verde.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/pt_PT/LC_MESSAGES/CV.po
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-88)CV
(91-92)CAV
(95-96)
🔇 Additional comments (20)
README.md (2)
102-102
: Looks good: updated supported country count.
The increment from 161 to 162 properly reflects the inclusion of Cape Verde.
354-359
: Great addition of Cape Verde.
The new row accurately lists the code, locale support, and holiday category.holidays/locale/en_US/LC_MESSAGES/CV.po (1)
1-89
: All translations appear correct.
The localization file consistently translates Portuguese holiday names to English.tests/countries/test_cape_verde.py (12)
20-24
: Good setup for test environment.
Leveraging theyears=range(1973, 2050)
parameter ensures coverage for all relevant holiday logic.
25-27
: Aliases test is accurate.
Verifies the secondary classesCV
andCAV
as expected.
28-30
: Edge case coverage for year prior to start year.
Testing 1972 ensures correct handling of no holidays before 1973.
31-35
: Validation of Democracy Day bounds.
Usingrange(1991, 2050)
and confirming absence before 1991 is both clear and correct.
36-40
: Test for Independence Day transitions.
Verifies holiday addition after 1974 with appropriate checks for earlier years.
41-46
: Heroes Day coverage is thorough.
Confirms continuous availability starting in 1973.
47-51
: Youth Day test is comprehensive.
Checks the full valid range with expected naming.
52-66
: Public holidays for 2026 are well-tested.
Critical holiday checks confirm correctness for that year.
67-74
: Optional holidays test for 2026 is clear.
Segments optional holidays neatly with consistent naming.
75-89
: Public holidays for 2025.
Ensures comprehensive coverage and confirms each holiday is recognized.
90-108
: Default locale coverage.
All public and optional holidays for 2025 are properly validated in their default language.
109-128
: English (US) locale test.
Translation for each holiday matches the new en_US definitions perfectly.holidays/countries/cape_verde.py (3)
20-28
: Class definition documentation is concise.
Clear references are provided, aligning with known official sources.
41-73
: Public holidays implementation is clear and chronologically organized.
Year checks are robust, ensuring holidays appear only after they are introduced.
74-89
: Optional holidays method is well-structured.
Separating optional days from public holidays provides clarity and flexibility.holidays/locale/pt_PT/LC_MESSAGES/CV.po (2)
82-88
: Good job adding Father's Day translationThanks for adding the Father's Day entry in response to the previous review comment. This improves the completeness of family-related holidays for Cape Verde.
14-21
:⚠️ Potential issueCorrect the future dates in the file header
The file header contains dates set to 2025, which is in the future. Update these to reflect the current year:
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2025. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. #, fuzzy msgid "" msgstr "" "Project-Id-Version: Holidays 0.70\n" -"POT-Creation-Date: 2025-03-30 12:13-0400\n" -"PO-Revision-Date: 2025-03-30 12:13-0400\n" +"POT-Creation-Date: 2024-03-30 12:13-0400\n" +"PO-Revision-Date: 2024-03-30 12:13-0400\n"⛔ Skipped due to learnings
Learnt from: KJhellico PR: vacanza/holidays#2385 File: holidays/locale/en_US/LC_MESSAGES/PK.po:17-26 Timestamp: 2025-03-28T21:04:53.171Z Learning: Always verify the current year before flagging dates in project metadata as "future dates." As of March 2025, dates with year 2025 are current, not future dates.
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 (1)
holidays/locale/en_US/LC_MESSAGES/CV.po (1)
22-22
:⚠️ Potential issueLanguage field should match the locale directory
The file is in the
en_US
locale directory, but the Language field specifiespt_CV
. This should be updated for consistency.-"Language: pt_CV\n" +"Language: en_US\n"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
README.md
(2 hunks)holidays/countries/cape_verde.py
(1 hunks)holidays/locale/en_US/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/pt_CV/LC_MESSAGES/CV.po
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
holidays/locale/en_US/LC_MESSAGES/CV.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
holidays/locale/pt_CV/LC_MESSAGES/CV.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-03-31T19:37:57.691Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-87)CV
(90-91)CAV
(94-95)
🔇 Additional comments (16)
README.md (2)
353-359
: Correctly added Cape Verde to the country tableThe addition follows the required format with the country name, code, supported languages (en_US, pt_CV), and supported category (OPTIONAL).
102-102
: Country count accurately updatedLine correctly reflects the addition of Cape Verde by updating the total supported country count to 162.
holidays/locale/en_US/LC_MESSAGES/CV.po (2)
15-27
: Metadata correctly formattedThe metadata section properly includes all required fields: project version, creation date, translator information, and language settings.
29-87
: Holiday translations are correct and completeAll holiday translations from Portuguese to English are accurate and follow the standard pattern with proper comments.
tests/countries/test_cape_verde.py (5)
25-26
: Correctly testing country code aliasesThe test properly verifies that CV and CAV are valid aliases for CapeVerde.
31-35
: Democracy Day test is implemented correctlyThe test accurately verifies that Democracy Day (Dia da Liberdade e Democracia) exists from 1991 onward and does not exist before 1991.
51-89
: Public holiday tests are comprehensiveThe tests for 2024 and 2025 public holidays thoroughly verify all expected holidays with correct dates and names.
66-74
: Optional holiday tests properly implementedThe test for 2024 optional holidays correctly verifies all expected optional holidays with appropriate dates and names.
91-128
: Localization tests are thoroughThe tests for both default (pt_CV) and English (en_US) localizations comprehensively verify all holiday translations.
holidays/locale/pt_CV/LC_MESSAGES/CV.po (2)
15-27
: Metadata correctly formattedThe metadata section properly includes all required fields and correctly identifies the language as pt_CV.
29-87
: Empty msgstr fields are appropriate for default languageAs pt_CV is the default language for Cape Verde, the empty msgstr fields follow the library's pattern correctly. This is consistent with the retrieved learnings that default language locale files should have empty msgstr fields.
holidays/countries/cape_verde.py (5)
30-34
: LGTM: Country attributes are properly definedThe country attributes are correctly specified, including the country code, default language, supported languages, and categories.
41-72
: LGTM: Public holidays implementation follows chronological orderThe implementation of public holidays is well-structured and follows chronological order, making the code easy to understand. Each holiday has proper documentation.
45-48
: LGTM: Conditional logic for Democracy DayGood implementation of conditional logic for Democracy Day, which only applies for years 1991 and later.
73-88
: LGTM: Optional holidays implementationThe optional holidays implementation is well-structured and includes appropriate religious holidays and observances like Mother's Day and Father's Day.
90-95
: LGTM: Country code alias classesGood practice to define alias classes (CV and CAV) for easy reference by country code.
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 (2)
holidays/countries/cape_verde.py
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-87)CV
(90-91)CAV
(94-95)
🔇 Additional comments (20)
tests/countries/test_cape_verde.py (12)
1-12
: LGTM - Header format is consistent with project standards.The file header properly follows the project's copyright format with correct years and attributions.
13-17
: LGTM - Imports look good.All necessary imports are included: TestCase, constants, country classes, and the CommonCountryTests base class.
20-24
: LGTM - Test class setup looks good.The class correctly inherits from CommonCountryTests and TestCase, with a proper year range setup starting from 1976, which matches the start_year in the CapeVerde class.
25-29
: LGTM - Basic tests are properly implemented.The country aliases test and no-holidays test are correctly implemented, verifying that CV and CAV are proper aliases and that no holidays exist before 1976.
31-35
: LGTM - Democracy Day test implemented correctly.The test properly verifies that Democracy Day exists from 1991 onwards and doesn't exist before that year, which aligns with the implementation.
36-40
: LGTM - Independence Day test is properly implemented.The test correctly verifies that Independence Day is recognized starting from 1976, which aligns with Cape Verde's independence year and the class's start_year.
41-46
: LGTM - Heroes Day test is properly implemented.The test correctly verifies that National Heroes Day is recognized from 1976 onwards.
52-66
: LGTM - 2024 public holidays test is comprehensive.The test thoroughly checks all expected public holidays for 2024 with their correct dates and names.
67-76
: LGTM - 2024 optional holidays test is comprehensive.The test thoroughly checks all expected optional holidays for 2024 with their correct dates and names.
77-91
: LGTM - 2025 public holidays test is comprehensive.The test thoroughly checks all expected public holidays for 2025 with their correct dates and names.
92-110
: LGTM - Default localization test is properly implemented.The test correctly verifies that all holidays are properly localized in Portuguese (Cape Verde), which is the default language.
111-130
: LGTM - English localization test is properly implemented.The test correctly verifies that all holidays are properly localized in English (US), confirming the supported language functionality.
holidays/countries/cape_verde.py (8)
1-12
: LGTM - Header format is consistent with project standards.The file header properly follows the project's copyright format with correct years and attributions.
13-18
: LGTM - Imports are appropriate and organized.All necessary imports are included: gettext for translation, constants, holiday groups, and the HolidayBase class.
20-28
: LGTM - Class documentation is well-structured with proper references.The class docstring provides a concise description of the class purpose with appropriate reference links to validate the holiday data.
30-34
: LGTM - Class attributes are properly defined.The country code, default language, start year, supported categories, and supported languages are all correctly defined based on Cape Verde's specifics.
36-40
: LGTM - Initialization method properly calls parent initializers.The
__init__
method correctly initializes the parent classes in the proper order.
41-72
: LGTM - Public holidays are properly implemented.All public holidays are correctly implemented with appropriate translation markers, including the conditional Democracy Day that only starts from 1991. The holidays are also organized chronologically through the year.
73-88
: LGTM - Optional holidays are properly implemented.All optional holidays are correctly implemented with appropriate translation markers and organized chronologically.
90-95
: LGTM - Country code aliases are properly defined.The CV and CAV aliases for CapeVerde are correctly implemented following the project's standard pattern.
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)
tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-87)CV
(90-91)CAV
(94-95)
🔇 Additional comments (3)
tests/countries/test_cape_verde.py (3)
1-130
: Good implementation of Cape Verde holiday tests.This test file is well structured and follows the project's established patterns for holiday testing. It properly validates all the Cape Verde holidays, both public and optional, across different years and localizations.
31-34
: Well-implemented Democracy Day test.Good job correctly testing that Democracy Day is only observed from 1991 onwards, which matches the implementation in the CapeVerde class.
92-129
: Comprehensive localization tests.The localization tests effectively verify both the default Portuguese (pt_CV) and English (en_US) translations for all holidays. This ensures proper multilingual support for Cape Verde 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.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (8)
README.md
(2 hunks)holidays/countries/cape_verde.py
(1 hunks)holidays/locale/de/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/en_US/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/es/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/fr/LC_MESSAGES/CV.po
(1 hunks)holidays/locale/pt_CV/LC_MESSAGES/CV.po
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
holidays/locale/es/LC_MESSAGES/CV.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
holidays/locale/en_US/LC_MESSAGES/CV.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
holidays/locale/pt_CV/LC_MESSAGES/CV.po (2)
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library, when a locale file matches the country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language files should have filled msgstr fields with translations.
Learnt from: KJhellico
PR: vacanza/holidays#2394
File: holidays/locale/pt_PT/LC_MESSAGES/CV.po:31-88
Timestamp: 2025-04-02T17:22:27.207Z
Learning: In the holidays library localization pattern, when a locale file matches a country's default language (e.g., pt_PT for Cape Verde), the msgstr fields should be left empty. Only non-default language locale files should have translations in the msgstr fields.
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-183)CV
(186-187)CAV
(190-191)
🔇 Additional comments (41)
holidays/locale/de/LC_MESSAGES/CV.po (1)
1-128
: Well-structured German localization file for Cape Verde holidaysThe German translation file follows the correct gettext PO format with properly translated holiday names. All necessary metadata is included, and the translations are appropriate for the German language.
holidays/locale/es/LC_MESSAGES/CV.po (1)
1-128
: Spanish localization file properly implementedThe Spanish translations for Cape Verde holidays are well-formatted and follow the project's localization standards. The file contains all required metadata and appropriate translations.
holidays/locale/en_US/LC_MESSAGES/CV.po (1)
1-128
: English localization file looks goodThe English (US) localization file for Cape Verde holidays is properly structured with correct metadata and appropriate translations. All holiday names have been effectively translated from Portuguese to English.
README.md (1)
102-102
: Country count correctly updatedThe total number of supported countries has been properly incremented from 163 to 164 to reflect the addition of Cape Verde.
tests/countries/test_cape_verde.py (21)
1-12
: File header looks good.The license and copyright information are correctly formatted, matching the project conventions.
13-18
: Correct imports and dependencies.The imports are appropriate for a test file, including the necessary classes and constants from the holidays library and test utilities.
20-24
: Test class setup is well-structured.The class properly inherits from CommonCountryTests and TestCase, with the setUpClass method correctly initialized for years 1976-2050, which aligns with Cape Verde's independence era.
25-27
: Country aliases verification is properly implemented.The test correctly verifies that CV and CAV are aliases for CapeVerde.
28-30
: No holidays test is appropriate.The test correctly verifies that there are no holidays before the start_year (1976).
31-35
: Democracy and Freedom Day test is well-structured.The test correctly checks that the holiday exists from 1991 onwards but not before.
36-40
: Independence Day test is correct.The test verifies Independence Day is observed starting from 1976, which aligns with historical facts.
41-46
: Heroes Day test is appropriate.The test correctly verifies National Heroes Day for the entire date range.
47-51
: International Children's Day test is correct.The test appropriately verifies that the holiday is observed throughout the date range.
52-65
: Ash Wednesday test is comprehensive.The test correctly verifies the holiday for specific years and ensures it exists throughout the date range. The specific dates properly follow the Christian calendar.
66-79
: Good Friday test is thorough.The test verifies Good Friday for specific years and throughout the date range, following religious calendar calculations correctly.
80-93
: Easter Sunday test is properly implemented.The test verifies Easter Sunday for specific years and the entire date range, with dates that correspond to the Christian calendar.
94-110
: 2024 public holidays test is comprehensive.The test correctly verifies all public holidays for 2024, including fixed dates and movable religious holidays.
111-126
: Municipal-specific holidays test is well-structured.The test correctly verifies holidays specific to various municipalities in Cape Verde for 2024.
127-134
: 2024 optional holidays test is appropriate.The test correctly verifies optional holidays for 2024, including religious and family-oriented observances.
135-151
: 2025 public holidays test is thorough.The test correctly verifies all public holidays for 2025, including the correct dates for movable holidays.
152-181
: Default localization test is comprehensive.The test thoroughly verifies all localized holiday names in the default language (pt_CV), covering all supported holidays.
182-212
: German localization test is well-implemented.The test verifies German translations for all holidays, which is consistent with the supported languages in the CapeVerde class.
213-243
: Spanish localization test is appropriate.The test verifies Spanish translations for all holidays, consistent with the supported languages attribute.
244-274
: English (US) localization test is thorough.The test verifies English translations for all holidays, which is one of the primary locales mentioned in the PR objectives.
275-305
: French localization test is comprehensive.The test verifies French translations for all holidays, consistent with the supported languages in the CapeVerde class.
holidays/locale/pt_CV/LC_MESSAGES/CV.po (3)
1-12
: File header is properly formatted.The license and copyright information follow the project conventions.
13-28
: Localization metadata is correctly structured.The metadata includes appropriate project version, creation date, language team information, and correctly specifies pt_CV as the language code.
29-128
: Holiday translations are properly structured.All entries have empty msgstr fields, which is correct since pt_CV is the default language for Cape Verde as specified in the CapeVerde class. This follows the project's localization pattern described in the learned patterns.
holidays/countries/cape_verde.py (11)
1-12
: File header is properly formatted.The license and copyright information follow the project conventions.
13-18
: Imports are appropriate and well-organized.The file imports necessary modules and classes for defining holidays in Cape Verde.
20-32
: Class documentation is thorough.The docstring provides a good description of Cape Verde holidays and includes multiple references to support the implementation, including official sources and ISO codes for subdivisions.
34-61
: Class attributes for country and subdivisions are well-defined.The country code, default language, start year, and subdivisions are correctly specified. The start year of 1976 matches Cape Verde's independence period.
62-86
: Subdivision aliases are properly mapped.The mapping between full municipality names and their ISO codes is comprehensive and correctly formatted.
87-89
: Supported categories and languages are appropriate.The class supports OPTIONAL and PUBLIC categories, and includes multiple languages as mentioned in the PR objectives, with potential for future language additions.
90-94
: Initialization method is correctly implemented.The init method properly initializes the parent classes to ensure all holiday functionality is available.
95-132
: Public holidays population is comprehensive.The _populate_public_holidays method adds all relevant public holidays with appropriate translations and historical conditions (e.g., Democracy Day starting from 1991).
133-142
: Optional holidays are well-defined.The _populate_optional_holidays method correctly adds optional holidays like Holy Thursday, Mother's Day, and Father's Day.
143-183
: Municipality-specific holidays are well-implemented.Each municipality's specific holidays are implemented in separate methods, making the code modular and maintainable.
186-187
: Country code aliases are properly defined.The CV and CAV classes are correctly implemented as aliases for CapeVerde, which is a common pattern in this library.
Also applies to: 190-191
holidays/locale/fr/LC_MESSAGES/CV.po (2)
1-28
: Localization file metadata is correctly structured.The metadata includes appropriate project version, creation date, and language information for the French locale.
29-60
: Holiday translations are well-structured.The French translations for the Cape Verde holidays are appropriately provided and follow a consistent format.
Also applies to: 65-128
@PPsyrius,, @KJhellico added translation sources : es, fr and de. For the translation, I used the google translator iand the code review comments have been addressed. Let me know if any other changes are required. |
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 (3)
README.md
(2 hunks)holidays/locale/fr/LC_MESSAGES/CV.po
(1 hunks)tests/countries/test_cape_verde.py
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_cape_verde.py (1)
holidays/countries/cape_verde.py (3)
CapeVerde
(20-183)CV
(186-187)CAV
(190-191)
🔇 Additional comments (15)
README.md (2)
102-102
: Total country count correctly updated.The total count of supported country codes has been correctly updated from 163 to 164 with the addition of Cape Verde.
361-366
: Cape Verde entry properly added with comprehensive details.The entry for Cape Verde is well-structured with complete information including:
- Country name and code
- Detailed list of municipalities with their codes
- Five supported languages with pt_CV correctly marked as default
- OPTIONAL category specification
This aligns with the format of other country entries in the table.
tests/countries/test_cape_verde.py (11)
22-23
: Setup correctly initializes with appropriate year range.The year range starts from 1976, which correctly matches the
start_year
attribute in theCapeVerde
class.
28-29
: No holidays test correctly validates year boundary.The test appropriately checks that no holidays exist before the start year (1975).
31-35
: Democracy and Freedom Day test includes correct date range validation.The test properly verifies that this holiday:
- Exists from 1991 onward (lines 33-34)
- Doesn't exist between 1976-1990 (line 34)
This aligns with the implementation in the
CapeVerde
class where this holiday is conditionally added only ifself._year >= 1991
.
52-65
: Ash Wednesday test includes specific dates and general validation.The test validates:
- Specific dates for 7 years (2019-2025)
- General occurrence for all years in the range (1976-2050)
This is a thorough approach for testing a movable holiday that depends on Easter calculation.
94-110
: Public holidays test for 2024 covers all expected holidays.The test validates all required public holidays for 2024, including fixed dates and movable religious holidays like Ash Wednesday (February 14), Good Friday (March 29), and Easter Sunday (March 31).
111-126
: Municipal-specific holidays test is comprehensive.The test effectively checks municipality-specific holidays using a dictionary-based approach that:
- Maps each municipality code to its expected holiday dates
- Iterates through the dictionary to test each municipality
This is an efficient way to test multiple subdivisions.
127-133
: Optional holidays test validates correct category filtering.The test confirms that when using the OPTIONAL category:
- Only optional holidays are returned
- The correct dates for Holy Thursday and parent-related holidays are included
This verifies the proper handling of holiday categories.
152-180
: Default localization test is thorough.The test checks all expected holidays in the default language (pt_CV), including:
- Public holidays
- Optional holidays
- Municipality-specific holidays
The comprehensive list ensures all translations are properly configured.
213-242
: Spanish localization test validates all translations.The test verifies that all holiday names are correctly translated to Spanish, which is one of the supported languages mentioned in the PR objectives.
244-273
: English localization test confirms US English translations.The test validates all holiday names in English, which was one of the primary locales mentioned in the PR objectives.
275-304
: French localization test is comprehensive.The test provides thorough validation of French translations for all holidays, aligning with the translation file we're also reviewing.
holidays/locale/fr/LC_MESSAGES/CV.po (2)
17-27
: PO file metadata properly configured.The metadata includes:
- Correct project version
- Appropriate creation and revision dates
- Translator information
- Language specification (fr)
- Character encoding details
- Source language correctly identified as pt_CV
This follows the standard format for gettext PO files.
61-64
: All Saints' Day translation is accurate.The French translation "La Toussaint" for "Dia de Todos os Santos" is correct. I see from the previous review comments that this was initially translated as "Halloween", which would have been incorrect as these are different 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.
@sindhuraks please make sure to re-request review when it's ready for another round.
Thank you!
# Praia City Day. | ||
self._add_holiday_apr_29(tr("Dia da Cidade da Praia")) |
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.
According to the name, this is holiday of Praia city, not the entire municipality.
# Tarrafal de São Nicolau Municipal Day. | ||
self._add_holiday_aug_2(tr("Dia do Município do Tarrafal de São Nicolau")) | ||
|
||
|
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.
According to Feriados Públicos page, there are also holidays:
- May 7 - Dia do Município de Ribeira Grande
- Jun 13 - Dia do Município de Paúl
- Sep 2 - Dia do Município do Porto Novo
- Jan 17 - Dia da ilha de Santo Antão (for municipalities on this island - Ribeira Grande, Paúl, Porto Novo)
- Jan 15 - Dia do Município de Tarrafal de Santiago
- Mar 13 - Dia do Município de São Domingos
- May 9 - Dia do Município de São Lourenço dos Órgãos
- Jul 19 - Dia do Município de São Salvador do Mundo
- Jul 25 - Dia do Município de Santa Cruz
- Sep 29 - Dia do Município de São Miguel
- Nov 25 - Dia do Município de Santa Catarina de Santiago, Dia do Município de Santa Catarina do Fogo
- May 1 - Dia do Município de São Filipe
- Aug 15 - Dia do Município dos Mosteiros
According to Legislação Municipal Cabo-Verdiana:
- São Salvador do Mundo was created in 2005 - Lei nº 65/VI/2005
- Tarrafal de São Nicolau and Ribeira Brava was created in 2005 - Lei nº 67/VI/2005
- São Domingos was created in 1994 - Lei nº 96/IV/93
- São Lourenço dos Órgãos was created in 2005 - Lei nº 64/VI/2005
- Ribeira Grande de Santiago was created in 2005 - Lei nº 63/VI/2005
- São Miguel was created in 1996 - Lei nº 11/V/96
- Mosteiros and São Filipe was created in 1992 - Lei nº 23/IV/91
- Santa Catarina do Fogo was created in 2005 - Lei nº 66/VI/2005
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.
The following holidays are placed under the corresponding subdivision:
- Dia do Município de Ribeira Grande under _populate_subdiv_rs_public_holidays
The others are found under Santiago for which there is no municipality code although the holidays listed under it have appropriate municipality codes in https://www.iso.org/obp/ui/#iso:code:3166:CV
For certain holidays such as Dia do Município de São Lourenço dos Órgãos, Dia da ilha de Santo Antão, Dia do Município de São Salvador do Mundo the municipality codes were not found here https://www.iso.org/obp/ui/#iso:code:3166:CV.
KIndly confirm on how to proceed further.
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.
The others are found under Santiago for which there is no municipality code although the holidays listed under it have appropriate municipality codes in https://www.iso.org/obp/ui/#iso:code:3166:CV
Santiago is the island where they are located.
For certain holidays such as Dia do Município de São Lourenço dos Órgãos,
"SO", # São Lourenço dos Órgãos.
Dia da ilha de Santo Antão
Jan 17 - Dia da ilha de Santo Antão (for municipalities on this island - Ribeira Grande, Paúl, Porto Novo)
Dia do Município de São Salvador do Mundo
"SS", # São Salvador do Mundo.
@sindhuraks any updates on this? |
@arkid15r working on it. |
I'm closing this due to a missed deadline. Feel free to reopen if you have ready for review PR. |
Proposed change
Added public and optional holidays for Cape Verde (
de
,en_US
,es
,fr
,pt_CV
; CategoriesPUBLIC
andOPTIONAL
).Resolves #1159.
Type of change
holidays
functionality in general)Checklist
make check
, all checks and tests are green