Skip to content

Commit

Permalink
Update Portugal holidays: add uk localization (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico committed Jan 4, 2024
1 parent 154181d commit 9127685
Show file tree
Hide file tree
Showing 27 changed files with 6,637 additions and 6,319 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ All other default values are highlighted with bold:
* - Portugal
- PT
- Districts: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 30
- en_US, **pt_PT**
- en_US, **pt_PT**, uk
- OPTIONAL
* - Puerto Rico
- PR
Expand Down
54 changes: 51 additions & 3 deletions holidays/countries/portugal.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
"30",
)
_deprecated_subdivisions = ("Ext",)
supported_languages = ("en_US", "pt_PT")
supported_languages = ("en_US", "pt_PT", "uk")

def __init__(self, *args, **kwargs) -> None:
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Year's Day.
self._add_new_years_day(tr("Ano Novo"))

# Carnival is no longer a holiday, but some companies let workers off.
Expand All @@ -85,29 +86,47 @@ def _populate_public_holidays(self):

# Revoked holidays in 2013–2015.
if self._year <= 2012 or self._year >= 2016:
# Corpus Christi.
self._add_corpus_christi_day(tr("Corpo de Deus"))

if self._year >= 1910:
# Republic Day.
self._add_holiday_oct_5(tr("Implantação da República"))

# All Saints' Day.
self._add_all_saints_day(tr("Dia de Todos os Santos"))

if self._year >= 1823:
# Restoration of Independence Day.
self._add_holiday_dec_1(tr("Restauração da Independência"))

if self._year >= 1974:
# Freedom Day.
self._add_holiday_apr_25(tr("Dia da Liberdade"))

# Labor Day.
self._add_labor_day(tr("Dia do Trabalhador"))

if self._year >= 1911:
if 1933 <= self._year <= 1973:
# Day of Camões, Portugal, and the Portuguese Race.
self._add_holiday_jun_10(tr("Dia de Camões, de Portugal e da Raça"))
elif self._year >= 1978:
self._add_holiday_jun_10(
# Day of Portugal, Camões, and the Portuguese Communities.
tr("Dia de Portugal, de Camões e das Comunidades Portuguesas")
)
else:
# Portugal Day.
self._add_holiday_jun_10(tr("Dia de Portugal"))

# Assumption Day.
self._add_assumption_of_mary_day(tr("Assunção de Nossa Senhora"))

# Immaculate Conception.
self._add_immaculate_conception_day(tr("Imaculada Conceição"))

# Christmas Day.
self._add_christmas_day(tr("Dia de Natal"))

def _populate_optional_holidays(self):
Expand All @@ -125,10 +144,19 @@ def _populate_optional_holidays(self):
# - get Holidays that occur on Tuesday and add Monday (-1 day)
# - get Holidays that occur on Thursday and add Friday (+1 day)

# Carnival.
self._add_carnival_monday(tr("Carnaval"))

# St. Anthony's Day.
self._add_holiday_jun_13(tr("Dia de Santo António"))

# Christmas Eve.
self._add_christmas_eve(tr("Véspera de Natal"))

# Boxing Day.
self._add_christmas_day_two(tr("26 de Dezembro"))

# New Year's Eve.
self._add_new_years_eve(tr("Véspera de Ano Novo"))

def _populate_subdiv_holidays(self):
Expand All @@ -139,74 +167,94 @@ def _populate_subdiv_holidays(self):
self._populate_optional_holidays()

def _populate_subdiv_01_public_holidays(self):
# St. Joanna's Day.
self._add_holiday_may_12(tr("Dia de Santa Joana"))

def _populate_subdiv_02_public_holidays(self):
# Ascension Day.
self._add_ascension_thursday(tr("Quinta-feira da Ascensão"))

def _populate_subdiv_03_public_holidays(self):
# St. John's Day.
self._add_saint_johns_day(tr("Dia de São João"))

def _populate_subdiv_04_public_holidays(self):
# Feast of Our Lady of Graces.
self._add_holiday_aug_22(tr("Dia de Nossa Senhora das Graças"))

