Skip to content

Update India holidays: add Malayalam language support#3225

Draft
darsana-dev wants to merge 6 commits intovacanza:devfrom
darsana-dev:localize-po-files
Draft

Update India holidays: add Malayalam language support#3225
darsana-dev wants to merge 6 commits intovacanza:devfrom
darsana-dev:localize-po-files

Conversation

@darsana-dev
Copy link

Proposed change

This pull request adds Malayalam (ml) localization support by introducing a
new gettext .po file 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 holidays functionality in general)

  • I've read and followed the contributing guidelines.

  • I've run make check locally; all checks and tests passed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Caution

Review failed

Failed to post review comments

Summary by CodeRabbit

  • New Features

    • Malayalam (ml) localization added for Indian holidays — names and descriptions now available in Malayalam, covering national and regional observances.
    • India’s supported language set updated to include Malayalam.
  • Tests

    • Added tests validating Malayalam translations for a comprehensive set of 2018 Indian holidays.
  • Documentation

    • README updated to reflect Malayalam as a supported language.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds Malayalam (ml) localization for India: updates India supported_languages, adds Malayalam gettext translations, updates README, and adds Malayalam localization tests for Indian holidays.

Changes

Cohort / File(s) Summary
Docs
README.md
Updated India row to include ml in Supported Languages.
Country config
holidays/countries/india.py
Added "ml" to India.supported_languages and inserted Malayalam translations source comment.
Translations
holidays/locale/ml/LC_MESSAGES/IN.po
New Malayalam gettext file with ~172 lines of translations covering national and Kerala/region-specific holidays.
Tests
tests/countries/test_india.py
Added test_l10n_ml with Malayalam expected names for 2018 holiday mappings (~49 lines).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • KJhellico
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding Malayalam language support to India holidays.
Description check ✅ Passed The description relates to the changeset by explaining the Malayalam localization addition and its intent.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KJhellico
Copy link
Collaborator

Look at #3130 as example of PR that adds a localization language to country.

@KJhellico KJhellico marked this pull request as draft January 18, 2026 11:01
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 18, 2026
@darsana-dev
Copy link
Author

Thanks for the reference!
I’ve updated the PR to follow the same gettext structure as #3130 by keeping
only holidays/locale/ml/LC_MESSAGES/holidays.po and removing the extra file.
Please let me know if anything else needs adjustment.

@KJhellico
Copy link
Collaborator

KJhellico commented Jan 18, 2026

same gettext structure as #3130

LC_MESSAGES/holidays.po

Do you see such file in that PR or in the repository at all?

@PPsyrius PPsyrius changed the title Add Malayalam (ml) translations for holiday names Update India holidays: add Malayalam language support Jan 19, 2026
Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md file to include the new ml l10n
<td><strong>en_IN</strong>, en_US, gu, hi, ml</td>
  • Update holidays\countries\india.py to include ml as 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 for tests\countries\test_india.py (place this after test_l10n_en_us)
    def test_l10n_ml(self):
        self.assertLocalizedHolidays(
            "ml",
            .
            .
            .
            ("2018-12-25", "ക്രിസ്മസ്"),
        )

Comment on lines +1 to +28
# 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"
Copy link
Collaborator

@PPsyrius PPsyrius Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Suggested change
# 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"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (അനുമാനിച്ചിരിക്കുന്നു)"


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@KJhellico
Copy link
Collaborator

KJhellico commented Jan 20, 2026

Are you sure?

Copy link
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<td><strong>en_IN</strong>, en_US, gu, hi,ml</td>
<td><strong>en_IN</strong>, en_US, gu, hi, ml</td>

Comment on lines +149 to +152
supported_languages = ("en_IN", "en_US", "gu", "hi","ml")
# Malayalam translations source:
# https://en.wikipedia.org/wiki/Public_holidays_in_India

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Suggested change
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")

Comment on lines +783 to +827
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
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sonarqubecloud
Copy link

msgid ""
msgstr ""
"Project-Id-Version: Holidays\n"
"POT-Creation-Date: 2026-01-18 00:00+0000\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New change from #3274 (if you're finishing this PR later)

Suggested change
"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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants