Skip to content

Commit

Permalink
Update El Salvador holidays, add l10n support (vacanza#2209)
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico authored Jan 4, 2025
1 parent 56596d8 commit bdea920
Show file tree
Hide file tree
Showing 21 changed files with 2,859 additions and 5,634 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ All other default values are highlighted with bold:
-
* - El Salvador
- SV
- Departments: AH, CA, CH, CU, LI, MO, PA, SA, SM, SO, SS, SV, UN, US
-
- Departments: AH (Ahuachapán), CA (Cabañas), CH (Chalatenango), CU (Cuscatlán), LI (La Libertad), MO (Morazán), PA (La Paz), SA (Santa Ana), SM (San Miguel), SO (Sonsonate), SS (San Salvador), SV (San Vicente), UN (La Unión), US (Usulután)
- en_US, **es**, uk
-
* - Estonia
- EE
Expand Down
69 changes: 45 additions & 24 deletions holidays/countries/el_salvador.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase


class ElSalvador(HolidayBase, ChristianHolidays, InternationalHolidays):
"""
References:
- https://www.transparencia.gob.sv/institutions/gd-usulutan/documents/192280/download
- https://www.timeanddate.com/holidays/el-salvador
- https://www.officeholidays.com/countries/el-salvador
- `Labor Code 1972 <https://www.transparencia.gob.sv/institutions/gd-usulutan/documents/192280/download>`_
- https://www.timeanddate.com/holidays/el-salvador
- https://www.officeholidays.com/countries/el-salvador
"""

country = "SV"
default_language = "es"
supported_languages = ("en_US", "es", "uk")
subdivisions = (
"AH", # Ahuachapán
"CA", # Cabañas
Expand All @@ -39,6 +43,24 @@ class ElSalvador(HolidayBase, ChristianHolidays, InternationalHolidays):
"UN", # La Unión
"US", # Usulután
)
subdivisions_aliases = {
"Ahuachapán": "AH",
"Cabañas": "CA",
"Chalatenango": "CH",
"Cuscatlán": "CU",
"La Libertad": "LI",
"Morazán": "MO",
"La Paz": "PA",
"Santa Ana": "SA",
"San Miguel": "SM",
"Sonsonate": "SO",
"San Salvador": "SS",
"San Vicente": "SV",
"La Unión": "UN",
"Usulután": "US",
}
# Labor Code 1972.
start_year = 1973

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self)
Expand All @@ -47,48 +69,47 @@ def __init__(self, *args, **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("Año Nuevo"))

# Maundy Thursday.
self._add_holy_thursday("Maundy Thursday")
self._add_holy_thursday(tr("Jueves Santo"))

# Good Friday.
self._add_good_friday("Good Friday")
self._add_good_friday(tr("Viernes Santo"))

# Holy Saturday.
self._add_holy_saturday("Holy Saturday")
self._add_holy_saturday(tr("Sábado Santo"))

# Labor Day.
self._add_labor_day("Labor Day")
self._add_labor_day(tr("Día del Trabajo"))

# Legislative Decree #399 from Apr 14, 2016.
if self._year >= 2016:
# Legislative Decree #399 from Apr 14, 2016
# Mothers' Day.
self._add_holiday_may_10("Mothers' Day")
# Mother's Day.
self._add_holiday_may_10(tr("Día de la Madre"))

# Legislative Decree #208 from Jun 17, 2012.
if self._year >= 2013:
# Legislative Decree #208 from Jun 17, 2012
# Fathers' Day.
self._add_holiday_jun_17("Fathers' Day")
# Father's Day.
self._add_holiday_jun_17(tr("Día del Padre"))

# Feast of San Salvador.
self._add_holiday_aug_6("Feast of San Salvador")
# Celebrations of San Salvador.
self._add_holiday_aug_6(tr("Celebración del Divino Salvador del Mundo"))

# Independence Day.
self._add_holiday_sep_15("Independence Day")
self._add_holiday_sep_15(tr("Día de la Independencia"))

# All Souls' Day.
self._add_all_souls_day("All Souls' Day")
self._add_all_souls_day(tr("Día de los Difuntos"))

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

def _populate_subdiv_ss_public_holidays(self):
# San Salvador Day 1.
self._add_holiday_aug_3("San Salvador Day 1")

# San Salvador Day 2.
self._add_holiday_aug_5("San Salvador Day 2")
# Feast of San Salvador.
name = tr("Fiesta de San Salvador")
self._add_holiday_aug_3(name)
self._add_holiday_aug_5(name)


