From 44eb5bc51a8f6ccc99d46908ecf97111cf842394 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Tue, 21 May 2024 13:33:54 +0700 Subject: [PATCH 1/2] Add 2024 Russian Substituted Holidays Co-Authored-By: summicron502 <152481672+summicron502@users.noreply.github.com> --- AUTHORS | 1 + holidays/countries/russia.py | 22 ++++++++++++++++++---- holidays/locale/en_US/LC_MESSAGES/RU.po | 13 +++++++++++-- holidays/locale/ru/LC_MESSAGES/RU.po | 13 +++++++++++-- snapshots/countries/RU_COMMON.json | 9 +++++++-- tests/countries/test_russia.py | 6 ++++++ 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1a0419004..106eb1edd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,6 +9,7 @@ Alejandro Antunes Alexander Schulze Alexandre Carvalho Anders Wenhaug +Andrei Klimenko Andres Marrugo Anthony Rose Anton Daitche diff --git a/holidays/countries/russia.py b/holidays/countries/russia.py index 534179f6a..4257fb38d 100644 --- a/holidays/countries/russia.py +++ b/holidays/countries/russia.py @@ -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 @@ -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), ), } diff --git a/holidays/locale/en_US/LC_MESSAGES/RU.po b/holidays/locale/en_US/LC_MESSAGES/RU.po index abece3fa9..a00490071 100644 --- a/holidays/locale/en_US/LC_MESSAGES/RU.po +++ b/holidays/locale/en_US/LC_MESSAGES/RU.po @@ -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 \n" "Language-Team: Python Holidays localization team\n" "Language: en_US\n" @@ -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 "Новый год" @@ -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)" diff --git a/holidays/locale/ru/LC_MESSAGES/RU.po b/holidays/locale/ru/LC_MESSAGES/RU.po index 3933501bd..4a25052a3 100644 --- a/holidays/locale/ru/LC_MESSAGES/RU.po +++ b/holidays/locale/ru/LC_MESSAGES/RU.po @@ -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 \n" "Language-Team: Python Holidays localization team\n" "Language: ru\n" @@ -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 "Новый год" @@ -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 "" diff --git a/snapshots/countries/RU_COMMON.json b/snapshots/countries/RU_COMMON.json index e59e52ea3..6a5f9fe6c 100644 --- a/snapshots/countries/RU_COMMON.json +++ b/snapshots/countries/RU_COMMON.json @@ -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", @@ -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", diff --git a/tests/countries/test_russia.py b/tests/countries/test_russia.py index 3f2b7b3d1..31666ff5d 100644 --- a/tests/countries/test_russia.py +++ b/tests/countries/test_russia.py @@ -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): From 2ee68e09732ccba9f8ec623ac2d971d3712d6554 Mon Sep 17 00:00:00 2001 From: PPsyrius <19505219+PPsyrius@users.noreply.github.com> Date: Wed, 22 May 2024 15:00:44 +0700 Subject: [PATCH 2/2] [RU] fixed wrong substituted date Co-Authored-By: ~Jhellico --- holidays/countries/russia.py | 6 +++--- snapshots/countries/RU_COMMON.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/holidays/countries/russia.py b/holidays/countries/russia.py index 4257fb38d..863ef010e 100644 --- a/holidays/countries/russia.py +++ b/holidays/countries/russia.py @@ -12,7 +12,7 @@ from gettext import gettext as tr -from holidays.calendars.gregorian import JAN, FEB, APR, MAY, JUN, DEC +from holidays.calendars.gregorian import JAN, FEB, APR, MAY, NOV, DEC from holidays.calendars.julian import JULIAN_CALENDAR from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.holiday_base import HolidayBase @@ -129,8 +129,8 @@ class RussiaStaticHolidays: # src: https://www.consultant.ru/document/cons_doc_LAW_455140/ 2024: ( (APR, 29, APR, 27), - (APR, 30, FEB, 11), - (MAY, 10, JUN, 1), + (APR, 30, NOV, 2), + (MAY, 10, JAN, 6), (DEC, 30, DEC, 28), (DEC, 31, JAN, 7), ), diff --git a/snapshots/countries/RU_COMMON.json b/snapshots/countries/RU_COMMON.json index 6a5f9fe6c..18cfd72ce 100644 --- a/snapshots/countries/RU_COMMON.json +++ b/snapshots/countries/RU_COMMON.json @@ -389,10 +389,10 @@ "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-04-30": "Day off (substituted from 11/02/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-05-10": "Day off (substituted from 01/06/2024)", "2024-06-12": "Russia Day", "2024-11-04": "Unity Day", "2024-12-30": "Day off (substituted from 12/28/2024)",