Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: Panpakorn Siripanich <19505219+PPsyrius@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
…_language fallback
Aland PR suggestions
Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com> Signed-off-by: Ary Hauffe <41094281+Arynelson@users.noreply.github.com>
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThis update introduces official support for Åland Islands holidays by adding a dedicated module, registry entry, localization files, and comprehensive tests. It extends the Finland holiday logic to handle Åland as a subdivision with specific holidays and translations. Documentation and contributor records are also updated to reflect these changes. Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (9)
🔇 Additional comments (17)
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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 6
🔭 Outside diff range comments (1)
tests/countries/test_finland.py (1)
570-573:⚠️ Potential issueSame Swedish typo as in Åland tests
"Självständigshetsdagen"→"Självständighetsdagen".- ("2022-12-06", "Självständigshetsdagen"), + ("2022-12-06", "Självständighetsdagen"),
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (18)
CONTRIBUTORS(1 hunks)README.md(3 hunks)holidays/countries/__init__.py(1 hunks)holidays/countries/aland_islands.py(1 hunks)holidays/countries/finland.py(3 hunks)holidays/holiday_base.py(1 hunks)holidays/locale/en_US/LC_MESSAGES/AX.po(1 hunks)holidays/locale/en_US/LC_MESSAGES/FI.po(2 hunks)holidays/locale/fi/LC_MESSAGES/AX.po(1 hunks)holidays/locale/fi/LC_MESSAGES/FI.po(2 hunks)holidays/locale/sv_FI/LC_MESSAGES/AX.po(1 hunks)holidays/locale/sv_FI/LC_MESSAGES/FI.po(2 hunks)holidays/locale/uk/LC_MESSAGES/AX.po(1 hunks)holidays/locale/uk/LC_MESSAGES/FI.po(2 hunks)holidays/registry.py(1 hunks)tests/common.py(1 hunks)tests/countries/test_aland_islands.py(1 hunks)tests/countries/test_finland.py(14 hunks)
🧰 Additional context used
🧠 Learnings (2)
tests/common.py (1)
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
tests/countries/test_finland.py (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.
🧬 Code Graph Analysis (3)
holidays/countries/__init__.py (1)
holidays/countries/aland_islands.py (4)
Aland(51-52)AX(55-56)ALA(59-60)HolidaysAX(17-48)
holidays/countries/finland.py (2)
holidays/countries/portugal.py (1)
_populate_subdiv_01_public_holidays(188-190)holidays/countries/malaysia.py (1)
_populate_subdiv_01_public_holidays(251-264)
tests/countries/test_finland.py (12)
holidays/countries/finland.py (2)
Finland(21-198)FI(201-202)tests/common.py (6)
TestCase(28-338)setUpClass(32-53)assertAliases(121-130)assertNoHolidays(292-294)assertHolidayName(195-199)assertNoHolidayName(273-275)tests/countries/test_aland_islands.py (2)
setUpClass(22-23)test_alands_autonomy_day(31-34)tests/countries/test_vietnam.py (1)
setUpClass(23-24)tests/countries/test_cuba.py (2)
setUpClass(21-22)test_no_holidays(27-28)tests/countries/test_chile.py (2)
setUpClass(22-23)test_no_holidays(34-35)tests/countries/test_costa_rica.py (2)
setUpClass(22-23)test_good_friday(46-59)tests/countries/test_kazakhstan.py (2)
setUpClass(21-22)test_no_holidays(27-28)tests/countries/test_russia.py (1)
test_no_holidays(27-28)tests/countries/test_uruguay.py (1)
test_no_holidays(30-31)tests/countries/test_nicaragua.py (1)
test_good_friday(46-60)tests/countries/test_switzerland.py (1)
test_good_friday(191-231)
🔇 Additional comments (23)
CONTRIBUTORS (1)
20-20: LGTM: New contributor added correctlyThe new contributor "Ary Hauffe Neto" has been properly added to the CONTRIBUTORS file in alphabetical order between "Artem Tserekh" and "Bailey Thompson".
holidays/countries/__init__.py (1)
16-16: LGTM: Import added properlyImport for Åland Islands classes added in correct alphabetical order among other country imports, consistent with the project's import pattern.
holidays/registry.py (1)
24-24: LGTM: Registry entry added correctlyThe Åland Islands entry has been properly added to the COUNTRIES dictionary in alphabetical order with the correct format: country name, ISO alpha-2 code, ISO alpha-3 code, and the holiday class name.
tests/common.py (1)
337-338: LGTM: Simplified method implementationThe
assertLocalizedHolidaysmethod has been simplified to directly call_assertLocalizedHolidayswith the language parameter, which better matches the production code's language handling behavior. This refactoring supports the new language localization features.holidays/locale/en_US/LC_MESSAGES/AX.po (1)
1-28: Stub file for Åland Islands (en_US) is in place
The new AX.po contains the correct metadata template and matches the structure of other locale stubs.holidays/locale/fi/LC_MESSAGES/FI.po (2)
17-27: Metadata updated to v0.73
Project-Id-Version, PO-Revision-Date, and X-Generator headers have been bumped appropriately.
165-168: New Finnish translation stub added
The entry for “Ahvenanmaan itsehallintopäivä” is correctly appended with an empty msgstr, consistent with existing stubs.holidays/locale/fi/LC_MESSAGES/AX.po (1)
1-28: Stub file for Åland Islands (fi) looks correct
Metadata aligns with other locale stub files and awaits actual translations.holidays/locale/uk/LC_MESSAGES/FI.po (2)
17-27: Headers bumped to match v0.73
Project-Id-Version, PO-Revision-Date, and X-Generator reflect the new release.
165-168: Ukrainian translation for Åland’s Autonomy Day added
The msgstr “День автономії Аландських островів” correctly maps to the new msgid.holidays/locale/en_US/LC_MESSAGES/FI.po (2)
17-27: Locale metadata bumped to 0.73
Headers for Project-Id-Version, PO-Revision-Date, and X-Generator have been updated consistently.
165-168: New English translation entry appended
The msgstr “Åland’s Autonomy Day” matches the new msgid and holiday naming.holidays/locale/sv_FI/LC_MESSAGES/FI.po (4)
17-17: Updated version to match current project status.The Project-Id-Version has been updated from 0.54 to 0.73, which aligns with the current version for all locale files in this PR.
19-19: PO-Revision-Date updated to reflect recent changes.The revision date has been updated to May 2025, which is consistent with the timeframe of this PR implementation.
27-27: Updated X-Generator to latest Poedit version.The generator tool version has been updated from 3.4.2 to 3.6, which is appropriate for maintaining consistent metadata across all PO files.
165-167: Correctly added new translation for Åland's Autonomy Day.The translation for "Ahvenanmaan itsehallintopäivä" to "Ålands självstyrelsedag" is accurate and follows the library's internationalization format.
README.md (3)
108-108: Updated country count to include new Åland Islands addition.The number of supported countries has been increased from 171 to 173, correctly reflecting the addition of Åland Islands.
157-162: Correctly added Åland Islands as a new supported region.The new entry for Åland Islands includes:
- Proper country code (AX)
- Relationship to Finland as subdivision 01
- Supported languages including sv_FI as the default
- Appropriate categorization as UNOFFICIAL
This is consistent with the Åland Islands' status as an autonomous region.
530-530: Updated Finland entry to include Åland subdivision.The Finland entry now correctly references the Åland Islands (01) as one of its regions, establishing the appropriate parent-child relationship between Finland and Åland.
holidays/locale/sv_FI/LC_MESSAGES/AX.po (1)
1-28: Appropriate localization stub for Åland Islands in Swedish (Finland).This new stub file is correctly structured with all necessary metadata headers and properly identifies its purpose as an Åland Islands localization file for the Swedish (Finland) locale.
The file is set up correctly as a stub that can be populated with translations later as needed.
holidays/locale/uk/LC_MESSAGES/AX.po (1)
1-28: Properly structured Ukrainian localization stub for Åland Islands.This new stub file contains all required metadata headers and is correctly set up as a Ukrainian localization file for Åland Islands holidays.
Like the other localization stubs, this provides the framework for adding Ukrainian translations for Åland Islands holidays in the future.
holidays/holiday_base.py (1)
789-794: Improved language fallback logic for better localization support.The enhanced fallback logic now properly handles both cases where:
- The user-specified language is unsupported but valid
- No language is specified (None)
By falling back to
self.default_languagewhen available, this change ensures better continuity in holiday name localization.This improvement will directly benefit the Åland Islands implementation by ensuring consistent language selection when dealing with its multilingual holiday names.
holidays/countries/finland.py (1)
195-199: Double-check localisation for Autonomy Day
_add_holiday_jun_9(tr("Ahvenanmaan itsehallintopäivä"))stores the Finnish label.
BecauseFinland.default_languageis"fi", this is fine, but note that the default Swedish label users might expect whensubdiv="01"is"Ålands självstyrelsedag".If
tr()files contain the Swedish mapping this is OK; otherwise you may need a dedicated call such as:self._add_holiday_jun_9( tr("Ahvenanmaan itsehallintopäivä"), # fi alt_tr={"sv_FI": "Ålands självstyrelsedag"}, )Please verify that the translation catalogs already include the Swedish, English and Ukrainian entries.
| subdivisions: tuple[str, ...] = ("01",) # Åland Islands. | ||
| subdivisions_aliases = { | ||
| "Ahvenanmaan maakunta": "01", | ||
| "Landskapet Åland": "01", | ||
| "Åland": "01", | ||
| } |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Consider adding an English alias for discoverability
subdivisions_aliases currently lists only Finnish & Swedish names. A plain-English alias such as "Aland Islands": "01" would let callers specify the subdivision without worrying about diacritics or language. It’s a small DX win and keeps parity with many other country modules that accept English names for their subdivisions.
subdivisions_aliases = {
"Ahvenanmaan maakunta": "01",
"Landskapet Åland": "01",
"Åland": "01",
+ "Aland Islands": "01", # English convenience alias
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| subdivisions: tuple[str, ...] = ("01",) # Åland Islands. | |
| subdivisions_aliases = { | |
| "Ahvenanmaan maakunta": "01", | |
| "Landskapet Åland": "01", | |
| "Åland": "01", | |
| } | |
| subdivisions: tuple[str, ...] = ("01",) # Åland Islands. | |
| subdivisions_aliases = { | |
| "Ahvenanmaan maakunta": "01", | |
| "Landskapet Åland": "01", | |
| "Åland": "01", | |
| "Aland Islands": "01", # English convenience alias | |
| } |
🤖 Prompt for AI Agents (early access)
In holidays/countries/finland.py around lines 41 to 46, the subdivisions_aliases
dictionary lacks an English alias for the Åland Islands subdivision. Add an
entry "Aland Islands": "01" to subdivisions_aliases to improve discoverability
and allow users to specify the subdivision using an English name without
diacritics.
| * <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day> | ||
| * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?> | ||
| """ |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Nit: broken Wikipedia URL
The new reference link for May Day ends with a trailing ?, which 404s on Wikipedia.
- * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?>
+ * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| * <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day> | |
| * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1?> | |
| """ | |
| * <https://en.wikipedia.org/wiki/Åland%27s_Autonomy_Day> | |
| * <https://wiki.aineetonkulttuuriperinto.fi/wiki/Workers%E2%80%99_Labour_Day_on_May_1> | |
| """ |
🤖 Prompt for AI Agents (early access)
In holidays/countries/finland.py around lines 33 to 35, the Wikipedia URL for
May Day ends with an unnecessary trailing question mark that causes a 404 error.
Remove the trailing '?' from the URL to fix the broken link.
| def _populate_unofficial_holidays(self) -> None: | ||
| self.subdiv = "01" | ||
| super()._populate_unofficial_holidays() | ||
|
|
||
| def _populate_public_holidays(self): | ||
| self.subdiv = "01" | ||
| super()._populate_public_holidays() | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
Be careful mutating self.subdiv inside populate methods
Overwriting self.subdiv each time _populate_* is invoked works, but it is a side-effect that can surprise future maintainers (and makes nested calls hard to reason about).
A safer pattern is to leave self.subdiv untouched and call the parent with subdiv="01" at construction, e.g.:
class HolidaysAX(Finland):
def __init__(self, *args, **kwargs):
kwargs.setdefault("subdiv", "01")
super().__init__(*args, **kwargs)Then the populate helpers need no mutation.
🤖 Prompt for AI Agents (early access)
In holidays/countries/aland_islands.py around lines 42 to 49, avoid mutating
self.subdiv inside the _populate_unofficial_holidays and
_populate_public_holidays methods as it causes side effects and complicates
nested calls. Instead, set subdiv="01" once during the class initialization by
overriding the __init__ method, passing subdiv="01" in kwargs to the superclass
constructor. Remove any assignments to self.subdiv in the populate methods so
they do not mutate state.
| subdivisions = () # Override Finland subdivisions. | ||
| subdivisions_aliases = {} # Override Finland subdivisions aliases. | ||
| # Aland Islands got its autonomy on May 7th, 1920. | ||
| start_year = 1921 |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Typo in doc-string (“Aland” → “Åland”)
For consistency and searchability, prefer the diacritical spelling in the public doc-string.
- """Aland Islands holidays.
+ """Åland Islands holidays.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| subdivisions = () # Override Finland subdivisions. | |
| subdivisions_aliases = {} # Override Finland subdivisions aliases. | |
| # Aland Islands got its autonomy on May 7th, 1920. | |
| start_year = 1921 | |
| """Åland Islands holidays.""" | |
| subdivisions = () # Override Finland subdivisions. | |
| subdivisions_aliases = {} # Override Finland subdivisions aliases. | |
| # Aland Islands got its autonomy on May 7th, 1920. | |
| start_year = 1921 |
🤖 Prompt for AI Agents (early access)
In holidays/countries/aland_islands.py around lines 37 to 40, the doc-string
contains a typo where "Aland" is used instead of the correct diacritical
spelling "Åland". Update the doc-string to replace "Aland" with "Åland" to
ensure consistency and improve searchability.
| ("2022-11-13", "Fars dag"), | ||
| ("2022-11-20", "Barnkonventionens dag"), | ||
| ("2022-12-06", "Självständigshetsdagen"), | ||
| ("2022-12-08", "Sibeliusdagen, den finländska musikens dag"), | ||
| ("2022-12-24", "Julafton"), |
There was a problem hiding this comment.
Spelling mistake breaks Swedish localisation test
"Självständigshetsdagen" has an extra “g”. The correct spelling is "Självständighetsdagen".
Tests will fail once the Swedish PO file is compiled.
- ("2022-12-06", "Självständigshetsdagen"),
+ ("2022-12-06", "Självständighetsdagen"),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ("2022-11-13", "Fars dag"), | |
| ("2022-11-20", "Barnkonventionens dag"), | |
| ("2022-12-06", "Självständigshetsdagen"), | |
| ("2022-12-08", "Sibeliusdagen, den finländska musikens dag"), | |
| ("2022-12-24", "Julafton"), | |
| ("2022-11-13", "Fars dag"), | |
| ("2022-11-20", "Barnkonventionens dag"), | |
| - ("2022-12-06", "Självständigshetsdagen"), | |
| + ("2022-12-06", "Självständighetsdagen"), | |
| ("2022-12-08", "Sibeliusdagen, den finländska musikens dag"), | |
| ("2022-12-24", "Julafton"), |
🤖 Prompt for AI Agents (early access)
In tests/countries/test_aland_islands.py around lines 66 to 70, correct the
spelling of "Självständigshetsdagen" to "Självständighetsdagen" to fix the
Swedish localisation test failure caused by the typo.
| ("2022-06-09", "Ahvenanmaan itsehallintopäivä"), | ||
| ("2022-06-24", "Juhannusaatto"), |
There was a problem hiding this comment.
Autonomy Day should not be in default-Finland expectations
Finland(years=2022) without subdiv="01" does not include Åland’s Autonomy Day.
This assertion will fail; remove the line or instantiate with the subdivision.
- ("2022-06-09", "Ahvenanmaan itsehallintopäivä"),📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ("2022-06-09", "Ahvenanmaan itsehallintopäivä"), | |
| ("2022-06-24", "Juhannusaatto"), | |
| ("2022-06-24", "Juhannusaatto"), |
🤖 Prompt for AI Agents (early access)
In tests/countries/test_finland.py around lines 440 to 441, the test incorrectly
expects Åland’s Autonomy Day to be present in the default Finland holidays for
2022, but it should only appear when the subdivision "01" is specified. Fix this
by either removing the line with Autonomy Day from the default Finland test or
by creating the Finland instance with subdiv="01" to include Åland’s holidays.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2536 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 215 216 +1
Lines 13665 13699 +34
Branches 1930 1934 +4
=========================================
+ Hits 13665 13699 +34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Proposed change
Add Åland Islands holidays (languages:
en_US,fi,sv_FI,uk; categories:PUBLIC,UNOFFICIAL), also available as part of Finland holidays as subdivision01.Resolves #2424 .
Supercedes #2449 .
Type of change
holidaysfunctionality in general)Checklist
make check, all checks and tests are green