Skip to content

Commit

Permalink
Update Germany holidays: add th localization, deprecated non-standa…
Browse files Browse the repository at this point in the history
…rd ISO code, add subdivision aliases (vacanza#1979)

Co-authored-by: Arkadii Yakovets <[email protected]>
  • Loading branch information
2 people authored and mstuttgart committed Nov 18, 2024
1 parent 3584958 commit c4562fd
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 100 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ All other default values are highlighted with bold:
- GOVERNMENT
* - Germany
- DE
- States: BB, BE, BW, BY, BYP, HB, HE, HH, MV, NI, NW, RP, SH, SL, SN, ST, TH
- **de**, en_US, uk
-
- States: BB (Brandenburg), BE (Berlin), BW (Baden-Württemberg), BY (Bayern), HB (Bremen), HE (Hessen), HH (Hamburg), MV (Mecklenburg-Vorpommern), NI (Niedersachsen), NW (Nordrhein-Westfalen), RP (Rheinland-Pfalz), SH (Schleswig-Holstein), SL (Saarland), SN (Sachsen), ST (Sachsen-Anhalt), TH (Thüringen)
- **de**, en_US, th, uk
- CATHOLIC
* - Ghana
- GH
-
Expand Down
1 change: 1 addition & 0 deletions holidays/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
UNOFFICIAL = "unofficial"
WORKDAY = "workday"

CATHOLIC = "catholic"
CHINESE = "chinese"
CHRISTIAN = "christian"
HEBREW = "hebrew"
Expand Down
42 changes: 30 additions & 12 deletions holidays/countries/germany.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from gettext import gettext as tr

from holidays.calendars.gregorian import MAY, OCT
from holidays.constants import CATHOLIC, PUBLIC
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.holiday_base import HolidayBase

Expand Down Expand Up @@ -54,13 +55,14 @@ class Germany(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid

country = "DE"
default_language = "de"
supported_languages = ("de", "en_US", "uk")
supported_categories = (CATHOLIC, PUBLIC)
supported_languages = ("de", "en_US", "th", "uk")
subdivisions = (
# ISO 3166-2:DE
"BB",
"BE",
"BW",
"BY",
"BYP",
"HB",
"HE",
"HH",
Expand All @@ -74,6 +76,25 @@ class Germany(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
"ST",
"TH",
)
subdivisions_aliases = {
"Brandenburg": "BB",
"Berlin": "BE",
"Baden-Württemberg": "BW",
"Bayern": "BY",
"Bremen": "HB",
"Hessen": "HE",
"Hamburg": "HH",
"Mecklenburg-Vorpommern": "MV",
"Niedersachsen": "NI",
"Nordrhein-Westfalen": "NW",
"Rheinland-Pfalz": "RP",
"Schleswig-Holstein": "SH",
"Saarland": "SL",
"Sachsen": "SN",
"Sachsen-Anhalt": "ST",
"Thüringen": "TH",
}
_deprecated_subdivisions = ("BYP",)

def __init__(self, *args, **kwargs) -> None:
ChristianHolidays.__init__(self)
Expand Down Expand Up @@ -117,6 +138,9 @@ def _populate_public_holidays(self):
# Second Day of Christmas.
self._add_christmas_day_two(tr("Zweiter Weihnachtstag"))

if self.subdiv == "BYP":
self._populate_subdiv_by_public_holidays()

def _populate_subdiv_bb_public_holidays(self):
if self._year <= 1989:
return None
Expand Down Expand Up @@ -161,20 +185,14 @@ def _populate_subdiv_by_public_holidays(self):
self._add_epiphany_day(tr("Heilige Drei Könige"))
self._add_corpus_christi_day(tr("Fronleichnam"))

# Assumption Day.
self._add_assumption_of_mary_day(tr("Mariä Himmelfahrt"))

self._add_all_saints_day(tr("Allerheiligen"))

def _populate_subdiv_byp_public_holidays(self):
if self._year <= 1989:
def _populate_subdiv_by_catholic_holidays(self):
if self._year <= 1990:
return None

if self._year >= 1991:
self._add_epiphany_day(tr("Heilige Drei Könige"))
self._add_corpus_christi_day(tr("Fronleichnam"))

self._add_all_saints_day(tr("Allerheiligen"))
# Assumption Day.
self._add_assumption_of_mary_day(tr("Mariä Himmelfahrt"))

def _populate_subdiv_hb_public_holidays(self):
if self._year <= 1989:
Expand Down
113 changes: 113 additions & 0 deletions holidays/locale/th/LC_MESSAGES/DE.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# 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/python-holidays
# License: MIT (see LICENSE file)
#
# Germany holidays th localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.57\n"
"POT-Creation-Date: 2024-09-05 23:21+0700\n"
"PO-Revision-Date: 2024-09-05 23:23+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Localization Team\n"
"Language: th\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"Generated-By: Lingva 5.0.3\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Neujahr"
msgstr "วันขึ้นปีใหม่"

#. Good Friday.
msgid "Karfreitag"
msgstr "วันศุกร์ประเสริฐ"

#. Easter Monday.
msgid "Ostermontag"
msgstr "วันจันทร์อีสเตอร์"

#. Labor Day.
msgid "Erster Mai"
msgstr "วันแรงงาน"

#. Ascension Day.
msgid "Christi Himmelfahrt"
msgstr "วันสมโภชพระเยซูเจ้าเสด็จขึ้นสวรรค์"

#. Whit Monday.
msgid "Pfingstmontag"
msgstr "วันจันทร์หลังวันสมโภชพระจิตเจ้า"

#. German Unity Day.
msgid "Tag der Deutschen Einheit"
msgstr "วันรวมชาติเยอรมัน"

#. Reformation Day.
msgid "Reformationstag"
msgstr "วันแห่งการปฏิรูป"

#. Repentance and Prayer Day.
msgid "Buß- und Bettag"
msgstr "วันแห่งการอธิษฐานและการกลับใจ"

#. Christmas Day.
msgid "Erster Weihnachtstag"
msgstr "วันคริสต์มาสวันแรก"

#. Second Day of Christmas.
msgid "Zweiter Weihnachtstag"
msgstr "วันคริสต์มาสวันที่สอง"

#. Easter Sunday.
msgid "Ostersonntag"
msgstr "วันอาทิตย์อีสเตอร์"

#. Whit Sunday.
msgid "Pfingstsonntag"
msgstr "วันสมโภชพระจิตเจ้า"

#. International Women's Day.
msgid "Internationaler Frauentag"
msgstr "วันสตรีสากล"

#. 75th anniversary of the liberation from Nazism and the end of the Second
#. World War in Europe.
msgid ""
"75. Jahrestag der Befreiung vom Nationalsozialismus und der Beendigung des "
"Zweiten Weltkriegs in Europa"
msgstr ""
"วันครบรอบ 75 "
"ปีของการปลดปล่อยจากระบอบชาติสังคมนิยมและการสิ้นสุดสงครามโลกครั้งที่สองในยุโรป"

#. Epiphany.
msgid "Heilige Drei Könige"
msgstr "วันสมโภชพระคริสต์แสดงองค์"

#. Corpus Christi.
msgid "Fronleichnam"
msgstr "วันสมโภชพระคริสตวรกาย"

#. All Saints' Day.
msgid "Allerheiligen"
msgstr "วันสมโภชนักบุญทั้งหลาย"

#. Assumption Day.
msgid "Mariä Himmelfahrt"
msgstr "วันสมโภชแม่พระรับเกียรติยกขึ้นสวรรค์"

#. World Children's Day.
msgid "Weltkindertag"
msgstr "วันเด็กสากล"
Loading

0 comments on commit c4562fd

Please sign in to comment.