Update India holidays: add Malayalam language support#3225
Update India holidays: add Malayalam language support#3225darsana-dev wants to merge 6 commits intovacanza:devfrom
Conversation
|
Caution Review failedFailed to post review comments Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds Malayalam (ml) localization for India: updates India supported_languages, adds Malayalam gettext translations, updates README, and adds Malayalam localization tests for Indian holidays. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! 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. Comment |
|
Look at #3130 as example of PR that adds a localization language to country. |
|
Thanks for the reference! |
Do you see such file in that PR or in the repository at all? |
There was a problem hiding this comment.
Please check https://github.com/vacanza/holidays/pull/3130/files again for reference since that's the most straightforward example needed for this PR.
Aside from the l10n file itself, you'll need to update these files as well:
- Update
README.mdfile to include the newmll10n
<td><strong>en_IN</strong>, en_US, gu, hi, ml</td>- Update
holidays\countries\india.pyto includemlas one of the supported languages - if possible, add the sources you use for Malayalam holiday translations as well even if you're a native Malayalam speaker.
supported_languages = ("en_IN", "en_US", "gu", "hi", "ml") * Malayalam:
* <link_to_your_translation_reference>- Add
def test_l10n_ml(self)test case fortests\countries\test_india.py(place this aftertest_l10n_en_us)
def test_l10n_ml(self):
self.assertLocalizedHolidays(
"ml",
.
.
.
("2018-12-25", "ക്രിസ്മസ്"),
)| # holidays | ||
| # -------- | ||
| # A fast, efficient Python library for generating country, province and state | ||
| # specific sets of holidays on the fly. It aims to make determining whether a | ||
| # specific date is a holiday as fast and flexible as possible. | ||
| # | ||
| # Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file) | ||
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
| # Website: https://github.com/vacanza/holidays | ||
| # License: MIT (see LICENSE file) | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: holidays 0.1\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" | ||
| "PO-Revision-Date: 2026-01-18 00:00+0000\n" | ||
| "Last-Translator: Devadarsana R <devadarsana06@gmail.com>\n" | ||
| "Language-Team: Malayalam\n" | ||
| "Language: ml\n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" |
There was a problem hiding this comment.
The folder location is correct, but please change the file name to IN.po, then run make l10n command to see the updated list of l10n that requires translation (i.e. India holidays list doesn't include New Year's Day at the moment, while missing ~40 actual entries)
| # holidays | |
| # -------- | |
| # A fast, efficient Python library for generating country, province and state | |
| # specific sets of holidays on the fly. It aims to make determining whether a | |
| # specific date is a holiday as fast and flexible as possible. | |
| # | |
| # Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file) | |
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | |
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | |
| # Website: https://github.com/vacanza/holidays | |
| # License: MIT (see LICENSE file) | |
| msgid "" | |
| msgstr "" | |
| "Project-Id-Version: holidays 0.1\n" | |
| "Report-Msgid-Bugs-To: \n" | |
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" | |
| "PO-Revision-Date: 2026-01-18 00:00+0000\n" | |
| "Last-Translator: Devadarsana R <devadarsana06@gmail.com>\n" | |
| "Language-Team: Malayalam\n" | |
| "Language: ml\n" | |
| "MIME-Version: 1.0\n" | |
| "Content-Type: text/plain; charset=UTF-8\n" | |
| "Content-Transfer-Encoding: 8bit\n" | |
| # holidays | |
| # -------- | |
| # A fast, efficient Python library for generating country, province and state | |
| # specific sets of holidays on the fly. It aims to make determining whether a | |
| # specific date is a holiday as fast and flexible as possible. | |
| # | |
| # Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file) | |
| # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | |
| # ryanss <ryanssdev@icloud.com> (c) 2014-2017 | |
| # Website: https://github.com/vacanza/holidays | |
| # License: MIT (see LICENSE file) | |
| # | |
| # India holidays ml localization. | |
| # | |
| msgid "" | |
| msgstr "" | |
| "Project-Id-Version: Holidays 0.89\n" | |
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" | |
| "PO-Revision-Date: 2026-01-19 11:10+0700\n" | |
| "Last-Translator: Devadarsana R <devadarsana06@gmail.com>\n" | |
| "Language-Team: Holidays Localization Team\n" | |
| "Language: ml\n" | |
| "MIME-Version: 1.0\n" | |
| "Content-Type: text/plain; charset=UTF-8\n" | |
| "Content-Transfer-Encoding: 8bit\n" | |
| "Generated-By: Lingva 5.0.5\n" | |
| "X-Generator: Poedit 3.8\n" | |
| "X-Source-Language: en_IN\n" |
There was a problem hiding this comment.
Thanks for the detailed guidance.
I understand now — the localization should be country-scoped. I’ll rename the file to IN.po, run make l10n to regenerate the required entries, and complete the missing translations.
I’ll also update README.md, india.py (supported_languages + sources), and add the ml test case as suggested. Will push an updated commit shortly.
| @@ -0,0 +1,172 @@ | |||
| # holidays | |||
There was a problem hiding this comment.
We have a standard file header and a standard set of metadata for .po files. Please take a look at them.
| msgid "%s (estimated)" | ||
| msgstr "%s (അനുമാനിച്ചിരിക്കുന്നു)" | ||
|
|
||
|
|
There was a problem hiding this comment.
The .po file is not created manually; it's generated as a result of running make l10n and should only contain strings that are present in .py file (and which need to be translated into the target language).
Are you sure? |
PPsyrius
left a comment
There was a problem hiding this comment.
I would strongly suggest reviewing the contributor guide at https://holidays.readthedocs.io/en/latest/contributing/ to ensure your environment is set up correctly to run the required commands (e.g. make check, make pre-commit, etc.)
| <td>IN</td> | ||
| <td>States: AN (Andaman and Nicobar Islands), AP (Andhra Pradesh), AR (Arunachal Pradesh, Arunāchal Pradesh), AS (Assam), BR (Bihar, Bihār), CG (Chhattisgarh, Chhattīsgarh), CH (Chandigarh, Chandīgarh), DH (Dadra and Nagar Haveli and Daman and Diu, Dādra and Nagar Haveli and Damān and Diu), DL (Delhi), GA (Goa), GJ (Gujarat, Gujarāt), HP (Himachal Pradesh, Himāchal Pradesh), HR (Haryana, Haryāna), JH (Jharkhand, Jhārkhand), JK (Jammu and Kashmir, Jammu and Kashmīr), KA (Karnataka, Karnātaka), KL (Kerala), LA (Ladakh, Ladākh), LD (Lakshadweep), MH (Maharashtra, Mahārāshtra), ML (Meghalaya, Meghālaya), MN (Manipur), MP (Madhya Pradesh), MZ (Mizoram), NL (Nagaland, Nāgāland), OD (Odisha), PB (Punjab), PY (Puducherry), RJ (Rajasthan, Rājasthān), SK (Sikkim), TN (Tamil Nadu, Tamil Nādu), TR (Tripura), TS (Telangana, Telangāna), UK (Uttarakhand, Uttarākhand), UP (Uttar Pradesh), WB (West Bengal)</td> | ||
| <td><strong>en_IN</strong>, en_US, gu, hi</td> | ||
| <td><strong>en_IN</strong>, en_US, gu, hi,ml</td> |
There was a problem hiding this comment.
| <td><strong>en_IN</strong>, en_US, gu, hi,ml</td> | |
| <td><strong>en_IN</strong>, en_US, gu, hi, ml</td> |
| supported_languages = ("en_IN", "en_US", "gu", "hi","ml") | ||
| # Malayalam translations source: | ||
| # https://en.wikipedia.org/wiki/Public_holidays_in_India | ||
|
|
There was a problem hiding this comment.
Move the Malayalam l10n reference to the correct section instead - also I don't think there's any Malayalam l10n reference in your English language Wikipedia citation?
| supported_languages = ("en_IN", "en_US", "gu", "hi","ml") | |
| # Malayalam translations source: | |
| # https://en.wikipedia.org/wiki/Public_holidays_in_India | |
| supported_languages = ("en_IN", "en_US", "gu", "hi", "ml") |
| def test_l10n_ml(self): | ||
| self.assertLocalizedHolidays( | ||
| "ml", | ||
| ( | ||
| ("2018-01-26", "പ്രജാസത്താക ദിനം"), # Republic Day | ||
| ("2018-08-15", "സ്വാതന്ത്ര്യ ദിനം"), # Independence Day | ||
| ("2018-10-02", "ഗാന്ധി ജയന്തി"), # Gandhi Jayanti | ||
| ("2018-04-30", "ബുദ്ധ പൂർത്തിമ"), # Buddha Purnima | ||
| ("2018-11-07", "ദീപാവലി"), # Diwali | ||
| ("2018-08-03", "ജന്മാഷ്ടമി"), # Janmashtami | ||
| ("2018-10-19", "ദസേര"), # Dussehra | ||
| ("2018-04-18", "മഹാവീർ ജയന്തി"), # Mahavir Jayanti | ||
| ("2018-02-13", "മഹാ ശിവരാത്രി"), # Maha Shivaratri | ||
| ("2018-11-23", "ഗുരു നാനക് ജയന്തി"), # Guru Nanak Jayanti | ||
| ("2018-09-20", "മോഹറം"), # Muharram | ||
| ("2018-11-21", "മിലാദ്-ഉൻ-നബി"), # Milad-un-Nabi | ||
| ("2018-06-15", "ഇദ്-ഉൽ-ഫിത്ര"), # Id-ul-Fitr | ||
| ("2018-08-22", "ബकरीഇദ്"), # Bakrid | ||
| ("2018-03-30", "ഗുഡ് ഫ്രൈഡേ"), # Good Friday | ||
| ("2018-12-25", "ക്രിസ്മസ്"), # Christmas | ||
| ("2018-11-14", "ബാലദിനം"), # Children's Day | ||
| ("2018-03-02", "ഹോളി"), # Holi | ||
| ("2018-09-13", "ഗണേശ ചതുർത്തി"), # Ganesh Chaturthi | ||
| ("2018-11-08", "ഗോവർധൻ പൂജ"), # Govardhan Puja | ||
| ("2018-05-01", "ശ്രമിക ദിനം"), # Labour Day | ||
| ("2018-10-17", "മഹാ നവമി"), # Maha Navami | ||
| ("2018-01-14", "മകര സംക്രാന്തി"), # Makar Sankranti | ||
| ("2018-08-26", "രക്ഷാബന്ധൻ"), # Raksha Bandhan | ||
| ("2018-04-13", "രാമ നവമി"), # Ram Navami | ||
| ("2018-10-10", "നവരാത്രി / ശറദ് നവരാത്രി"), # Navratri / Sharad Navratri | ||
| ("2018-03-25", "ഈസ്റ്റർ സണ്ടേ"), # Easter Sunday | ||
| ("2018-03-25", "പാം സണ്ടേ"), # Palm Sunday | ||
| ("2018-04-14", "ഡോ. ബി.ആർ. ആംബേദ്കർ ജയന്തി"), # Dr. B. R. Ambedkar Jayanti | ||
| ("2018-11-01", "കേരള സ്ഥാപക ദിനം"), # Kerala Foundation Day | ||
| ("2018-08-15", "ആന്ധ്ര പ്രദേശ് സ്ഥാപക ദിനം"), # Andhra Pradesh Foundation Day | ||
| ("2018-03-18", "ഉഗാടി"), # Ugadi | ||
| ("2018-01-14", "മാഘ് ബിഹു"), # Magh Bihu | ||
| ("2018-12-02", "ബിഹാർ ദിനം"), # Bihar Day | ||
| ("2018-11-01", "ഒഡിഷാ ദിനം (ഉത്കല ദിനം)"), # Odisha Day | ||
| ("2018-08-15", "ഗോവാ മോക്ഷ ദിനം"), # Goa Liberation Day | ||
| ("2018-10-17", "ഒണം"), # Onam | ||
| ("2018-10-02", "സാർദാർ വല്ലഭഭായി പട്ടേൽ ജയന്തി"), # Sardar Vallabhbhai Patel Jayanti | ||
| ("2018-11-14", "വൈശാഖി"), # Vaisakhi | ||
| ) | ||
| ) |
There was a problem hiding this comment.
IMO once the full Malayalam l10n list is ready, it's probably quicker to add this test case by hand (20 minutes max) than relying on LLM for this one.
Just copy test_l10n_en_us or test_l10n_hi then replace those with Malayalam's
|
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Holidays\n" | ||
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" |
There was a problem hiding this comment.
New change from #3274 (if you're finishing this PR later)
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" | |
| "Report-Msgid-Bugs-To: l10n@vacanza.dev\n" | |
| "POT-Creation-Date: 2026-01-18 00:00+0000\n" |



Proposed change
This pull request adds Malayalam (
ml) localization support by introducing anew gettext
.pofile for holiday names.The change follows the existing localization structure used in the repository
and improves language coverage without modifying any existing holiday logic,
APIs, or behavior. No breaking changes are introduced.
This contribution focuses on improving accessibility and internationalization
by enabling Malayalam-speaking users to view holiday names in their native
language.
Type of change
[] New country/market holidays support (thank you!)
[] Supported country/market holidays update (calendar discrepancy fix, localization)
Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
[] Dependency update (version deprecation/pin/upgrade)
[] Bugfix (non-breaking change which fixes an issue)
[] Breaking change (a code change causing existing functionality to break)
[] New feature (new
holidaysfunctionality in general)I've read and followed the contributing guidelines.
I've run
make checklocally; all checks and tests passed.