def _populate_subdiv_05_public_holidays(self):
self._add_holiday(
tr("Dia de Nossa Senhora de Mércoles"), self._easter_sunday + td(days=+16)
# Feast of Our Lady of Mércoles.
tr("Dia de Nossa Senhora de Mércoles"),
self._easter_sunday + td(days=+16),
)

def _populate_subdiv_06_public_holidays(self):
# St. Elizabeth's Day.
self._add_holiday_jul_4(tr("Dia de Santa Isabel"))

def _populate_subdiv_07_public_holidays(self):
self._add_holiday_jun_29(tr("Dia de São Pedro"))
# St. Peter's Day.
self._add_saints_peter_and_paul_day(tr("Dia de São Pedro"))

def _populate_subdiv_08_public_holidays(self):
# Municipal Holiday of Faro.
self._add_holiday_sep_7(tr("Dia do Município de Faro"))

def _populate_subdiv_09_public_holidays(self):
# Municipal Holiday of Guarda.
self._add_holiday_nov_27(tr("Dia do Município da Guarda"))

def _populate_subdiv_10_public_holidays(self):
# Municipal Holiday of Leiria.
self._add_holiday_may_22(tr("Dia do Município de Leiria"))

def _populate_subdiv_11_public_holidays(self):
self._add_holiday_jun_13(tr("Dia de Santo António"))

def _populate_subdiv_12_public_holidays(self):
# Municipal Holiday of Portalegre.
self._add_holiday_may_23(tr("Dia do Município de Portalegre"))

def _populate_subdiv_13_public_holidays(self):
self._add_saint_johns_day(tr("Dia de São João"))

def _populate_subdiv_14_public_holidays(self):
# St. Joseph's Day.
self._add_saint_josephs_day(tr("Dia de São José"))

def _populate_subdiv_15_public_holidays(self):
# Bocage Day.
self._add_holiday_sep_15(tr("Dia de Bocage"))

def _populate_subdiv_16_public_holidays(self):
# Feast of Our Lady of Sorrows.
self._add_holiday_aug_20(tr("Dia de Nossa Senhora da Agonia"))

def _populate_subdiv_17_public_holidays(self):
self._add_holiday_jun_13(tr("Dia de Santo António"))

def _populate_subdiv_18_public_holidays(self):
# St. Matthew's Day.
self._add_holiday_sep_21(tr("Dia de São Mateus"))

def _populate_subdiv_20_public_holidays(self):
if self._year >= 1981:
# Day of the Autonomous Region of the Azores.
self._add_whit_monday(tr("Dia da Região Autónoma dos Açores"))

def _populate_subdiv_30_public_holidays(self):
if self._year >= 1979:
self._add_holiday_jul_1(
# Day of the Autonomous Region of Madeira and the Madeiran Communities.
tr("Dia da Região Autónoma da Madeira e das Comunidades Madeirenses")
if self._year >= 1989
# Day of the Autonomous Region of Madeira.
else tr("Dia da Região Autónoma da Madeira")
)

if self._year >= 2002:
# 1st Octave.
self._add_christmas_day_two(tr("Primeira Oitava"))


Expand Down
59 changes: 48 additions & 11 deletions holidays/locale/en_US/LC_MESSAGES/PT.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.20\n"
"POT-Creation-Date: 2023-03-07 19:38+0700\n"
"PO-Revision-Date: 2023-02-20 19:10+0200\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"PO-Revision-Date: 2023-12-30 19:28+0200\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Python 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"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.4\n"

#. New Year's Day.
msgid "Ano Novo"
msgstr "New Year's Day"

Expand All @@ -27,110 +28,146 @@ msgstr "Good Friday"
msgid "Páscoa"
msgstr "Easter Sunday"

#. Corpus Christi.
msgid "Corpo de Deus"
msgstr "Corpus Christi"

#. Republic Day.
msgid "Implantação da República"
msgstr "Republic Day"

#. All Saints' Day.
msgid "Dia de Todos os Santos"
msgstr "All Saints Day"
msgstr "All Saints' Day"

#. Restoration of Independence Day.
msgid "Restauração da Independência"
msgstr "Restoration of Independence Day"

#. Freedom Day.
msgid "Dia da Liberdade"
msgstr "Freedom Day"

#. Labor Day.
msgid "Dia do Trabalhador"
msgstr "Labour Day"
msgstr "Labor Day"

