Skip to content

Commit

Permalink
Update Ethiopia holidays (#1704)
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico authored Mar 1, 2024
1 parent e7b5e86 commit 7443855
Show file tree
Hide file tree
Showing 6 changed files with 1,054 additions and 1,158 deletions.
114 changes: 70 additions & 44 deletions holidays/countries/ethiopia.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@
from calendar import isleap
from gettext import gettext as tr

from holidays.calendars.gregorian import SEP
from holidays.calendars import _CustomIslamicHolidays
from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV
from holidays.calendars.julian import JULIAN_CALENDAR
from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays
from holidays.holiday_base import HolidayBase


class Ethiopia(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
"""
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_Ethiopia
"""

country = "ET"
default_language = "am"
# %s (estimated).
Expand All @@ -27,80 +33,71 @@ class Ethiopia(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHol

def _is_leap_year(self):
"""
Ethiopian leap years are coincident with leap years in the Gregorian
calendar until the end of February 2100. It starts earlier from new
year of western calendar.
Ethiopian leap year starts on Sep 11, so it has an effect on
holidays between Sep 11 and Jan 1. Therefore, here on the following
function we intentionally add 1 to the leap year to offset the
difference.
Ethiopian leap years are coincident with leap years in the Gregorian calendar until
the end of February 2100. It starts earlier from new year of western calendar.
Ethiopian leap year starts on Sep 11, so it has an effect on holidays between
Sep 11 and Jan 1. Therefore, here on the following function we intentionally add 1
to the leap year to offset the difference.
"""
return isleap(self._year + 1)

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
InternationalHolidays.__init__(self)
IslamicHolidays.__init__(self)
IslamicHolidays.__init__(self, EthiopiaIslamicHolidays)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Year's Day
# The Ethiopian New Year is called Kudus Yohannes in Ge'ez and
# Tigrinya, while in Amharic,
# the official language of Ethiopia it is called Enkutatash.
# It occurs on September 11 in the Gregorian Calendar;
# except for the year preceding a leap year, when it occurs on
# September 12.

# Ethiopian New Year.
self._add_holiday(tr("አዲስ ዓመት እንቁጣጣሽ"), SEP, 12 if self._is_leap_year() else 11)

# Finding of True Cross.
self._add_holiday(tr("መስቀል"), SEP, 28 if self._is_leap_year() else 27)
if self._year <= 1897:
return None

# Orthodox Christmas Day.
# Christmas Day.
self._add_christmas_day(tr("ገና"))

# Orthodox Epiphany.
self._add_epiphany_day(tr("ጥምቀት"))
# Epiphany.
self._add_holiday(tr("ጥምቀት"), JAN, 20 if super()._is_leap_year() else 19)

# Orthodox Good Friday.
# Adwa Victory Day.
self._add_holiday_mar_2(tr("አድዋ"))

# Good Friday.
self._add_good_friday(tr("ስቅለት"))

# Orthodox Easter Sunday.
# Easter Sunday.
self._add_easter_sunday(tr("ፋሲካ"))

if self._year > 1896:
# Adwa Victory Day.
self._add_holiday_mar_2(tr("አድዋ"))

# Labor Day.
# Workers' Day.
self._add_labor_day(tr("የሰራተኞች ቀን"))

if self._year > 1941:
# Patriots Day.
if self._year >= 1942:
# Patriots' Day.
self._add_holiday_may_5(tr("የአርበኞች ቀን"))

if self._year > 1991:
if self._year >= 1992:
# Downfall of Dergue Regime Day.
self._add_holiday_may_28(tr("ደርግ የወደቀበት ቀን"))

if self._year < 1991 and self._year > 1974:
# Downfall of King Haile Selassie.
self._add_holiday(tr("ደርግ የመጣበት ቀን"), SEP, 13 if self._is_leap_year() else 12)
# Ethiopian New Year.
self._add_holiday(tr("እንቁጣጣሽ"), SEP, 12 if self._is_leap_year() else 11)

# Finding of True Cross.
self._add_holiday(tr("መስቀል"), SEP, 28 if self._is_leap_year() else 27)

if 1975 <= self._year <= 1990:
# Revolution Day.
self._add_holiday(tr("የአብዮት ቀን"), SEP, 13 if self._is_leap_year() else 12)

# October Revolution Day.
self._add_holiday_nov_7(tr("የጥቅምት አብዮት ቀን"))

# Eid al-Fitr.
self._add_eid_al_fitr_day(tr("ኢድ አልፈጥር"))

# Eid al-Adha.
name = tr("አረፋ")
self._add_eid_al_adha_day(name)
self._add_eid_al_adha_day_two(name)
self._add_eid_al_adha_day(tr("አረፋ"))

# Prophet's Birthday.
name = tr("መውሊድ")
self._add_mawlid_day(name)
self._add_mawlid_day_two(name)
self._add_mawlid_day(tr("መውሊድ"))


class ET(Ethiopia):
Expand All @@ -109,3 +106,32 @@ class ET(Ethiopia):

class ETH(Ethiopia):
pass


class EthiopiaIslamicHolidays(_CustomIslamicHolidays):
EID_AL_ADHA_DATES = {
2018: (AUG, 22),
2019: (AUG, 11),
2020: (JUL, 31),
2021: (JUL, 20),
2022: (JUL, 9),
2023: (JUN, 28),
}

EID_AL_FITR_DATES = {
2018: (JUN, 15),
2019: (JUN, 4),
2020: (MAY, 24),
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
}

MAWLID_DATES = {
2018: (NOV, 21),
2019: (NOV, 10),
2020: (OCT, 29),
2021: (OCT, 18),
2022: (OCT, 8),
2023: (SEP, 27),
}
58 changes: 31 additions & 27 deletions holidays/locale/am/LC_MESSAGES/ET.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,69 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.26\n"
"Project-Id-Version: Python Holidays 0.44\n"
"POT-Creation-Date: 2023-02-15 14:15-0800\n"
"PO-Revision-Date: 2023-02-16 08:42-0800\n"
"Last-Translator: Arkadii Yakovets <[email protected]>\n"
"PO-Revision-Date: 2024-02-27 14:46+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Python Holidays localization team\n"
"Language: am\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.4.2\n"

#. Ethiopian New Year.
msgid "አዲስ ዓመት እንቁጣጣሽ"
msgstr ""

#. Finding of True Cross.
msgid "መስቀል"
#. %s (estimated).
#, c-format
msgid "%s (ግምት)"
msgstr ""

#. Orthodox Christmas Day.
#. Christmas Day.
msgid "ገና"
msgstr ""

#. Orthodox Epiphany.
#. Epiphany.
msgid "ጥምቀት"
msgstr ""

#. Orthodox Good Friday.
msgid "ስቅለት"
#. Adwa Victory Day.
msgid "አድዋ"
msgstr ""

#. Orthodox Easter Sunday.
msgid "ፋሲካ"
#. Good Friday.
msgid "ስቅለት"
msgstr ""

#. Adwa Victory Day.
msgid "አድዋ"
#. Easter Sunday.
msgid "ፋሲካ"
msgstr ""

#. Labor Day.
#. Workers' Day.
msgid "የሰራተኞች ቀን"
msgstr ""

#. Patriots Day.
#. Patriots' Day.
msgid "የአርበኞች ቀን"
msgstr ""

#. Downfall of Dergue Regime Day.
msgid "ደርግ የወደቀበት ቀን"
msgstr ""

#. Downfall of King Haile Selassie.
msgid "ደርግ የመጣበት ቀን"
#. Ethiopian New Year.
msgid "እንቁጣጣሽ"
msgstr ""

#. Finding of True Cross.
msgid "መስቀል"
msgstr ""

#. Revolution Day.
msgid "የአብዮት ቀን"
msgstr ""

#. October Revolution Day.
msgid "የጥቅምት አብዮት ቀን"
msgstr ""

#. Eid al-Fitr.
Expand All @@ -70,8 +79,3 @@ msgstr ""
#. Prophet's Birthday.
msgid "መውሊድ"
msgstr ""

#. %s (estimated).
#, c-format
msgid "%s (ግምት)"
msgstr ""
58 changes: 31 additions & 27 deletions holidays/locale/ar/LC_MESSAGES/ET.po
Original file line number Diff line number Diff line change
@@ -1,69 +1,73 @@
# Ethiopia holidays ar localization (PoC).
# Ethiopia holidays ar localization.
# Authors: Arkadii Yakovets <[email protected]>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.26\n"
"POT-Creation-Date: 2023-05-20 18:48-0700\n"
"PO-Revision-Date: 2023-05-20 18:51-0700\n"
"Last-Translator: Arkadii Yakovets <[email protected]>\n"
"Project-Id-Version: Python Holidays 0.44\n"
"POT-Creation-Date: 2024-02-27 14:42+0200\n"
"PO-Revision-Date: 2024-02-27 14:51+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Python 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"
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.3.1\n"
"X-Generator: Poedit 3.4.2\n"

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

#. Ethiopian New Year.
msgid "አዲስ ዓመት እንቁጣጣሽ"
msgstr "السنة الإثيوبية الجديدة"

#. Finding of True Cross.
msgid "መስቀል"
msgstr "العثور على الصليب الحقيقي"

#. Orthodox Christmas Day.
#. Christmas Day.
msgid "ገና"
msgstr "عيد الميلاد"

#. Orthodox Epiphany.
#. Epiphany.
msgid "ጥምቀት"
msgstr "عيد الغطاس"

#. Orthodox Good Friday.
#. Adwa Victory Day.
msgid "አድዋ"
msgstr "العدوة"

#. Good Friday.
msgid "ስቅለት"
msgstr "جمعة جيدة"

#. Orthodox Easter Sunday.
#. Easter Sunday.
msgid "ፋሲካ"
msgstr "عيد الفصح"

#. Adwa Victory Day.
msgid "አድዋ"
msgstr "العدوة"

#. Labor Day.
#. Workers' Day.
msgid "የሰራተኞች ቀን"
msgstr "يوم العمال"

#. Patriots Day.
#. Patriots' Day.
msgid "የአርበኞች ቀን"
msgstr "يوم الوطنيين"

#. Downfall of Dergue Regime Day.
msgid "ደርግ የወደቀበት ቀን"
msgstr "يوم سقوط ديرج"

#. Downfall of King Haile Selassie.
msgid "ደርግ የመጣበት ቀን"
msgstr "اليوم الذي جاء فيه ديرج"
#. Ethiopian New Year.
msgid "እንቁጣጣሽ"
msgstr "السنة الإثيوبية الجديدة"

#. Finding of True Cross.
msgid "መስቀል"
msgstr "مسكل"

#. Revolution Day.
msgid "የአብዮት ቀን"
msgstr "يوم الثورة"

#. October Revolution Day.
msgid "የጥቅምት አብዮት ቀን"
msgstr "يوم ثورة أكتوبر"

#. Eid al-Fitr.
msgid "ኢድ አልፈጥር"
Expand Down
Loading

0 comments on commit 7443855

Please sign in to comment.