Skip to content

Commit

Permalink
Update Cyprus holidays (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
KJhellico authored Jan 8, 2024
1 parent 5b307c1 commit 4ce51a2
Show file tree
Hide file tree
Showing 8 changed files with 979 additions and 731 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ All other default values are highlighted with bold:
* - Cyprus
- CY
-
- **el**, en_US
-
- **el**, en_CY, en_US, uk
- BANK, OPTIONAL
* - Czechia
- CZ
-
Expand Down
59 changes: 40 additions & 19 deletions holidays/countries/cyprus.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)


from datetime import timedelta as td
from gettext import gettext as tr

from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
from holidays.constants import BANK, OPTIONAL, PUBLIC
from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase

Expand All @@ -22,33 +23,38 @@ class Cyprus(HolidayBase, ChristianHolidays, InternationalHolidays):
Cyprus holidays.
References:
- https://en.wikipedia.org/wiki/Public_holidays_in_Cyprus
- https://en.wikipedia.org/wiki/Public_holidays_in_Cyprus
- https://www.centralbank.cy/en/the-bank/working-hours-bank-holidays
"""

country = "CY"
default_language = "el"
supported_languages = ("el", "en_US")
supported_categories = (BANK, OPTIONAL, PUBLIC)
supported_languages = ("el", "en_CY", "en_US", "uk")

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_REVISED_CALENDAR)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# New Years Day.
if self._year <= 1960:
return None

# New Year's Day.
self._add_new_years_day(tr("Πρωτοχρονιά"))

# Epiphany.
self._add_epiphany_day(tr("Θεοφάνεια"))
self._add_epiphany_day(tr("Ημέρα των Θεοφανίων"))

# Clean Monday.
# Green Monday.
self._add_ash_monday(tr("Καθαρά Δευτέρα"))

# Greek Independence Day.
self._add_holiday_mar_25(tr("Εικοστή Πέμπτη Μαρτίου"))
self._add_holiday_mar_25(tr("Ημέρα της Ελληνικής Ανεξαρτησίας"))

# Cyprus National Day.
self._add_holiday_apr_1(tr("1η Απριλίου"))
self._add_holiday_apr_1(tr("Εθνική Ημέρα Κύπρου"))

# Good Friday.
self._add_good_friday(tr("Μεγάλη Παρασκευή"))
Expand All @@ -57,31 +63,46 @@ def _populate_public_holidays(self):
self._add_easter_sunday(tr("Κυριακή του Πάσχα"))

# Easter Monday.
self._add_easter_monday(tr("Δευτέρα του Πάσχα"))
self._add_easter_monday(tr("Δευτέρα της Διακαινησίμου"))

# Labour Day.
self._add_labor_day(tr("Εργατική Πρωτομαγιά"))
# Labor Day.
self._add_labor_day(tr("Πρωτομαγιά"))

# Monday of the Holy Spirit.
# Whit Monday.
self._add_whit_monday(tr("Δευτέρα του Αγίου Πνεύματος"))

# Assumption of Mary.
# Assumption Day.
self._add_assumption_of_mary_day(tr("Κοίμηση της Θεοτόκου"))

# Cyprus Independence Day.
self._add_holiday_oct_1(tr("Ημέρα Ανεξαρτησίας της Κύπρου"))
if self._year >= 1979:
# Cyprus Independence Day.
self._add_holiday_oct_1(tr("Ημέρα της Κυπριακής Ανεξαρτησίας"))

# Ochi Day.
self._add_holiday_oct_28(tr("Ημέρα του Όχι"))

# Christmas Eve.
self._add_christmas_eve(tr("Παραμονή Χριστουγέννων"))

# Christmas Day.
self._add_christmas_day(tr("Χριστούγεννα"))

# Day After Christmas.
self._add_christmas_day_two(tr("Δεύτερη μέρα Χριστουγέννων"))
self._add_christmas_day_two(tr("Επομένη Χριστουγέννων"))

def _populate_bank_holidays(self):
if self._year <= 1960:
return None

# Easter Tuesday.
self._add_holiday(tr("Τρίτη της Διακαινησίμου"), self._easter_sunday + td(days=+2))

def _populate_optional_holidays(self):
if self._year <= 1960:
return None

# Holy Saturday.
self._add_holy_saturday(tr("Μεγάλο Σάββατο"))

# Christmas Eve.
self._add_christmas_eve(tr("Παραμονή Χριστουγέννων"))


class CY(Cyprus):
Expand Down
34 changes: 21 additions & 13 deletions holidays/locale/el/LC_MESSAGES/CY.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.20\n"
"Project-Id-Version: Python Holidays 0.41\n"
"POT-Creation-Date: 2023-02-15 11:50-0800\n"
"PO-Revision-Date: 2023-02-16 08:50-0800\n"
"Last-Translator: Arkadii Yakovets <[email protected]>\n"
Expand All @@ -15,24 +15,24 @@ msgstr ""
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"

#. New Years Day.
#. New Year's Day.
msgid "Πρωτοχρονιά"
msgstr ""

#. Epiphany.
msgid "Θεοφάνεια"
msgid "Ημέρα των Θεοφανίων"
msgstr ""

#. Clean Monday.
#. Green Monday.
msgid "Καθαρά Δευτέρα"
msgstr ""

#. Greek Independence Day.
msgid "Εικοστή Πέμπτη Μαρτίου"
msgid "Ημέρα της Ελληνικής Ανεξαρτησίας"
msgstr ""

#. Cyprus National Day.
msgid "1η Απριλίου"
msgid "Εθνική Ημέρα Κύπρου"
msgstr ""

#. Good Friday.
Expand All @@ -44,23 +44,23 @@ msgid "Κυριακή του Πάσχα"
msgstr ""

#. Easter Monday.
msgid "Δευτέρα του Πάσχα"
msgid "Δευτέρα της Διακαινησίμου"
msgstr ""

#. Labour Day.
msgid "Εργατική Πρωτομαγιά"
#. Labor Day.
msgid "Πρωτομαγιά"
msgstr ""

#. Monday of the Holy Spirit.
#. Whit Monday.
msgid "Δευτέρα του Αγίου Πνεύματος"
msgstr ""

#. Assumption of Mary.
#. Assumption Day.
msgid "Κοίμηση της Θεοτόκου"
msgstr ""

#. Cyprus Independence Day.
msgid "Ημέρα Ανεξαρτησίας της Κύπρου"
msgid "Ημέρα της Κυπριακής Ανεξαρτησίας"
msgstr ""

#. Ochi Day.
Expand All @@ -76,5 +76,13 @@ msgid "Χριστούγεννα"
msgstr ""

#. Day After Christmas.
msgid "Δεύτερη μέρα Χριστουγέννων"
msgid "Επομένη Χριστουγέννων"
msgstr ""

#. Easter Tuesday.
msgid "Τρίτη της Διακαινησίμου"
msgstr ""

#. Holy Saturday.
msgid "Μεγάλο Σάββατο"
msgstr ""
89 changes: 89 additions & 0 deletions holidays/locale/en_CY/LC_MESSAGES/CY.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Cyprus holidays en_CY localization.
# Authors: ~Jhellico <[email protected]>, (c) 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.41\n"
"POT-Creation-Date: 2023-02-15 11:50-0800\n"
"PO-Revision-Date: 2024-01-05 13:33+0200\n"
"Last-Translator: ~Jhellico <[email protected]>\n"
"Language-Team: Python Holidays localization team\n"
"Language: en_CY\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: Lingua 4.15.0\n"
"X-Generator: Poedit 3.4\n"

#. New Year's Day.
msgid "Πρωτοχρονιά"
msgstr "New Year's Day"

#. Epiphany.
msgid "Ημέρα των Θεοφανίων"
msgstr "Epiphany"

#. Green Monday.
msgid "Καθαρά Δευτέρα"
msgstr "Green Monday"

#. Greek Independence Day.
msgid "Ημέρα της Ελληνικής Ανεξαρτησίας"
msgstr "Greek Independence Day"

#. Cyprus National Day.
msgid "Εθνική Ημέρα Κύπρου"
msgstr "Cyprus National Day"

#. Good Friday.
msgid "Μεγάλη Παρασκευή"
msgstr "Good Friday"

#. Easter Sunday.
msgid "Κυριακή του Πάσχα"
msgstr "Easter Sunday"

#. Easter Monday.
msgid "Δευτέρα της Διακαινησίμου"
msgstr "Easter Monday"

#. Labor Day.
msgid "Πρωτομαγιά"
msgstr "Labour Day"

#. Whit Monday.
msgid "Δευτέρα του Αγίου Πνεύματος"
msgstr "Pentecost"

#. Assumption Day.
msgid "Κοίμηση της Θεοτόκου"
msgstr "Assumption Day"

#. Cyprus Independence Day.
msgid "Ημέρα της Κυπριακής Ανεξαρτησίας"
msgstr "Cyprus Independence Day"

#. Ochi Day.
msgid "Ημέρα του Όχι"
msgstr "Ochi Day"

#. Christmas Eve.
msgid "Παραμονή Χριστουγέννων"
msgstr "Christmas Eve"

#. Christmas Day.
msgid "Χριστούγεννα"
msgstr "Christmas Day"

#. Day After Christmas.
msgid "Επομένη Χριστουγέννων"
msgstr "Day After Christmas"

#. Easter Tuesday.
msgid "Τρίτη της Διακαινησίμου"
msgstr "Easter Tuesday"

#. Holy Saturday.
msgid "Μεγάλο Σάββατο"
msgstr "Holy Saturday"
Loading

0 comments on commit 4ce51a2

Please sign in to comment.