Skip to content

Commit

Permalink
Add 2024 Russian Substituted Holidays
Browse files Browse the repository at this point in the history
Co-Authored-By: summicron502 <152481672+summicron502@users.noreply.github.com>
  • Loading branch information
PPsyrius and summicron502 committed May 21, 2024
1 parent 35cbb44 commit 44eb5bc
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Alejandro Antunes
Alexander Schulze
Alexandre Carvalho
Anders Wenhaug
Andrei Klimenko
Andres Marrugo
Anthony Rose
Anton Daitche
Expand Down
22 changes: 18 additions & 4 deletions holidays/countries/russia.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from gettext import gettext as tr

from holidays.calendars.gregorian import JAN, FEB, MAY
from holidays.calendars.gregorian import JAN, FEB, APR, MAY, JUN, DEC
from holidays.calendars.julian import JULIAN_CALENDAR
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.holiday_base import HolidayBase
Expand Down Expand Up @@ -113,11 +113,25 @@ class RUS(Russia):


class RussiaStaticHolidays:
# Date format (see strftime() Format Codes).
substituted_date_format = tr("%d.%m.%Y")
# Day off (substituted from %s).
substituted_label = tr("Выходной (перенесено с %s)")

special_public_holidays = {
# Bridge days for 01/01/2023 and 08/01/2023.
# Substituted Holidays 2023
# src: https://www.consultant.ru/document/cons_doc_LAW_425407/
2023: (
(FEB, 24, tr("День защитника Отечества")),
(MAY, 8, tr("День Победы")),
(FEB, 24, JAN, 1),
(MAY, 8, JAN, 8),
),
# Substituted Holidays 2024
# src: https://www.consultant.ru/document/cons_doc_LAW_455140/
2024: (
(APR, 29, APR, 27),
(APR, 30, FEB, 11),
(MAY, 10, JUN, 1),
(DEC, 30, DEC, 28),
(DEC, 31, JAN, 7),
),
}
13 changes: 11 additions & 2 deletions holidays/locale/en_US/LC_MESSAGES/RU.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.29\n"
"POT-Creation-Date: 2023-02-15 08:13-0800\n"
"PO-Revision-Date: 2023-07-13 15:58+0300\n"
"PO-Revision-Date: 2024-05-21 13:26+0700\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Python Holidays localization team\n"
"Language: en_US\n"
Expand All @@ -25,7 +25,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.4.4\n"

#. New Year's Day.
msgid "Новый год"
Expand Down Expand Up @@ -82,3 +82,12 @@ msgstr "Day of consent and reconciliation"
#. Anniversary of the Great October Socialist Revolution.
msgid "Годовщина Великой Октябрьской социалистической революции"
msgstr "Anniversary of the Great October Socialist Revolution"

#. Date format (see strftime() Format Codes).
msgid "%d.%m.%Y"
msgstr "%m/%d/%Y"

#. Day off (substituted from %s).
#, c-format
msgid "Выходной (перенесено с %s)"
msgstr "Day off (substituted from %s)"
13 changes: 11 additions & 2 deletions holidays/locale/ru/LC_MESSAGES/RU.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.29\n"
"POT-Creation-Date: 2023-02-15 08:13-0800\n"
"PO-Revision-Date: 2023-07-13 15:57+0300\n"
"PO-Revision-Date: 2024-05-21 13:26+0700\n"
"Last-Translator: ~Jhellico <jhellico@gmail.com>\n"
"Language-Team: Python Holidays localization team\n"
"Language: ru\n"
Expand All @@ -25,7 +25,7 @@ msgstr ""
"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.4.4\n"

#. New Year's Day.
msgid "Новый год"
Expand Down Expand Up @@ -80,3 +80,12 @@ msgstr ""
#. Anniversary of the Great October Socialist Revolution.
msgid "Годовщина Великой Октябрьской социалистической революции"
msgstr ""

#. Date format (see strftime() Format Codes).
msgid "%d.%m.%Y"
msgstr ""

#. Day off (substituted from %s).
#, c-format
msgid "Выходной (перенесено с %s)"
msgstr ""
9 changes: 7 additions & 2 deletions snapshots/countries/RU_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@
"2023-01-07": "Christmas Day",
"2023-01-08": "New Year Holidays",
"2023-02-23": "Fatherland Defender's Day",
"2023-02-24": "Fatherland Defender's Day",
"2023-02-24": "Day off (substituted from 01/01/2023)",
"2023-03-08": "International Women's Day",
"2023-05-01": "Holiday of Spring and Labor",
"2023-05-08": "Victory Day",
"2023-05-08": "Day off (substituted from 01/08/2023)",
"2023-05-09": "Victory Day",
"2023-06-12": "Russia Day",
"2023-11-04": "Unity Day",
Expand All @@ -388,10 +388,15 @@
"2024-01-08": "New Year Holidays",
"2024-02-23": "Fatherland Defender's Day",
"2024-03-08": "International Women's Day",
"2024-04-29": "Day off (substituted from 04/27/2024)",
"2024-04-30": "Day off (substituted from 02/11/2024)",
"2024-05-01": "Holiday of Spring and Labor",
"2024-05-09": "Victory Day",
"2024-05-10": "Day off (substituted from 06/01/2024)",
"2024-06-12": "Russia Day",
"2024-11-04": "Unity Day",
"2024-12-30": "Day off (substituted from 12/28/2024)",
"2024-12-31": "Day off (substituted from 01/07/2024)",
"2025-01-01": "New Year Holidays",
"2025-01-02": "New Year Holidays",
"2025-01-03": "New Year Holidays",
Expand Down
6 changes: 6 additions & 0 deletions tests/countries/test_russia.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ def test_no_holidays(self):

def test_special_holidays(self):
self.assertHoliday(
# Substituted Holidays.
"2023-02-24",
"2023-05-08",
"2024-04-29",
"2024-04-30",
"2024-05-10",
"2024-12-30",
"2024-12-31",
)

def test_new_year(self):
Expand Down

0 comments on commit 44eb5bc

Please sign in to comment.