+
Skip to content

Update San Marino holidays, add l10n support #2684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 28, 2025
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,8 @@ any) in brackets, available languages and additional holiday categories. All cou
<td>San Marino</td>
<td>SM</td>
<td></td>
<td></td>
<td></td>
<td>en_US, <strong>it</strong>, uk</td>
<td>BANK</td>
</tr>
<tr>
<td>Sao Tome and Principe</td>
Expand Down
75 changes: 49 additions & 26 deletions holidays/countries/san_marino.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.constants import BANK, PUBLIC
from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase

Expand All @@ -19,9 +22,17 @@ class SanMarino(HolidayBase, ChristianHolidays, InternationalHolidays):

References:
* <https://en.wikipedia.org/wiki/Public_holidays_in_San_Marino>
* [Bank holiday calendar (Italian)](https://web.archive.org/web/20250627182751/https://www.bcsm.sm/funzioni/funzioni-statutarie/sistema-dei-pagamenti/calendario-festività)
* [Bank holiday calendar (English)](https://web.archive.org/web/20250627182741/https://www.bcsm.sm/en/functions/statutory-functions/payment-system/bank-holiday-calendar)
* [Law No. 7 of Feb. 17, 1961](https://web.archive.org/web/20250122105136/https://www.consigliograndeegenerale.sm/on-line/home/archivio-leggi-decreti-e-regolamenti/documento17018406.html)
"""

country = "SM"
default_language = "it"
# Law No. 7 of Feb. 17, 1961.
start_year = 1962
supported_categories = (BANK, PUBLIC)
supported_languages = ("en_US", "it", "uk")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -30,58 +41,70 @@ def __init__(self, *args, **kwargs):

def _populate_public_holidays(self) -> None:
# New Year's Day.
self._add_new_years_day("New Year's Day")
self._add_new_years_day(tr("Capodanno"))

# Epiphany.
self._add_epiphany_day("Epiphany")
self._add_epiphany_day(tr("Epifania"))

# Feast of Saint Agatha.
self._add_holiday_feb_5("Feast of Saint Agatha")
self._add_holiday_feb_5(
# Anniversary of the Liberation of the Republic and Feast of Saint Agatha.
tr("Anniversario della Liberazione della Repubblica e Festa di Sant'Agata")
)

# Anniversary of the Arengo.
self._add_holiday_mar_25("Anniversary of the Arengo")
self._add_holiday_mar_25(tr("Anniversario dell'Arengo"))

# Easter Sunday.
self._add_easter_sunday("Easter Sunday")
self._add_easter_sunday(tr("Pasqua"))

# Easter Monday.
self._add_easter_monday("Easter Monday")
self._add_easter_monday(tr("Lunedì dell'angelo"))

# Investiture of Captains Regent.
name = tr("Investitura Capitani Reggenti")
self._add_holiday_apr_1(name)
self._add_holiday_oct_1(name)

# Labour Day.
self._add_labor_day("Labour Day")
# Workers' Day.
self._add_labor_day(tr("Festa dei lavoratori"))

# Corpus Cristi.
self._add_corpus_christi_day("Corpus Cristi")
# Corpus Christi.
self._add_corpus_christi_day(tr("Corpus Domini"))

# Liberation from Fascism Day.
self._add_holiday_jul_28("Liberation from Fascism Day")
self._add_holiday_jul_28(
# Anniversary of the Fall of Fascism and Freedom Day.
tr("Anniversario della Caduta del Fascismo e Festa della Libertà")
)

# Assumption of Mary.
self._add_assumption_of_mary_day("Assumption Day")
# Assumption Day.
self._add_assumption_of_mary_day(tr("Assunzione della B.V. Maria"))

# The Feast of Saint Marinus and the Republic.
self._add_holiday_sep_3("Foundation Day")
self._add_holiday_sep_3(
# Saint Marinus' Day, Anniversary of the Founding of the Republic.
tr("San Marino, Anniversario di Fondazione della Repubblica")
)

# All Saints' Day.
self._add_all_saints_day("All Saints' Day")
self._add_all_saints_day(tr("Tutti i Santi"))

# Commemoration of the Dead.
self._add_all_souls_day("Commemoration of the Dead")
self._add_all_souls_day(tr("Commemorazione dei defunti"))

# Immaculate Conception.
self._add_immaculate_conception_day("Immaculate Conception Day")

# Christmas Eve.
self._add_christmas_eve("Christmas Eve")
self._add_immaculate_conception_day(tr("Immacolata Concezione"))

# Christmas Day.
self._add_christmas_day("Christmas Day")
self._add_christmas_day(tr("Natale"))

# Saint Stephen's Day.
self._add_christmas_day_two("Saint Stephen's Day")
self._add_christmas_day_two(tr("Santo Stefano"))

def _populate_bank_holidays(self):
# Christmas Eve.
self._add_christmas_eve(tr("Vigilia di Natale"))

# New Year's Eve.
self._add_new_years_eve("New Year's Eve")
self._add_new_years_eve(tr("Ultimo dell'anno"))


class SM(SanMarino):
Expand Down
103 changes: 103 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/SM.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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)
#
# San Marino holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.76\n"
"POT-Creation-Date: 2025-06-28 12:54+0300\n"
"PO-Revision-Date: 2025-06-28 12:54+0300\n"
"Last-Translator: ~Jhellico <jhellico@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: it\n"

#. New Year's Day.
msgid "Capodanno"
msgstr "New Year's Day"

#. Epiphany.
msgid "Epifania"
msgstr "Epiphany"

#. Anniversary of the Liberation of the Republic and Feast of Saint Agatha.
msgid "Anniversario della Liberazione della Repubblica e Festa di Sant'Agata"
msgstr "Anniversary of the Liberation of the Republic and Feast of Saint Agatha"

#. Anniversary of the Arengo.
msgid "Anniversario dell'Arengo"
msgstr "Anniversary of the Arengo"

#. Easter Sunday.
msgid "Pasqua"
msgstr "Easter Sunday"

#. Easter Monday.
msgid "Lunedì dell'angelo"
msgstr "Easter Monday"

#. Investiture of Captains Regent.
msgid "Investitura Capitani Reggenti"
msgstr "Investiture of Captains Regent"

#. Workers' Day.
msgid "Festa dei lavoratori"
msgstr "Workers' Day"

#. Corpus Christi.
msgid "Corpus Domini"
msgstr "Corpus Christi"

#. Anniversary of the Fall of Fascism and Freedom Day.
msgid "Anniversario della Caduta del Fascismo e Festa della Libertà"
msgstr "Anniversary of the Fall of Fascism and Freedom Day"

#. Assumption Day.
msgid "Assunzione della B.V. Maria"
msgstr "Assumption Day"

#. Saint Marinus' Day, Anniversary of the Founding of the Republic.
msgid "San Marino, Anniversario di Fondazione della Repubblica"
msgstr "Saint Marinus' Day, Anniversary of the Founding of the Republic"

#. All Saints' Day.
msgid "Tutti i Santi"
msgstr "All Saints' Day"

#. Commemoration of the Dead.
msgid "Commemorazione dei defunti"
msgstr "Commemoration of the Dead"

#. Immaculate Conception.
msgid "Immacolata Concezione"
msgstr "Immaculate Conception"

#. Christmas Day.
msgid "Natale"
msgstr "Christmas Day"

#. Saint Stephen's Day.
msgid "Santo Stefano"
msgstr "Saint Stephen's Day"

#. Christmas Eve.
msgid "Vigilia di Natale"
msgstr "Christmas Eve"

#. New Year's Eve.
msgid "Ultimo dell'anno"
msgstr "New Year's Eve"
103 changes: 103 additions & 0 deletions holidays/locale/it/LC_MESSAGES/SM.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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)
#
# San Marino holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.76\n"
"POT-Creation-Date: 2025-06-28 12:54+0300\n"
"PO-Revision-Date: 2025-06-28 12:54+0300\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Holidays Localization Team\n"
"Language: it\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: it\n"

#. New Year's Day.
msgid "Capodanno"
msgstr ""

#. Epiphany.
msgid "Epifania"
msgstr ""

#. Anniversary of the Liberation of the Republic and Feast of Saint Agatha.
msgid "Anniversario della Liberazione della Repubblica e Festa di Sant'Agata"
msgstr ""

#. Anniversary of the Arengo.
msgid "Anniversario dell'Arengo"
msgstr ""

#. Easter Sunday.
msgid "Pasqua"
msgstr ""

#. Easter Monday.
msgid "Lunedì dell'angelo"
msgstr ""

#. Investiture of Captains Regent.
msgid "Investitura Capitani Reggenti"
msgstr ""

#. Workers' Day.
msgid "Festa dei lavoratori"
msgstr ""

#. Corpus Christi.
msgid "Corpus Domini"
msgstr ""

#. Anniversary of the Fall of Fascism and Freedom Day.
msgid "Anniversario della Caduta del Fascismo e Festa della Libertà"
msgstr ""

#. Assumption Day.
msgid "Assunzione della B.V. Maria"
msgstr ""

#. Saint Marinus' Day, Anniversary of the Founding of the Republic.
msgid "San Marino, Anniversario di Fondazione della Repubblica"
msgstr ""

#. All Saints' Day.
msgid "Tutti i Santi"
msgstr ""

#. Commemoration of the Dead.
msgid "Commemorazione dei defunti"
msgstr ""

#. Immaculate Conception.
msgid "Immacolata Concezione"
msgstr ""

#. Christmas Day.
msgid "Natale"
msgstr ""

#. Saint Stephen's Day.
msgid "Santo Stefano"
msgstr ""

#. Christmas Eve.
msgid "Vigilia di Natale"
msgstr ""

#. New Year's Eve.
msgid "Ultimo dell'anno"
msgstr ""
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载