class SV(ElSalvador):
Expand Down
75 changes: 75 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/SV.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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 AUTHORS file)
# dr-prodigy <[email protected]> (c) 2017-2023
# ryanss <[email protected]> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# El Salvador holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2025-01-03 16:40+0200\n"
"PO-Revision-Date: 2025-01-03 16:45+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\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.4\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Año Nuevo"
msgstr "New Year's Day"

#. Maundy Thursday.
msgid "Jueves Santo"
msgstr "Maundy Thursday"

#. Good Friday.
msgid "Viernes Santo"
msgstr "Good Friday"

#. Holy Saturday.
msgid "Sábado Santo"
msgstr "Holy Saturday"

#. Labor Day.
msgid "Día del Trabajo"
msgstr "Labor Day"

#. Mother's Day.
msgid "Día de la Madre"
msgstr "Mother's Day"

#. Father's Day.
msgid "Día del Padre"
msgstr "Father's Day"

#. Celebrations of San Salvador.
msgid "Celebración del Divino Salvador del Mundo"
msgstr "Celebrations of San Salvador"

#. Independence Day.
msgid "Día de la Independencia"
msgstr "Independence Day"

#. All Souls' Day.
msgid "Día de los Difuntos"
msgstr "All Souls' Day"

#. Christmas Day.
msgid "Navidad"
msgstr "Christmas Day"

#. Feast of San Salvador.
msgid "Fiesta de San Salvador"
msgstr "Feast of San Salvador"
75 changes: 75 additions & 0 deletions holidays/locale/es/LC_MESSAGES/SV.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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 AUTHORS file)
# dr-prodigy <[email protected]> (c) 2017-2023
# ryanss <[email protected]> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# El Salvador holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2025-01-03 16:40+0200\n"
"PO-Revision-Date: 2025-01-03 16:42+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Holidays Localization Team\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.4\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Año Nuevo"
msgstr ""

#. Maundy Thursday.
msgid "Jueves Santo"
msgstr ""

#. Good Friday.
msgid "Viernes Santo"
msgstr ""

#. Holy Saturday.
msgid "Sábado Santo"
msgstr ""

#. Labor Day.
msgid "Día del Trabajo"
msgstr ""

#. Mother's Day.
msgid "Día de la Madre"
msgstr ""

#. Father's Day.
msgid "Día del Padre"
msgstr ""

#. Celebrations of San Salvador.
msgid "Celebración del Divino Salvador del Mundo"
msgstr ""

#. Independence Day.
msgid "Día de la Independencia"
msgstr ""

#. All Souls' Day.
msgid "Día de los Difuntos"
msgstr ""

#. Christmas Day.
msgid "Navidad"
msgstr ""

#. Feast of San Salvador.
msgid "Fiesta de San Salvador"
msgstr ""
75 changes: 75 additions & 0 deletions holidays/locale/uk/LC_MESSAGES/SV.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# 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 AUTHORS file)
# dr-prodigy <[email protected]> (c) 2017-2023
# ryanss <[email protected]> (c) 2014-2017
# Website: https://github.com/vacanza/holidays
# License: MIT (see LICENSE file)
#
# El Salvador holidays uk localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2025-01-03 16:40+0200\n"
"PO-Revision-Date: 2025-01-03 16:50+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Holidays Localization Team\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.4\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Año Nuevo"
msgstr "Новий рік"

#. Maundy Thursday.
msgid "Jueves Santo"
msgstr "Великий четвер"

#. Good Friday.
msgid "Viernes Santo"
msgstr "Страсна пʼятниця"

#. Holy Saturday.
msgid "Sábado Santo"
msgstr "Велика субота"

#. Labor Day.
msgid "Día del Trabajo"
msgstr "День праці"

#. Mother's Day.
msgid "Día de la Madre"
msgstr "День матері"

#. Father's Day.
msgid "Día del Padre"
msgstr "День батька"

#. Celebrations of San Salvador.
msgid "Celebración del Divino Salvador del Mundo"
msgstr "Свято Божественного Спасителя світу"

#. Independence Day.
msgid "Día de la Independencia"
msgstr "День незалежності"

#. All Souls' Day.
msgid "Día de los Difuntos"
msgstr "День усіх померлих"

#. Christmas Day.
msgid "Navidad"
msgstr "Різдво Христове"

#. Feast of San Salvador.
msgid "Fiesta de San Salvador"
msgstr "Свято Спасителя"
Loading

0 comments on commit bdea920

Please sign in to comment.