Skip to content

Commit

Permalink
Update Belarus holidays: add ru & th l10n, 2024-2025 substituted holi…
Browse files Browse the repository at this point in the history
…days (#2192)

Co-authored-by: ~Jhellico <KJhellico@users.noreply.github.com>
  • Loading branch information
PPsyrius and KJhellico authored Dec 27, 2024
1 parent b7718d8 commit 301185b
Show file tree
Hide file tree
Showing 9 changed files with 1,309 additions and 195 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ All other default values are highlighted with bold:
* - Belarus
- BY
-
- **be**, en_US
-
- **be**, en_US, ru, th
- WORKDAY
* - Belgium
- BE
-
Expand Down
107 changes: 93 additions & 14 deletions holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, MAR, APR, MAY, JUN, JUL, NOV, DEC
from holidays.calendars.julian import JULIAN_CALENDAR
from holidays.constants import PUBLIC, WORKDAY
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.holiday_base import HolidayBase

Expand All @@ -23,18 +24,24 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
Belarus holidays.
References:
- http://president.gov.by/en/holidays_en/
- https://president.gov.by/en/gosudarstvo/prazdniki
- https://president.gov.by/be/gosudarstvo/prazdniki
- https://president.gov.by/ru/gosudarstvo/prazdniki
- http://www.belarus.by/en/about-belarus/national-holidays
- http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
- http://president.gov.by/uploads/documents/2019/464uk.pdf
- https://ru.wikipedia.org/wiki/%D0%9F%D1%80%D0%B0%D0%B7%D0%B4%D0%BD%D0%B8%D0%BA%D0%B8_%D0%91%D0%B5%D0%BB%D0%BE%D1%80%D1%83%D1%81%D1%81%D0%B8%D0%B8
- https://ru.wikipedia.org/wiki/Праздники_Белоруссии
Cross-checked With:
- https://president.gov.by/en/gosudarstvo/prazdniki/calendar-2024
"""

country = "BY"
default_language = "be"
supported_languages = ("be", "en_US")
# The current set of holidays actual from 1998.
start_year = 1998
supported_categories = (PUBLIC, WORKDAY)
supported_languages = ("be", "en_US", "ru", "th")
# Declaration of State Sovereignty of the BSSR.
start_year = 1991

def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
Expand All @@ -44,35 +51,91 @@ def __init__(self, *args, **kwargs):

def _populate_public_holidays(self):
# New Year's Day.
self._add_new_years_day(tr("Новы год"))

name = tr("Новы год")
self._add_new_years_day(name)
if self._year >= 2020:
self._add_new_years_day_two(tr("Новы год"))
self._add_new_years_day_two(name)

# Orthodox Christmas Day.
self._add_christmas_day(tr("Нараджэнне Хрыстова (праваслаўнае Раство)"))

# Women's Day.
self._add_womens_day(tr("Дзень жанчын"))

# Radunitsa (Day of Rejoicing).
self._add_rejoicing_day(tr("Радаўніца"))
if 1995 <= self._year <= 1998:
# Constitution Day.
self._add_holiday_mar_15(tr("Дзень Канстытуцыі"))

# Labor Day.
self._add_labor_day(tr("Свята працы"))

# Victory Day.
self._add_world_war_two_victory_day(tr("Дзень Перамогі"), is_western=False)

# Independence Day.
self._add_holiday_jul_3(tr("Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"))
# Radunitsa (Day of Rejoicing).
self._add_rejoicing_day(tr("Радаўніца"))

# Independence Day of the Republic of Belarus (Day of the Republic).
name = tr("Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)")
if self._year >= 1997:
self._add_holiday_jul_3(name)
else:
self._add_holiday_jul_27(name)

# October Revolution Day.
self._add_holiday_nov_7(tr("Дзень Кастрычніцкай рэвалюцыі"))
if self._year >= 1995:
# October Revolution Day.
self._add_holiday_nov_7(tr("Дзень Кастрычніцкай рэвалюцыі"))

# Catholic Christmas Day.
self._add_christmas_day(tr("Нараджэнне Хрыстова (каталіцкае Раство)"), GREGORIAN_CALENDAR)

if self._year >= 1992:
# Catholic Easter.
name_catholic = tr("Каталiцкi Вялiкдзень")
self._add_easter_sunday(name_catholic, GREGORIAN_CALENDAR)

# Orthodox Easter.
name_orthodox = tr("Праваслаўны Вялiкдзень")
self._add_easter_sunday(name_orthodox)

if self._year <= 1997:
self._add_easter_monday(name_catholic, GREGORIAN_CALENDAR)
self._add_easter_monday(name_orthodox)

# Dzyady (All Souls' Day).
self._add_all_souls_day(tr("Дзень памяці"))

def _populate_workday_holidays(self):
# Day of the Fatherland's Defenders and the Armed Forces of the Republic of Belarus.
self._add_holiday_feb_23(tr("Дзень абаронцаў Айчыны і Узброеных Сіл Рэспублікі Беларусь"))

if self._year >= 1999:
# Constitution Day.
self._add_holiday_mar_15(tr("Дзень Канстытуцыі"))

if self._year >= 1996:
# Day of Unity of the Peoples of Belarus and Russia.
self._add_holiday_apr_2(tr("Дзень яднання народаў Беларусі і Расіі"))

if self._year >= 1998:
self._add_holiday_2nd_sun_of_may(
# Day of the National Coat of Arms of the Republic of Belarus,
# the National Flag of the Republic of Belarus
# and the National Anthem of the Republic of Belarus.
tr(
"Дзень Дзяржаўнага сцяга, Дзяржаўнага герба і Дзяржаўнага "
"гімна Рэспублікі Беларусь"
)
)

if self._year >= 2021:
# Day of People's Unity.
self._add_holiday_sep_17(tr("Дзень народнага адзінства"))

if self._year >= 1998:
# Dzyady (All Souls' Day).
self._add_all_souls_day(tr("Дзень памяці"))


class BY(Belarus):
pass
Expand All @@ -83,6 +146,12 @@ class BLR(Belarus):


class BelarusStaticHolidays:
"""
References
- https://belarusbank.by/en/financial-institutions/11151
- https://belarusbank.by/en/financial-institutions/11160
"""

# Date format (see strftime() Format Codes)
substituted_date_format = tr("%d.%m.%Y")
# Day off (substituted from %s).
Expand Down Expand Up @@ -221,4 +290,14 @@ class BelarusStaticHolidays:
(MAY, 8, MAY, 13),
(NOV, 6, NOV, 11),
),
2024: (
(MAY, 13, MAY, 18),
(NOV, 16, NOV, 8),
),
2025: (
(JAN, 6, JAN, 11),
(APR, 28, APR, 26),
(JUL, 4, JUL, 12),
(DEC, 26, DEC, 20),
),
}
2 changes: 2 additions & 0 deletions holidays/groups/christian.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def _add_all_souls_day(self, name) -> date:
All Souls' Day is a day of prayer and remembrance for the faithful
departed, observed by certain Christian denominations on 2 November.
In Belarussian tradition it is called Dziady.
https://en.wikipedia.org/wiki/All_Souls%27_Day
https://en.wikipedia.org/wiki/Dziady
"""
return self._add_holiday_nov_2(name)

Expand Down
70 changes: 53 additions & 17 deletions holidays/locale/be/LC_MESSAGES/BY.po
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Holidays 0.34\n"
"Project-Id-Version: Holidays 0.64\n"
"POT-Creation-Date: 2023-02-15 20:06-0800\n"
"PO-Revision-Date: 2023-09-27 18:49+0300\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"PO-Revision-Date: 2024-12-26 19:18+0700\n"
"Last-Translator: PPsyrius <ppsyrius@ppsyrius.dev>\n"
"Language-Team: Holidays Localization Team\n"
"Language: be\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.5\n"

#. Date format (see strftime() Format Codes)
msgid "%d.%m.%Y"
Expand All @@ -36,36 +35,73 @@ msgstr ""
msgid "Выходны (перанесены з %s)"
msgstr ""

#. Constitution Day.
msgid "Дзень Канстытуцыі"
msgstr ""

#. Day of Unity of the Peoples of Belarus and Russia.
msgid "Дзень яднання народаў Беларусі і Расіі"
msgstr ""

#. Victory Day.
msgid "Дзень Перамогі"
msgstr ""

#. Day of the National Coat of Arms of the Republic of Belarus, the National
#. Flag of the Republic of
#. Belarus and the National Anthem of the Republic of Belarus.
msgid ""
"Дзень Дзяржаўнага сцяга, Дзяржаўнага герба і Дзяржаўнага гімна Рэспублікі "
"Беларусь"
msgstr ""

#. Independence Day of the Republic of Belarus (Day of the Republic).
msgid "Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"
msgstr ""

#. Day of People's Unity.
msgid "Дзень народнага адзінства"
msgstr ""

#. New Year's Day.
msgid "Новы год"
msgstr ""

#. Orthodox Christmas Day.
msgid "Нараджэнне Хрыстова (праваслаўнае Раство)"
#. Day of the Fatherland's Defenders and the Armed Forces of the Republic of
#. Belarus.
msgid "Дзень абаронцаў Айчыны і Узброеных Сіл Рэспублікі Беларусь"
msgstr ""

#. Women's Day.
msgid "Дзень жанчын"
msgstr ""

#. Radunitsa (Day of Rejoicing).
msgid "Радаўніца"
msgstr ""

#. Labor Day.
msgid "Свята працы"
msgstr ""

#. Victory Day.
msgid "Дзень Перамогі"
#. October Revolution Day.
msgid "Дзень Кастрычніцкай рэвалюцыі"
msgstr ""

#. Independence Day.
msgid "Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)"
#. Orthodox Christmas Day.
msgid "Нараджэнне Хрыстова (праваслаўнае Раство)"
msgstr ""

#. October Revolution Day.
msgid "Дзень Кастрычніцкай рэвалюцыі"
#. Catholic Easter.
msgid "Каталiцкi Вялiкдзень"
msgstr ""

#. Orthodox Easter.
msgid "Праваслаўны Вялiкдзень"
msgstr ""

#. Radunitsa (Day of Rejoicing).
msgid "Радаўніца"
msgstr ""

#. Dzyady (All Souls' Day).
msgid "Дзень памяці"
msgstr ""

#. Catholic Christmas Day.
Expand Down
Loading

0 comments on commit 301185b

Please sign in to comment.