#. Day of Camões, Portugal, and the Portuguese Race.
msgid "Dia de Camões, de Portugal e da Raça"
msgstr "Day of Camões, Portugal, and the Portuguese Race"

#. Day of Portugal, Camões, and the Portuguese Communities.
msgid "Dia de Portugal, de Camões e das Comunidades Portuguesas"
msgstr "Day of Portugal, Camões, and the Portuguese Communities"

#. Portugal Day.
msgid "Dia de Portugal"
msgstr "Portugal Day"

#. Assumption Day.
msgid "Assunção de Nossa Senhora"
msgstr "Assumption Day"

#. Immaculate Conception.
msgid "Imaculada Conceição"
msgstr "Immaculate Conception"

#. Christmas Day.
msgid "Dia de Natal"
msgstr "Christmas"
msgstr "Christmas Day"

#. Carnival.
msgid "Carnaval"
msgstr "Carnival"

#. Christmas Eve.
msgid "Véspera de Natal"
msgstr "Christmas Eve"

#. Boxing Day.
msgid "26 de Dezembro"
msgstr "Boxing Day"

#. New Year's Eve.
msgid "Véspera de Ano Novo"
msgstr "New Year's Eve"

#. St. Anthony's Day.
msgid "Dia de Santo António"
msgstr "St. Anthony's Day"

#. St. Joanna's Day.
msgid "Dia de Santa Joana"
msgstr "St. Joanna's Day"

#. Ascension Day.
msgid "Quinta-feira da Ascensão"
msgstr "Ascension of Jesus"
msgstr "Ascension Day"

#. St. John's Day.
msgid "Dia de São João"
msgstr "St. John's Day"

#. Feast of Our Lady of Graces.
msgid "Dia de Nossa Senhora das Graças"
msgstr "Feast of Our Lady of Graces"

#. Feast of Our Lady of Mércoles.
msgid "Dia de Nossa Senhora de Mércoles"
msgstr "Feast of Our Lady of Mércoles"

#. St. Elizabeth's Day.
msgid "Dia de Santa Isabel"
msgstr "St. Elizabeth's Day"

#. St. Peter's Day.
msgid "Dia de São Pedro"
msgstr "St. Peter's Day"

#. Municipal Holiday of Faro.
msgid "Dia do Município de Faro"
msgstr "Municipal Holiday (Faro)"
msgstr "Municipal Holiday of Faro"

#. Municipal Holiday of Guarda.
msgid "Dia do Município da Guarda"
msgstr "Municipal Holiday (Guarda)"
msgstr "Municipal Holiday of Guarda"

#. Municipal Holiday of Leiria.
msgid "Dia do Município de Leiria"
msgstr "Municipal Holiday (Leiria)"
msgstr "Municipal Holiday of Leiria"

#. Municipal Holiday of Portalegre.
msgid "Dia do Município de Portalegre"
msgstr "Municipal Holiday (Portalegre)"
msgstr "Municipal Holiday of Portalegre"

#. St. Joseph's Day.
msgid "Dia de São José"
msgstr "St. Joseph's Day"

#. Bocage Day.
msgid "Dia de Bocage"
msgstr "Bocage Day"

#. Feast of Our Lady of Sorrows.
msgid "Dia de Nossa Senhora da Agonia"
msgstr "Feast of Our Lady of Sorrows"

#. St. Matthew's Day.
msgid "Dia de São Mateus"
msgstr "St. Matthew's Day"

#. Day of the Autonomous Region of the Azores.
msgid "Dia da Região Autónoma dos Açores"
msgstr "Day of the Autonomous Region of the Azores"

#. Day of the Autonomous Region of Madeira.
msgid "Dia da Região Autónoma da Madeira"
msgstr "Day of the Autonomous Region of Madeira"

#. Day of the Autonomous Region of Madeira and the Madeiran Communities.
msgid "Dia da Região Autónoma da Madeira e das Comunidades Madeirenses"
msgstr "Day of the Autonomous Region of Madeira and the Madeiran Communities"

#. 1st Octave.
msgid "Primeira Oitava"
msgstr "1st Octave"
Loading

0 comments on commit 9127685

Please sign in to comment.