Skip to content

Update Mauritania holidays: add l10n support#3660

Open
TaniaRocks wants to merge 4 commits into
vacanza:devfrom
TaniaRocks:fix-untranslated-files
Open

Update Mauritania holidays: add l10n support#3660
TaniaRocks wants to merge 4 commits into
vacanza:devfrom
TaniaRocks:fix-untranslated-files

Conversation

@TaniaRocks

@TaniaRocks TaniaRocks commented Jul 1, 2026

Copy link
Copy Markdown

Proposed change

Added Arabic localization for Mauritania (MR) holidays.

Changes

  • Added holidays/locale/ar/LC_MESSAGES/MR.po
  • Added Arabic translations for Mauritania holiday names
  • Updated README.md to include the new localization

Related to #3152

Type of change

  • Supported country/market holidays update (calendar discrepancy fix, localization)

Checklist

  • I've read and followed the contributing guidelines.
  • I've run make check locally; all checks and tests passed.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds gettext-based localization for Mauritania holidays, introduces Arabic, en_MR, and en_US locale catalogs, updates Mauritania tests for localized names, and corrects the README country table row.

Changes

Mauritania i18n support

Layer / File(s) Summary
Translation wiring and holiday labels
holidays/countries/mauritania.py
Imports gettext as tr, sets the Mauritania default language and supported languages, updates the estimated label template, and wraps public holiday names in translated strings.
Locale catalogs
holidays/locale/ar/LC_MESSAGES/MR.po, holidays/locale/en_MR/LC_MESSAGES/MR.po, holidays/locale/en_US/LC_MESSAGES/MR.po
Adds new gettext catalogs for Mauritania with header metadata, holiday msgid entries, and the estimated-date format string.
Tests and reference updates
tests/countries/test_mauritania.py, README.md, CONTRIBUTORS
Updates Mauritania tests for Arabic default output and en_US localization, corrects the README country row, and adds a contributor entry.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • vacanza/holidays#3605: Both PRs add country-specific gettext-based localization with default_language/supported_languages, translated labels, and locale catalogs.

Suggested reviewers: PPsyrius, KJhellico

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding localization support for Mauritania holidays.
Description check ✅ Passed The description is directly related to the changeset and describes the added Mauritania holiday localization work.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
holidays/countries/mauritania.py (1)

29-72: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Author the Mauritania labels in Arabic

default_language = "ar" means these names need Arabic source literals so tr() matches the default-language catalog. The current English holiday names and plain estimated_label will fall back to English for Arabic users; use Arabic literals here and wrap estimated_label with tr(...) as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@holidays/countries/mauritania.py` around lines 29 - 72, The Mauritania
holiday labels are still defined with English source strings even though
Mauritania’s default_language is set to Arabic, so they won’t resolve correctly
through tr(). Update Mauritania’s holiday names in _populate_public_holidays()
to use Arabic literals for each holiday label, and change estimated_label to be
translated as well by wrapping it with tr(...). Use the existing Mauritania
class symbols default_language, estimated_label, and _populate_public_holidays
to locate the changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@holidays/countries/mauritania.py`:
- Around line 29-72: The Mauritania holiday labels are still defined with
English source strings even though Mauritania’s default_language is set to
Arabic, so they won’t resolve correctly through tr(). Update Mauritania’s
holiday names in _populate_public_holidays() to use Arabic literals for each
holiday label, and change estimated_label to be translated as well by wrapping
it with tr(...). Use the existing Mauritania class symbols default_language,
estimated_label, and _populate_public_holidays to locate the changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4305f79f-eb90-4460-a192-0fab8522393a

📥 Commits

Reviewing files that changed from the base of the PR and between af39ce7 and b25f92f.

📒 Files selected for processing (3)
  • README.md
  • holidays/countries/mauritania.py
  • holidays/locale/ar/LC_MESSAGES/MR.po

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@KJhellico

Copy link
Copy Markdown
Collaborator

@TaniaRocks, I recommend looking at some examples of adding l10n support: #3091, #3117, #3389, #3605.

@PPsyrius PPsyrius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO you'll need to include the Arabic source(s) you used for the holiday names as well (any news websites are fine, but government ones are preferred)

I would recommend running make l10n after make setup since that auto-populates the .po files for your l10n work here instead of copying them manually from elsewhere - see https://holidays.readthedocs.io/en/latest/contributing/#running-tests for more details.

For the list of supported languages, I think we can go with these 3 for now (or more if you happen to find more/be a native speaker for certain languages)

  • ar: Mauritania's national language
  • en_MR: previous holiday names wording, local to Mauritania
  • en_US: library-wide fallback standard, for naming see egypt.py for example - note that holiday names comment above needs to be standardised to en_US ones as well.

Aside from that, test_l10n_default (for ar), test_l10n_en_mr, and test_l10n_en_us needs to be added to at the very end of the test_mauritania.py as well, see test_singapore.py implementation for example - let's use year 2024 for this and remove the old test_2024 test case

