Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ Sylvain Pasche
Sylvia van Os
Søren Klintrup
Takeshi Osoekawa
Tania Khatun
Tasnim Nishat Islam
Tewodros Meshesha
Tharupahan Jayawardana
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>Mauritania</td>
<td>MR</td>
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
<td></td>
<td></td>
<td><strong>ar</strong>, en_MR, en_US</td>
<td></td>
</tr>
<tr>
Expand Down
33 changes: 19 additions & 14 deletions holidays/countries/mauritania.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.calendars.gregorian import FRI, SAT
from holidays.groups import InternationalHolidays, IslamicHolidays
from holidays.holiday_base import HolidayBase
Expand All @@ -24,8 +26,10 @@ class Mauritania(HolidayBase, InternationalHolidays, IslamicHolidays):
"""

country = "MR"
default_language = "ar"
# %s (estimated).
estimated_label = "%s (estimated)"
estimated_label = tr("%s (تقديري)")
supported_languages = ("ar", "en_MR", "en_US")
weekend = {FRI, SAT}

def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
Expand All @@ -41,32 +45,33 @@ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):

def _populate_public_holidays(self):
# New Year's Day.
self._add_new_years_day("New Year's Day")
self._add_new_years_day(tr("رأس السنة الميلادية"))

# Labor Day.
self._add_labor_day("Labor Day")
self._add_labor_day(tr("عيد العمال"))

# Africa Day.
self._add_africa_day("Africa Day")
self._add_africa_day(tr("يوم أفريقيا"))

# Independence Day.
if self._year >= 1960:
self._add_holiday_nov_28("Independence Day")
self._add_holiday_nov_28(tr("عيد الاستقلال"))

# Islamic holidays.
# Eid al-Fitr.
self._add_eid_al_fitr_day("Eid al-Fitr")
self._add_eid_al_fitr_day_two("Eid al-Fitr")
eid_al_fitr = tr("عيد الفطر")
self._add_eid_al_fitr_day(eid_al_fitr)
self._add_eid_al_fitr_day_two(eid_al_fitr)

# Eid al-Adha.
self._add_eid_al_adha_day("Eid al-Adha")
self._add_eid_al_adha_day_two("Eid al-Adha")
eid_al_adha = tr("عيد الأضحى")
self._add_eid_al_adha_day(eid_al_adha)
self._add_eid_al_adha_day_two(eid_al_adha)

# Muharram/Islamic New Year.
self._add_islamic_new_year_day("Islamic New Year")
# Islamic New Year.
self._add_islamic_new_year_day(tr("رأس السنة الهجرية"))

# Prophet Muhammad's Birthday.
self._add_mawlid_day("Mawlid al-Nabi")
# The Prophet's Birthday.
self._add_mawlid_day(tr("المولد النبوي الشريف"))


class MR(Mauritania):
Expand Down
65 changes: 65 additions & 0 deletions holidays/locale/ar/LC_MESSAGES/MR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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)
#
# Mauritania holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.100\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2025-06-29 16:42+0530\n"
"PO-Revision-Date: 2026-07-03 12:27+0530\n"
"Last-Translator: TaniaRocks <taniakhatun9a@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: ar\n"

#. %s (estimated).
#, c-format
msgid "%s (تقديري)"
msgstr ""

#. New Year's Day.
msgid "رأس السنة الميلادية"
msgstr ""

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

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

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

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

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

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

#. The Prophet's Birthday.
msgid "المولد النبوي الشريف"
msgstr ""
65 changes: 65 additions & 0 deletions holidays/locale/en_MR/LC_MESSAGES/MR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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)
#
# Mauritania holidays locale localization.
#
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.100\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2026-07-03 10:49+0530\n"
"PO-Revision-Date: 2026-07-03 12:27+0530\n"
"Last-Translator: TaniaRocks <taniakhatun9a@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_MR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Source-Language: ar\n"

#. %s (estimated).
#, c-format
msgid "%s (تقديري)"
msgstr "%s (estimated)"

#. New Year's Day.
msgid "رأس السنة الميلادية"
msgstr "New Year's Day"

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

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

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

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

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

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

#. The Prophet's Birthday.
msgid "المولد النبوي الشريف"
msgstr "Prophet Muhammad's Birthday"
65 changes: 65 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/MR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# holidays
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
# --------
# 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)
#
# Mauritania holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.100\n"
"Report-Msgid-Bugs-To: l10n@vacanza.dev\n"
"POT-Creation-Date: 2025-06-29 16:42+0530\n"
"PO-Revision-Date: 2026-07-03 12:27+0530\n"
"Last-Translator: TaniaRocks <taniakhatun9a@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.6\n"
"X-Source-Language: ar\n"

#. %s (estimated).
#, c-format
msgid "%s (تقديري)"
msgstr "%s (estimated)"

#. New Year's Day.
msgid "رأس السنة الميلادية"
msgstr "New Year's Day"

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

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

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

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

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

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

#. The Prophet's Birthday.
msgid "المولد النبوي الشريف"
msgstr "The Prophet's Birthday"
1 change: 1 addition & 0 deletions scripts/generate_site_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"en_LC": "English (Saint Lucia)",
"en_MO": "English (Macau)",
"en_MS": "English (Montserrat)",
"en_MR": "English (Mauritania)",
"en_MU": "English (Mauritius)",
"en_NA": "English (Namibia)",
"en_NF": "English (Norfolk Island)",
Expand Down
67 changes: 49 additions & 18 deletions tests/countries/test_mauritania.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,53 @@ def setUpClass(cls):
super().setUpClass(Mauritania, years=range(1950, 2050))

def test_new_years_day(self):
self.assertHolidayName("New Year's Day", (f"{year}-01-01" for year in range(1950, 2050)))
self.assertHolidayName(
"رأس السنة الميلادية", (f"{year}-01-01" for year in range(1950, 2050))
)

def test_labor_day(self):
self.assertHolidayName("Labor Day", (f"{year}-05-01" for year in range(1950, 2050)))
self.assertHolidayName("عيد العمال", (f"{year}-05-01" for year in range(1950, 2050)))

def test_africa_day(self):
self.assertHolidayName("Africa Day", (f"{year}-05-25" for year in range(1950, 2050)))
self.assertHolidayName("يوم أفريقيا", (f"{year}-05-25" for year in range(1950, 2050)))

def test_independence_day(self):
name = "Independence Day"
name = "عيد الاستقلال"
self.assertHolidayName(name, (f"{year}-11-28" for year in range(1960, 2050)))
self.assertNoHolidayName(name, range(1950, 1960))

def test_2023(self):
self.assertHolidaysInYear(
2023,
("2023-01-01", "New Year's Day"),
("2023-04-21", "Eid al-Fitr (estimated)"),
("2023-04-22", "Eid al-Fitr (estimated)"),
("2023-05-01", "Labor Day"),
("2023-05-25", "Africa Day"),
("2023-06-28", "Eid al-Adha (estimated)"),
("2023-06-29", "Eid al-Adha (estimated)"),
("2023-07-19", "Islamic New Year (estimated)"),
("2023-09-27", "Mawlid al-Nabi (estimated)"),
("2023-11-28", "Independence Day"),
("2023-01-01", "رأس السنة الميلادية"),
("2023-04-21", "عيد الفطر (تقديري)"),
("2023-04-22", "عيد الفطر (تقديري)"),
("2023-05-01", "عيد العمال"),
("2023-05-25", "يوم أفريقيا"),
("2023-06-28", "عيد الأضحى (تقديري)"),
("2023-06-29", "عيد الأضحى (تقديري)"),
("2023-07-19", "رأس السنة الهجرية (تقديري)"),
("2023-09-27", "المولد النبوي الشريف (تقديري)"),
("2023-11-28", "عيد الاستقلال"),
)

def test_2024(self):
self.assertHolidaysInYear(
2024,
def test_l10n_default(self):
self.assertLocalizedHolidays(
("2024-01-01", "رأس السنة الميلادية"),
("2024-04-10", "عيد الفطر (تقديري)"),
("2024-04-11", "عيد الفطر (تقديري)"),
("2024-05-01", "عيد العمال"),
("2024-05-25", "يوم أفريقيا"),
("2024-06-16", "عيد الأضحى (تقديري)"),
("2024-06-17", "عيد الأضحى (تقديري)"),
("2024-07-07", "رأس السنة الهجرية (تقديري)"),
("2024-09-15", "المولد النبوي الشريف (تقديري)"),
("2024-11-28", "عيد الاستقلال"),
)

def test_l10n_en_us(self):
self.assertLocalizedHolidays(
"en_US",
("2024-01-01", "New Year's Day"),
("2024-04-10", "Eid al-Fitr (estimated)"),
("2024-04-11", "Eid al-Fitr (estimated)"),
Expand All @@ -61,6 +77,21 @@ def test_2024(self):
("2024-06-16", "Eid al-Adha (estimated)"),
("2024-06-17", "Eid al-Adha (estimated)"),
("2024-07-07", "Islamic New Year (estimated)"),
("2024-09-15", "Mawlid al-Nabi (estimated)"),
("2024-09-15", "The Prophet's Birthday (estimated)"),
("2024-11-28", "Independence Day"),
)

def test_l10n_en_mr(self):
self.assertLocalizedHolidays(
"en_MR",
("2024-01-01", "New Year's Day"),
("2024-04-10", "Eid al-Fitr (estimated)"),
("2024-04-11", "Eid al-Fitr (estimated)"),
("2024-05-01", "Labor Day"),
("2024-05-25", "Africa Day"),
("2024-06-16", "Eid al-Adha (estimated)"),
("2024-06-17", "Eid al-Adha (estimated)"),
("2024-07-07", "Muharram/Islamic New Year (estimated)"),
("2024-09-15", "Prophet Muhammad's Birthday (estimated)"),
("2024-11-28", "Independence Day"),
)