Comment thread holidays/countries/mauritania.py Outdated
Comment thread holidays/locale/ar/LC_MESSAGES/MR.po Outdated
Comment thread holidays/locale/ar/LC_MESSAGES/MR.po Outdated
Comment thread holidays/countries/mauritania.py Outdated
Comment thread README.md Outdated
@github-actions github-actions Bot added the test label Jul 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
holidays/locale/ar/LC_MESSAGES/MR.po (1)

46-48: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Missing translator comment for Independence Day.

en_US/LC_MESSAGES/MR.po has #. Independence Day. before this msgid, but it's missing here. The Python source (mauritania.py) has the # Independence Day. comment, so this catalog is out of sync — likely make l10n wasn't rerun after the latest source edit.

Based on learnings, translator comments in .po files are auto-generated from source comments and should be fixed by regenerating via make l10n, not hand-edited.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@holidays/locale/ar/LC_MESSAGES/MR.po` around lines 46 - 48, The MR.po catalog
is missing the auto-generated translator comment for the Independence Day msgid,
so it is out of sync with the source comments in mauritania.py. Regenerate the
localization files with make l10n rather than editing MR.po by hand, and ensure
the resulting entry for the "عيد الاستقلال" msgid includes the translated
comment metadata that matches the en_US/LC_MESSAGES/MR.po catalog.

Source: Learnings

holidays/locale/en_US/LC_MESSAGES/MR.po (1)

30-66: 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win

All msgstr entries are empty — English translations aren't actually provided.

Every msgid in this catalog has msgstr "". Since en_US isn't the default/source language, untranslated entries here mean gettext falls back to the Arabic msgid at runtime, not English. This breaks the entire purpose of the en_US locale and will make test_l10n_en_us in tests/countries/test_mauritania.py fail (it expects "New Year's Day", "Labor Day", etc.).

🌐 Example fix (populate actual English translations)
 #. New Year's Day.
 msgid "رأس السنة الميلادية"
-msgstr ""
+msgstr "New Year's Day"

 #. Labor Day.
 msgid "عيد العمال"
-msgstr ""
+msgstr "Labor Day"

 #. Africa Day.
 msgid "يوم أفريقيا"
-msgstr ""
+msgstr "Africa Day"

 #. Independence Day.
 msgid "عيد الاستقلال"
-msgstr ""
+msgstr "Independence Day"

 #. Eid al-Fitr.
 msgid "عيد الفطر"
-msgstr ""
+msgstr "Eid al-Fitr"

 #. Eid al-Adha.
 msgid "عيد الأضحى"
-msgstr ""
+msgstr "Eid al-Adha"

 #. Muharram/Islamic New Year.
 msgid "رأس السنة الهجرية"
-msgstr ""
+msgstr "Islamic New Year"

 #. Prophet Muhammad's Birthday.
 msgid "المولد النبوي الشريف"
-msgstr ""
+msgstr "The Prophet's Birthday"

 #. %s (estimated).
 #, c-format
 msgid "%s (تقديري)"
-msgstr ""
+msgstr "%s (estimated)"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@holidays/locale/en_US/LC_MESSAGES/MR.po` around lines 30 - 66, Populate the
empty msgstr values in the en_US translation catalog so the locale returns
English strings instead of falling back to the Arabic msgid. Update each holiday
entry in this file (for example the records for New Year's Day, Labor Day,
Africa Day, Independence Day, Eid al-Fitr, Eid al-Adha, Muharram/Islamic New
Year, and Prophet Muhammad's Birthday) by filling in the English translation in
msgstr, keeping the existing msgid keys and c-format marker for the estimated
date entry. This will align the MR.po catalog with the expectations in
test_l10n_en_us and ensure the locale works as a true English translation set.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 1138-1140: The README table has an incorrect country label for the
MR row: update the entry in the localization/country mapping table so MR is
labeled Mauritania instead of Mauritius. Locate the MR row in README.md and
change only that row’s name to match the correct country while keeping the rest
of the table structure and locale values unchanged.

---

Outside diff comments:
In `@holidays/locale/ar/LC_MESSAGES/MR.po`:
- Around line 46-48: The MR.po catalog is missing the auto-generated translator
comment for the Independence Day msgid, so it is out of sync with the source
comments in mauritania.py. Regenerate the localization files with make l10n
rather than editing MR.po by hand, and ensure the resulting entry for the "عيد
الاستقلال" msgid includes the translated comment metadata that matches the
en_US/LC_MESSAGES/MR.po catalog.

In `@holidays/locale/en_US/LC_MESSAGES/MR.po`:
- Around line 30-66: Populate the empty msgstr values in the en_US translation
catalog so the locale returns English strings instead of falling back to the
Arabic msgid. Update each holiday entry in this file (for example the records
for New Year's Day, Labor Day, Africa Day, Independence Day, Eid al-Fitr, Eid
al-Adha, Muharram/Islamic New Year, and Prophet Muhammad's Birthday) by filling
in the English translation in msgstr, keeping the existing msgid keys and
c-format marker for the estimated date entry. This will align the MR.po catalog
with the expectations in test_l10n_en_us and ensure the locale works as a true
English translation set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 55ea916d-d0d9-415f-b42d-ed5ef605ecc6

📥 Commits

Reviewing files that changed from the base of the PR and between b25f92f and ba10b22.

📒 Files selected for processing (6)
  • CONTRIBUTORS
  • README.md
  • holidays/countries/mauritania.py
  • holidays/locale/ar/LC_MESSAGES/MR.po
  • holidays/locale/en_US/LC_MESSAGES/MR.po
  • tests/countries/test_mauritania.py

Comment thread README.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread holidays/locale/en_US/LC_MESSAGES/MR.po
Comment thread README.md
@KJhellico

Copy link
Copy Markdown
Collaborator
  • en_MR: previous holiday names wording, local to Mauritania

I doubt that English is used to any significant extent in Mauritania. The current English names seem to be just common terms.

@github-actions github-actions Bot added the script label Jul 3, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@TaniaRocks

Copy link
Copy Markdown
Author
  • en_MR: previous holiday names wording, local to Mauritania

I doubt that English is used to any significant extent in Mauritania. The current English names seem to be just common terms.

Thanks for the clarification. I added the localization following the existing naming pattern in the project. If different English names would be more appropriate for Mauritania, I'd be happy to revise them.

@KJhellico

Copy link
Copy Markdown
Collaborator

I added the localization following the existing naming pattern in the project. If different English names would be more appropriate for Mauritania, I'd be happy to revise them.

I mean, English isn't widely used in Mauritania, so en_MR locale is redundant.

@KJhellico KJhellico changed the title Add Arabic localization for Mauritania holidays Update Mauritania holidays: add l10n support Jul 3, 2026

@eeshsaxena eeshsaxena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding l10n for Mauritania! The mechanics look solid - default_language = "ar" matches Mauritania's official language, both non-default locales (en_MR, en_US) are fully translated, the #. context comments come through for every entry, and the test split into test_l10n_default / test_l10n_en_us / test_l10n_en_mr follows the usual pattern.

One consistency thing I noticed while comparing the two English .po files. en_MR and en_US agree on every holiday except the two Islamic-calendar ones:

msgid en_US en_MR
رأس السنة الهجرية Islamic New Year Muharram/Islamic New Year
المولد النبوي الشريف The Prophet's Birthday Prophet Muhammad's Birthday

Since both are English locales and there's no real US-vs-Mauritania English naming difference for these, the split looks unintentional. It might also be worth aligning them with the names already used elsewhere in the library, which would keep these holidays consistent for anyone comparing countries in English:

  • Islamic New Year - used in 23 en_US locale files (vs. Muharram/Islamic New Year, which is new here).
  • Prophet's Birthday - used in 39 en_US locale files; this PR uses The Prophet's Birthday (en_US) and Prophet Muhammad's Birthday (en_MR), neither of which matches the common form.

So aligning both locales to Islamic New Year and Prophet's Birthday would match the established convention. Not a blocker, and please disregard if the regional difference is deliberate - just flagging it since the rest of the file lines up so cleanly. Deferring to the maintainers on the naming call.

@eeshsaxena eeshsaxena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for working on this. The Arabic default plus the en_US/en_MR split reads well and the test restructuring into test_l10n_default/test_l10n_en_us/test_l10n_en_mr follows the usual pattern. A couple of things I noticed while reading through:

1. en_US and en_MR disagree on two holiday names. For the same two Arabic msgids, the two English locales translate differently:

Arabic msgid en_US en_MR
رأس السنة الهجرية Islamic New Year Muharram/Islamic New Year
المولد النبوي الشريف The Prophet's Birthday Prophet Muhammad's Birthday

The en_US strings match the updated source comments in mauritania.py (# Islamic New Year., # The Prophet's Birthday.), while en_MR keeps the pre-change wording (Muharram/Islamic New Year, Mawlid al-Nabi -> Prophet Muhammad's Birthday). Is the difference intentional (some Mauritania-specific English usage), or should en_MR match the source/en_US wording? If there's no deliberate regional distinction, aligning them would avoid two English variants of the same holiday drifting apart.

2. .po header comments. Comparing with existing locales (e.g. en_US/LC_MESSAGES/DZ.po -> # Algeria holidays en_US localization.):

  • en_US/LC_MESSAGES/MR.po currently has # Mauritania holidays. - for a non-default locale this is usually # Mauritania holidays en_US localization.
  • en_MR/LC_MESSAGES/MR.po has # Mauritania holidays locale localization. - the locale looks like a leftover template placeholder that should read en_MR; there's also a doubled blank # line just below it.

The ar/LC_MESSAGES/MR.po header (# Mauritania holidays.) is correct as-is since ar is the default language.

None of this is blocking from my side - point 1 is the one I'd want a maintainer's read on. Deferring to @PPsyrius for the final call.

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.

5 participants