From f2d92c31e65be1aba38360cb87dbad4055cd0d9b Mon Sep 17 00:00:00 2001 From: ~Jhellico Date: Fri, 13 Jun 2025 18:01:22 +0300 Subject: [PATCH] Update Namibia holidays, add l10n support --- .gitignore | 1 + README.md | 2 +- holidays/countries/namibia.py | 111 ++++++--- holidays/locale/en_NA/LC_MESSAGES/NA.po | 120 ++++++++++ holidays/locale/en_US/LC_MESSAGES/NA.po | 120 ++++++++++ holidays/locale/uk/LC_MESSAGES/NA.po | 120 ++++++++++ snapshots/countries/NA_COMMON.json | 51 ++++- tests/countries/test_namibia.py | 284 ++++++++++++++++++++---- 8 files changed, 723 insertions(+), 86 deletions(-) create mode 100644 holidays/locale/en_NA/LC_MESSAGES/NA.po create mode 100644 holidays/locale/en_US/LC_MESSAGES/NA.po create mode 100644 holidays/locale/uk/LC_MESSAGES/NA.po diff --git a/.gitignore b/.gitignore index 1f473df52e..e3f0e77028 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ .venv .vscode/ *.code-workspace +*.csv *.DS_Store *.egg-info *.mo diff --git a/README.md b/README.md index 00f1a5df3d..9ac4a02dc8 100644 --- a/README.md +++ b/README.md @@ -962,7 +962,7 @@ any) in brackets, available languages and additional holiday categories. All cou Namibia NA - +en_NA, en_US, uk diff --git a/holidays/countries/namibia.py b/holidays/countries/namibia.py index b00fa50cf0..34235e6aa6 100644 --- a/holidays/countries/namibia.py +++ b/holidays/countries/namibia.py @@ -10,7 +10,9 @@ # Website: https://github.com/vacanza/holidays # License: MIT (see LICENSE file) -from holidays.calendars.gregorian import JAN, DEC +from gettext import gettext as tr + +from holidays.calendars.gregorian import JAN, FEB, MAR, SEP, OCT, NOV, DEC from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON @@ -19,71 +21,77 @@ class Namibia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta """Namibia holidays. References: - * - * - * + * [Public Holidays Act, 1990](https://web.archive.org/web/20250322163344/https://namiblii.org/akn/na/act/1990/26/eng@2004-12-17) + * [Public Holidays Amendment Act, 2004](https://web.archive.org/web/20221015121213/https://namiblii.org/akn/na/act/2004/16/eng@2004-12-17) + * [Genocide Remembrance Day](https://web.archive.org/web/20250126055207/https://namiblii.org/akn/na/officialGazette/government-gazette/2024-05-28/8373/eng@2024-05-28) - As of 1991/2/1, whenever a public holiday falls on a Sunday, it rolls over to the monday, - unless that monday is already a public holiday. + As of 1991/2/1, whenever a public holiday falls on a Sunday, it rolls over to the Monday, + unless that Monday is already a public holiday. Since the interval from 1991/1/1 to 1991/2/1 includes only New Year's Day, and it's a Tuesday, we can assume that the beginning is 1991. """ country = "NA" + default_language = "en_NA" # %s (observed). - observed_label = "%s (observed)" - start_year = 1990 + observed_label = tr("%s (observed)") + start_year = 1991 + supported_languages = ("en_NA", "en_US", "uk") def __init__(self, *args, **kwargs): ChristianHolidays.__init__(self) InternationalHolidays.__init__(self) StaticHolidays.__init__(self, NamibiaStaticHolidays) kwargs.setdefault("observed_rule", SUN_TO_NEXT_MON) - kwargs.setdefault("observed_since", 1991) super().__init__(*args, **kwargs) def _populate_public_holidays(self): # New Year's Day. - self._add_observed(self._add_new_years_day("New Year's Day")) + self._add_observed(self._add_new_years_day(tr("New Year's Day"))) # Independence Day. - self._add_observed(self._add_holiday_mar_21("Independence Day")) + self._add_observed(self._add_holiday_mar_21(tr("Independence Day"))) # Good Friday. - self._add_good_friday("Good Friday") + self._add_good_friday(tr("Good Friday")) # Easter Monday. - self._add_easter_monday("Easter Monday") + self._add_easter_monday(tr("Easter Monday")) # Workers' Day. - self._add_observed(self._add_labor_day("Workers' Day")) + self._add_observed(self._add_labor_day(tr("Workers' Day"))) # Cassinga Day. - self._add_observed(self._add_holiday_may_4("Cassinga Day")) + self._add_observed(self._add_holiday_may_4(tr("Cassinga Day"))) # Africa Day. - self._add_observed(self._add_africa_day("Africa Day")) + self._add_observed(self._add_africa_day(tr("Africa Day"))) + + if self._year >= 2025: + # Genocide Remembrance Day. + self._add_holiday_may_28(tr("Genocide Remembrance Day")) # Ascension Day. - self._add_ascension_thursday("Ascension Day") + self._add_ascension_thursday(tr("Ascension Day")) # Heroes' Day. - self._add_observed(self._add_holiday_aug_26("Heroes' Day")) + self._add_observed(self._add_holiday_aug_26(tr("Heroes' Day"))) - # https://web.archive.org/web/20240420201933/https://www.lac.org.na/laws/2004/3348.pdf self._add_observed( self._add_holiday_sep_10( - "Day of the Namibian Women and International Human Rights Day" + # Day of the Namibian Women and International Human Rights Day. + tr("Day of the Namibian Women and International Human Rights Day") if self._year >= 2005 - else "International Human Rights Day" + # International Human Rights Day. + else tr("International Human Rights Day") ) ) # Christmas Day. - self._add_christmas_day("Christmas Day") + self._add_christmas_day(tr("Christmas Day")) # Family Day. - self._add_observed(self._add_christmas_day_two("Family Day")) + self._add_observed(self._add_christmas_day_two(tr("Family Day"))) class NA(Namibia): @@ -95,8 +103,59 @@ class NAM(Namibia): class NamibiaStaticHolidays: + """Namibia special holidays. + + References: + * [March 1, 1994](https://web.archive.org/web/20241210145818/https://namiblii.org/akn/na/officialGazette/government-gazette/1994-02-15/797/eng@1994-02-15) + * [December 7, 1994](https://web.archive.org/web/20250613113650/https://namiblii.org/akn/na/officialGazette/government-gazette/1994-11-30/987/eng@1994-11-30) + * [October 24, 1995](https://web.archive.org/web/20250613184422/https://namiblii.org/akn/na/officialGazette/government-gazette/1995-10-20/1178/eng@1995-10-20) + * [September 26, 1997](https://web.archive.org/web/20250613172016/https://namiblii.org/akn/na/officialGazette/government-gazette/1997-09-25/1690/eng@1997-09-25) + * [November 30, 1998](https://web.archive.org/web/20250613184549/https://namiblii.org/akn/na/officialGazette/government-gazette/1998-11-06/1988/eng@1998-11-06) + * [November 30, 1999](https://web.archive.org/web/20241012184236/https://namiblii.org/akn/na/officialGazette/government-gazette/1999-10-08/2202/eng@1999-10-08) + * [Y2K changeover](https://web.archive.org/web/20250613145912/https://namiblii.org/akn/na/officialGazette/government-gazette/1999-11-22/2234/eng@1999-11-22) + * [November 28, 2014](https://web.archive.org/web/20250613184051/https://namiblii.org/akn/na/officialGazette/government-gazette/2014-11-07/5609/eng@2014-11-07) + * [November 27, 2015](https://web.archive.org/web/20250613184258/https://namiblii.org/akn/na/officialGazette/government-gazette/2015-11-26/5885/eng@2015-11-26) + * [November 27, 2019](https://web.archive.org/web/20241112233422/https://namiblii.org/akn/na/officialGazette/government-gazette/2019-09-30/7008/eng@2019-09-30) + * [November 25, 2020](https://web.archive.org/web/20250613112403/https://namiblii.org/akn/na/officialGazette/government-gazette/2020-11-19/7394/eng@2020-11-19) + * [February 25, 2024](https://web.archive.org/web/20241203060851/https://namiblii.org/akn/na/officialGazette/government-gazette/2024-02-20/8312/eng@2024-02-20) + * [November 27, 2024](https://web.archive.org/web/20250514020246/https://namiblii.org/akn/na/officialGazette/government-gazette/2024-09-26/8454/eng@2024-09-26) + * [March 1, 2025](https://web.archive.org/web/20250613172517/https://namiblii.org/akn/na/officialGazette/government-gazette/2025-02-14/8577/eng@2025-02-14) + """ + + # Y2K changeover. + y2k_changeover = tr("Y2K changeover") + + # General Election Day. + general_election_day = tr("General Election Day") + + # Regional Election Day. + regional_election_day = tr("Regional Election Day") + special_public_holidays = { - # https://web.archive.org/web/20240616004907/https://gazettes.africa/archive/na/1999/na-government-gazette-dated-1999-11-22-no-2234.pdf - 1999: (DEC, 31, "Y2K changeover"), - 2000: (JAN, 3, "Y2K changeover"), + 1994: ( + # Walvis Bay Reintegration Day. + (MAR, 1, tr("Walvis Bay Reintegration Day")), + (DEC, 7, general_election_day), + ), + # Public Holiday. + 1995: (OCT, 24, tr("Public Holiday")), + # Day of Mourning for Honourable Moses Garoeb. + 1997: (SEP, 26, tr("Day of Mourning for Honourable Moses Garoeb")), + 1998: (NOV, 30, regional_election_day), + 1999: ( + (NOV, 30, general_election_day), + (DEC, 31, y2k_changeover), + ), + 2000: (JAN, 3, y2k_changeover), + 2014: (NOV, 28, general_election_day), + 2015: (NOV, 27, regional_election_day), + 2019: (NOV, 27, general_election_day), + 2020: (NOV, 25, regional_election_day), + 2024: ( + # Burial ceremony of Dr. Hage Gottfried Geingob. + (FEB, 25, tr("Burial ceremony of Dr. Hage Gottfried Geingob")), + (NOV, 27, general_election_day), + ), + # Burial ceremony of Dr. Sam Shafiishuna Nujoma. + 2025: (MAR, 1, tr("Burial ceremony of Dr. Sam Shafiishuna Nujoma")), } diff --git a/holidays/locale/en_NA/LC_MESSAGES/NA.po b/holidays/locale/en_NA/LC_MESSAGES/NA.po new file mode 100644 index 0000000000..cd3ff44500 --- /dev/null +++ b/holidays/locale/en_NA/LC_MESSAGES/NA.po @@ -0,0 +1,120 @@ +# 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 CONTRIBUTORS file) +# dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/vacanza/holidays +# License: MIT (see LICENSE file) +# +# Namibia holidays. +# +msgid "" +msgstr "" +"Project-Id-Version: Holidays 0.75\n" +"POT-Creation-Date: 2025-06-13 21:11+0300\n" +"PO-Revision-Date: 2025-06-13 21:11+0300\n" +"Last-Translator: ~Jhellico \n" +"Language-Team: Holidays Localization Team\n" +"Language: en_NA\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Lingva 5.0.6\n" +"X-Source-Language: en_NA\n" + +#. %s (observed). +#, c-format +msgid "%s (observed)" +msgstr "" + +#. New Year's Day. +msgid "New Year's Day" +msgstr "" + +#. Independence Day. +msgid "Independence Day" +msgstr "" + +#. Good Friday. +msgid "Good Friday" +msgstr "" + +#. Easter Monday. +msgid "Easter Monday" +msgstr "" + +#. Workers' Day. +msgid "Workers' Day" +msgstr "" + +#. Cassinga Day. +msgid "Cassinga Day" +msgstr "" + +#. Africa Day. +msgid "Africa Day" +msgstr "" + +#. Genocide Remembrance Day. +msgid "Genocide Remembrance Day" +msgstr "" + +#. Ascension Day. +msgid "Ascension Day" +msgstr "" + +#. Heroes' Day. +msgid "Heroes' Day" +msgstr "" + +#. Day of the Namibian Women and International Human Rights Day. +msgid "Day of the Namibian Women and International Human Rights Day" +msgstr "" + +#. International Human Rights Day. +msgid "International Human Rights Day" +msgstr "" + +#. Christmas Day. +msgid "Christmas Day" +msgstr "" + +#. Family Day. +msgid "Family Day" +msgstr "" + +#. Y2K changeover. +msgid "Y2K changeover" +msgstr "" + +#. General Election Day. +msgid "General Election Day" +msgstr "" + +#. Regional Election Day. +msgid "Regional Election Day" +msgstr "" + +#. Walvis Bay Reintegration Day. +msgid "Walvis Bay Reintegration Day" +msgstr "" + +#. Public Holiday. +msgid "Public Holiday" +msgstr "" + +#. Day of Mourning for Honourable Moses Garoeb. +msgid "Day of Mourning for Honourable Moses Garoeb" +msgstr "" + +#. Burial ceremony of Dr. Hage Gottfried Geingob. +msgid "Burial ceremony of Dr. Hage Gottfried Geingob" +msgstr "" + +#. Burial ceremony of Dr. Sam Shafiishuna Nujoma. +msgid "Burial ceremony of Dr. Sam Shafiishuna Nujoma" +msgstr "" diff --git a/holidays/locale/en_US/LC_MESSAGES/NA.po b/holidays/locale/en_US/LC_MESSAGES/NA.po new file mode 100644 index 0000000000..21d76ec574 --- /dev/null +++ b/holidays/locale/en_US/LC_MESSAGES/NA.po @@ -0,0 +1,120 @@ +# 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 CONTRIBUTORS file) +# dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/vacanza/holidays +# License: MIT (see LICENSE file) +# +# Namibia holidays en_US localization. +# +msgid "" +msgstr "" +"Project-Id-Version: Holidays 0.75\n" +"POT-Creation-Date: 2025-06-13 21:11+0300\n" +"PO-Revision-Date: 2025-06-13 21:11+0300\n" +"Last-Translator: ~Jhellico \n" +"Language-Team: Holidays Localization Team\n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Lingva 5.0.6\n" +"X-Source-Language: en_NA\n" + +#. %s (observed). +#, c-format +msgid "%s (observed)" +msgstr "%s (observed)" + +#. New Year's Day. +msgid "New Year's Day" +msgstr "New Year's Day" + +#. Independence Day. +msgid "Independence Day" +msgstr "Independence Day" + +#. Good Friday. +msgid "Good Friday" +msgstr "Good Friday" + +#. Easter Monday. +msgid "Easter Monday" +msgstr "Easter Monday" + +#. Workers' Day. +msgid "Workers' Day" +msgstr "Workers' Day" + +#. Cassinga Day. +msgid "Cassinga Day" +msgstr "Cassinga Day" + +#. Africa Day. +msgid "Africa Day" +msgstr "Africa Day" + +#. Genocide Remembrance Day. +msgid "Genocide Remembrance Day" +msgstr "Genocide Remembrance Day" + +#. Ascension Day. +msgid "Ascension Day" +msgstr "Ascension Day" + +#. Heroes' Day. +msgid "Heroes' Day" +msgstr "Heroes' Day" + +#. Day of the Namibian Women and International Human Rights Day. +msgid "Day of the Namibian Women and International Human Rights Day" +msgstr "Day of the Namibian Women and International Human Rights Day" + +#. International Human Rights Day. +msgid "International Human Rights Day" +msgstr "International Human Rights Day" + +#. Christmas Day. +msgid "Christmas Day" +msgstr "Christmas Day" + +#. Family Day. +msgid "Family Day" +msgstr "Family Day" + +#. Y2K changeover. +msgid "Y2K changeover" +msgstr "Y2K changeover" + +#. General Election Day. +msgid "General Election Day" +msgstr "General Election Day" + +#. Regional Election Day. +msgid "Regional Election Day" +msgstr "Regional Election Day" + +#. Walvis Bay Reintegration Day. +msgid "Walvis Bay Reintegration Day" +msgstr "Walvis Bay Reintegration Day" + +#. Public Holiday. +msgid "Public Holiday" +msgstr "Public Holiday" + +#. Day of Mourning for Honourable Moses Garoeb. +msgid "Day of Mourning for Honourable Moses Garoeb" +msgstr "Day of Mourning for Honourable Moses Garoeb" + +#. Burial ceremony of Dr. Hage Gottfried Geingob. +msgid "Burial ceremony of Dr. Hage Gottfried Geingob" +msgstr "Burial ceremony of Dr. Hage Gottfried Geingob" + +#. Burial ceremony of Dr. Sam Shafiishuna Nujoma. +msgid "Burial ceremony of Dr. Sam Shafiishuna Nujoma" +msgstr "Burial ceremony of Dr. Sam Shafiishuna Nujoma" diff --git a/holidays/locale/uk/LC_MESSAGES/NA.po b/holidays/locale/uk/LC_MESSAGES/NA.po new file mode 100644 index 0000000000..1e6e8a82dd --- /dev/null +++ b/holidays/locale/uk/LC_MESSAGES/NA.po @@ -0,0 +1,120 @@ +# 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 CONTRIBUTORS file) +# dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/vacanza/holidays +# License: MIT (see LICENSE file) +# +# Namibia holidays uk localization. +# +msgid "" +msgstr "" +"Project-Id-Version: Holidays 0.75\n" +"POT-Creation-Date: 2025-06-13 21:11+0300\n" +"PO-Revision-Date: 2025-06-13 21:11+0300\n" +"Last-Translator: ~Jhellico \n" +"Language-Team: Holidays Localization Team\n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Lingva 5.0.6\n" +"X-Source-Language: en_NA\n" + +#. %s (observed). +#, c-format +msgid "%s (observed)" +msgstr "%s (вихідний)" + +#. New Year's Day. +msgid "New Year's Day" +msgstr "Новий рік" + +#. Independence Day. +msgid "Independence Day" +msgstr "День незалежності" + +#. Good Friday. +msgid "Good Friday" +msgstr "Страсна пʼятниця" + +#. Easter Monday. +msgid "Easter Monday" +msgstr "Великодній понеділок" + +#. Workers' Day. +msgid "Workers' Day" +msgstr "День трудящих" + +#. Cassinga Day. +msgid "Cassinga Day" +msgstr "День Кассінги" + +#. Africa Day. +msgid "Africa Day" +msgstr "День Африки" + +#. Genocide Remembrance Day. +msgid "Genocide Remembrance Day" +msgstr "День памʼяті жертв геноциду" + +#. Ascension Day. +msgid "Ascension Day" +msgstr "Вознесіння Господнє" + +#. Heroes' Day. +msgid "Heroes' Day" +msgstr "День Героїв" + +#. Day of the Namibian Women and International Human Rights Day. +msgid "Day of the Namibian Women and International Human Rights Day" +msgstr "День намібійських жінок та Міжнародний день прав людини" + +#. International Human Rights Day. +msgid "International Human Rights Day" +msgstr "Міжнародний день прав людини" + +#. Christmas Day. +msgid "Christmas Day" +msgstr "Різдво Христове" + +#. Family Day. +msgid "Family Day" +msgstr "День родини" + +#. Y2K changeover. +msgid "Y2K changeover" +msgstr "Y2K-перехід" + +#. General Election Day. +msgid "General Election Day" +msgstr "День загальних виборів" + +#. Regional Election Day. +msgid "Regional Election Day" +msgstr "День місцевих виборів" + +#. Walvis Bay Reintegration Day. +msgid "Walvis Bay Reintegration Day" +msgstr "День реінтеграції Волфіш-Бей" + +#. Public Holiday. +msgid "Public Holiday" +msgstr "Вихідний день" + +#. Day of Mourning for Honourable Moses Garoeb. +msgid "Day of Mourning for Honourable Moses Garoeb" +msgstr "День жалоби за Мозесом Гароебом" + +#. Burial ceremony of Dr. Hage Gottfried Geingob. +msgid "Burial ceremony of Dr. Hage Gottfried Geingob" +msgstr "Церемонія поховання Хаге Готтфріда Гейнгоба" + +#. Burial ceremony of Dr. Sam Shafiishuna Nujoma. +msgid "Burial ceremony of Dr. Sam Shafiishuna Nujoma" +msgstr "Церемонія поховання Сема Шафіішуна Нуйоми" diff --git a/snapshots/countries/NA_COMMON.json b/snapshots/countries/NA_COMMON.json index f54c0aa649..72344882ca 100644 --- a/snapshots/countries/NA_COMMON.json +++ b/snapshots/countries/NA_COMMON.json @@ -1,16 +1,4 @@ { - "1990-01-01": "New Year's Day", - "1990-03-21": "Independence Day", - "1990-04-13": "Good Friday", - "1990-04-16": "Easter Monday", - "1990-05-01": "Workers' Day", - "1990-05-04": "Cassinga Day", - "1990-05-24": "Ascension Day", - "1990-05-25": "Africa Day", - "1990-08-26": "Heroes' Day", - "1990-09-10": "International Human Rights Day", - "1990-12-25": "Christmas Day", - "1990-12-26": "Family Day", "1991-01-01": "New Year's Day", "1991-03-21": "Independence Day", "1991-03-29": "Good Friday", @@ -50,6 +38,7 @@ "1993-12-26": "Family Day", "1993-12-27": "Family Day (observed)", "1994-01-01": "New Year's Day", + "1994-03-01": "Walvis Bay Reintegration Day", "1994-03-21": "Independence Day", "1994-04-01": "Good Friday", "1994-04-04": "Easter Monday", @@ -60,6 +49,7 @@ "1994-05-25": "Africa Day", "1994-08-26": "Heroes' Day", "1994-09-10": "International Human Rights Day", + "1994-12-07": "General Election Day", "1994-12-25": "Christmas Day", "1994-12-26": "Family Day", "1995-01-01": "New Year's Day", @@ -73,6 +63,7 @@ "1995-08-26": "Heroes' Day", "1995-09-10": "International Human Rights Day", "1995-09-11": "International Human Rights Day (observed)", + "1995-10-24": "Public Holiday", "1995-12-25": "Christmas Day", "1995-12-26": "Family Day", "1996-01-01": "New Year's Day", @@ -99,6 +90,7 @@ "1997-05-26": "Africa Day (observed)", "1997-08-26": "Heroes' Day", "1997-09-10": "International Human Rights Day", + "1997-09-26": "Day of Mourning for Honourable Moses Garoeb", "1997-12-25": "Christmas Day", "1997-12-26": "Family Day", "1998-01-01": "New Year's Day", @@ -111,6 +103,7 @@ "1998-05-25": "Africa Day", "1998-08-26": "Heroes' Day", "1998-09-10": "International Human Rights Day", + "1998-11-30": "Regional Election Day", "1998-12-25": "Christmas Day", "1998-12-26": "Family Day", "1999-01-01": "New Year's Day", @@ -124,6 +117,7 @@ "1999-05-25": "Africa Day", "1999-08-26": "Heroes' Day", "1999-09-10": "International Human Rights Day", + "1999-11-30": "General Election Day", "1999-12-25": "Christmas Day", "1999-12-26": "Family Day", "1999-12-27": "Family Day (observed)", @@ -323,6 +317,7 @@ "2014-05-29": "Ascension Day", "2014-08-26": "Heroes' Day", "2014-09-10": "Day of the Namibian Women and International Human Rights Day", + "2014-11-28": "General Election Day", "2014-12-25": "Christmas Day", "2014-12-26": "Family Day", "2015-01-01": "New Year's Day", @@ -335,6 +330,7 @@ "2015-05-25": "Africa Day", "2015-08-26": "Heroes' Day", "2015-09-10": "Day of the Namibian Women and International Human Rights Day", + "2015-11-27": "Regional Election Day", "2015-12-25": "Christmas Day", "2015-12-26": "Family Day", "2016-01-01": "New Year's Day", @@ -386,6 +382,7 @@ "2019-05-30": "Ascension Day", "2019-08-26": "Heroes' Day", "2019-09-10": "Day of the Namibian Women and International Human Rights Day", + "2019-11-27": "General Election Day", "2019-12-25": "Christmas Day", "2019-12-26": "Family Day", "2020-01-01": "New Year's Day", @@ -398,6 +395,7 @@ "2020-05-25": "Africa Day", "2020-08-26": "Heroes' Day", "2020-09-10": "Day of the Namibian Women and International Human Rights Day", + "2020-11-25": "Regional Election Day", "2020-12-25": "Christmas Day", "2020-12-26": "Family Day", "2021-01-01": "New Year's Day", @@ -442,6 +440,7 @@ "2023-12-25": "Christmas Day", "2023-12-26": "Family Day", "2024-01-01": "New Year's Day", + "2024-02-25": "Burial ceremony of Dr. Hage Gottfried Geingob", "2024-03-21": "Independence Day", "2024-03-29": "Good Friday", "2024-04-01": "Easter Monday", @@ -451,9 +450,11 @@ "2024-05-25": "Africa Day", "2024-08-26": "Heroes' Day", "2024-09-10": "Day of the Namibian Women and International Human Rights Day", + "2024-11-27": "General Election Day", "2024-12-25": "Christmas Day", "2024-12-26": "Family Day", "2025-01-01": "New Year's Day", + "2025-03-01": "Burial ceremony of Dr. Sam Shafiishuna Nujoma", "2025-03-21": "Independence Day", "2025-04-18": "Good Friday", "2025-04-21": "Easter Monday", @@ -462,6 +463,7 @@ "2025-05-05": "Cassinga Day (observed)", "2025-05-25": "Africa Day", "2025-05-26": "Africa Day (observed)", + "2025-05-28": "Genocide Remembrance Day", "2025-05-29": "Ascension Day", "2025-08-26": "Heroes' Day", "2025-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -475,6 +477,7 @@ "2026-05-04": "Cassinga Day", "2026-05-14": "Ascension Day", "2026-05-25": "Africa Day", + "2026-05-28": "Genocide Remembrance Day", "2026-08-26": "Heroes' Day", "2026-09-10": "Day of the Namibian Women and International Human Rights Day", "2026-12-25": "Christmas Day", @@ -488,6 +491,7 @@ "2027-05-04": "Cassinga Day", "2027-05-06": "Ascension Day", "2027-05-25": "Africa Day", + "2027-05-28": "Genocide Remembrance Day", "2027-08-26": "Heroes' Day", "2027-09-10": "Day of the Namibian Women and International Human Rights Day", "2027-12-25": "Christmas Day", @@ -500,6 +504,7 @@ "2028-05-01": "Workers' Day", "2028-05-04": "Cassinga Day", "2028-05-25": "Africa Day; Ascension Day", + "2028-05-28": "Genocide Remembrance Day", "2028-08-26": "Heroes' Day", "2028-09-10": "Day of the Namibian Women and International Human Rights Day", "2028-09-11": "Day of the Namibian Women and International Human Rights Day (observed)", @@ -513,6 +518,7 @@ "2029-05-04": "Cassinga Day", "2029-05-10": "Ascension Day", "2029-05-25": "Africa Day", + "2029-05-28": "Genocide Remembrance Day", "2029-08-26": "Heroes' Day", "2029-08-27": "Heroes' Day (observed)", "2029-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -525,6 +531,7 @@ "2030-05-01": "Workers' Day", "2030-05-04": "Cassinga Day", "2030-05-25": "Africa Day", + "2030-05-28": "Genocide Remembrance Day", "2030-05-30": "Ascension Day", "2030-08-26": "Heroes' Day", "2030-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -540,6 +547,7 @@ "2031-05-22": "Ascension Day", "2031-05-25": "Africa Day", "2031-05-26": "Africa Day (observed)", + "2031-05-28": "Genocide Remembrance Day", "2031-08-26": "Heroes' Day", "2031-09-10": "Day of the Namibian Women and International Human Rights Day", "2031-12-25": "Christmas Day", @@ -553,6 +561,7 @@ "2032-05-04": "Cassinga Day", "2032-05-06": "Ascension Day", "2032-05-25": "Africa Day", + "2032-05-28": "Genocide Remembrance Day", "2032-08-26": "Heroes' Day", "2032-09-10": "Day of the Namibian Women and International Human Rights Day", "2032-12-25": "Christmas Day", @@ -567,6 +576,7 @@ "2033-05-04": "Cassinga Day", "2033-05-25": "Africa Day", "2033-05-26": "Ascension Day", + "2033-05-28": "Genocide Remembrance Day", "2033-08-26": "Heroes' Day", "2033-09-10": "Day of the Namibian Women and International Human Rights Day", "2033-12-25": "Christmas Day", @@ -580,6 +590,7 @@ "2034-05-04": "Cassinga Day", "2034-05-18": "Ascension Day", "2034-05-25": "Africa Day", + "2034-05-28": "Genocide Remembrance Day", "2034-08-26": "Heroes' Day", "2034-09-10": "Day of the Namibian Women and International Human Rights Day", "2034-09-11": "Day of the Namibian Women and International Human Rights Day (observed)", @@ -593,6 +604,7 @@ "2035-05-03": "Ascension Day", "2035-05-04": "Cassinga Day", "2035-05-25": "Africa Day", + "2035-05-28": "Genocide Remembrance Day", "2035-08-26": "Heroes' Day", "2035-08-27": "Heroes' Day (observed)", "2035-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -608,6 +620,7 @@ "2036-05-22": "Ascension Day", "2036-05-25": "Africa Day", "2036-05-26": "Africa Day (observed)", + "2036-05-28": "Genocide Remembrance Day", "2036-08-26": "Heroes' Day", "2036-09-10": "Day of the Namibian Women and International Human Rights Day", "2036-12-25": "Christmas Day", @@ -620,6 +633,7 @@ "2037-05-04": "Cassinga Day", "2037-05-14": "Ascension Day", "2037-05-25": "Africa Day", + "2037-05-28": "Genocide Remembrance Day", "2037-08-26": "Heroes' Day", "2037-09-10": "Day of the Namibian Women and International Human Rights Day", "2037-12-25": "Christmas Day", @@ -632,6 +646,7 @@ "2038-05-01": "Workers' Day", "2038-05-04": "Cassinga Day", "2038-05-25": "Africa Day", + "2038-05-28": "Genocide Remembrance Day", "2038-06-03": "Ascension Day", "2038-08-26": "Heroes' Day", "2038-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -647,6 +662,7 @@ "2039-05-04": "Cassinga Day", "2039-05-19": "Ascension Day", "2039-05-25": "Africa Day", + "2039-05-28": "Genocide Remembrance Day", "2039-08-26": "Heroes' Day", "2039-09-10": "Day of the Namibian Women and International Human Rights Day", "2039-12-25": "Christmas Day", @@ -660,6 +676,7 @@ "2040-05-04": "Cassinga Day", "2040-05-10": "Ascension Day", "2040-05-25": "Africa Day", + "2040-05-28": "Genocide Remembrance Day", "2040-08-26": "Heroes' Day", "2040-08-27": "Heroes' Day (observed)", "2040-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -672,6 +689,7 @@ "2041-05-01": "Workers' Day", "2041-05-04": "Cassinga Day", "2041-05-25": "Africa Day", + "2041-05-28": "Genocide Remembrance Day", "2041-05-30": "Ascension Day", "2041-08-26": "Heroes' Day", "2041-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -687,6 +705,7 @@ "2042-05-15": "Ascension Day", "2042-05-25": "Africa Day", "2042-05-26": "Africa Day (observed)", + "2042-05-28": "Genocide Remembrance Day", "2042-08-26": "Heroes' Day", "2042-09-10": "Day of the Namibian Women and International Human Rights Day", "2042-12-25": "Christmas Day", @@ -699,6 +718,7 @@ "2043-05-04": "Cassinga Day", "2043-05-07": "Ascension Day", "2043-05-25": "Africa Day", + "2043-05-28": "Genocide Remembrance Day", "2043-08-26": "Heroes' Day", "2043-09-10": "Day of the Namibian Women and International Human Rights Day", "2043-12-25": "Christmas Day", @@ -712,6 +732,7 @@ "2044-05-04": "Cassinga Day", "2044-05-25": "Africa Day", "2044-05-26": "Ascension Day", + "2044-05-28": "Genocide Remembrance Day", "2044-08-26": "Heroes' Day", "2044-09-10": "Day of the Namibian Women and International Human Rights Day", "2044-12-25": "Christmas Day", @@ -725,6 +746,7 @@ "2045-05-04": "Cassinga Day", "2045-05-18": "Ascension Day", "2045-05-25": "Africa Day", + "2045-05-28": "Genocide Remembrance Day", "2045-08-26": "Heroes' Day", "2045-09-10": "Day of the Namibian Women and International Human Rights Day", "2045-09-11": "Day of the Namibian Women and International Human Rights Day (observed)", @@ -738,6 +760,7 @@ "2046-05-03": "Ascension Day", "2046-05-04": "Cassinga Day", "2046-05-25": "Africa Day", + "2046-05-28": "Genocide Remembrance Day", "2046-08-26": "Heroes' Day", "2046-08-27": "Heroes' Day (observed)", "2046-09-10": "Day of the Namibian Women and International Human Rights Day", @@ -751,6 +774,7 @@ "2047-05-04": "Cassinga Day", "2047-05-23": "Ascension Day", "2047-05-25": "Africa Day", + "2047-05-28": "Genocide Remembrance Day", "2047-08-26": "Heroes' Day", "2047-09-10": "Day of the Namibian Women and International Human Rights Day", "2047-12-25": "Christmas Day", @@ -763,6 +787,7 @@ "2048-05-04": "Cassinga Day", "2048-05-14": "Ascension Day", "2048-05-25": "Africa Day", + "2048-05-28": "Genocide Remembrance Day", "2048-08-26": "Heroes' Day", "2048-09-10": "Day of the Namibian Women and International Human Rights Day", "2048-12-25": "Christmas Day", @@ -776,6 +801,7 @@ "2049-05-04": "Cassinga Day", "2049-05-25": "Africa Day", "2049-05-27": "Ascension Day", + "2049-05-28": "Genocide Remembrance Day", "2049-08-26": "Heroes' Day", "2049-09-10": "Day of the Namibian Women and International Human Rights Day", "2049-12-25": "Christmas Day", @@ -790,6 +816,7 @@ "2050-05-04": "Cassinga Day", "2050-05-19": "Ascension Day", "2050-05-25": "Africa Day", + "2050-05-28": "Genocide Remembrance Day", "2050-08-26": "Heroes' Day", "2050-09-10": "Day of the Namibian Women and International Human Rights Day", "2050-12-25": "Christmas Day", diff --git a/tests/countries/test_namibia.py b/tests/countries/test_namibia.py index d6a3ef822d..155d91b6d9 100644 --- a/tests/countries/test_namibia.py +++ b/tests/countries/test_namibia.py @@ -19,80 +19,270 @@ class TestNamibia(CommonCountryTests, TestCase): @classmethod def setUpClass(cls): - super().setUpClass(Namibia, years=range(1990, 2050)) + years = range(1991, 2050) + super().setUpClass(Namibia, years=years, years_non_observed=years) def test_country_aliases(self): self.assertAliases(Namibia, NA, NAM) def test_no_holidays(self): - self.assertNoHolidays(Namibia(years=1989)) + self.assertNoHolidays(Namibia(years=1990)) def test_special_holidays(self): self.assertHoliday( + "1994-03-01", + "1994-12-07", + "1995-10-24", + "1997-09-26", + "1998-11-30", + "1999-11-30", "1999-12-31", "2000-01-03", + "2014-11-28", + "2015-11-27", + "2019-11-27", + "2020-11-25", + "2024-02-25", + "2024-11-27", + "2025-03-01", ) - def test_holidays(self): - for year in range(1990, 2050): - self.assertHoliday( - f"{year}-01-01", - f"{year}-03-21", - f"{year}-05-01", - f"{year}-05-04", - f"{year}-05-25", - f"{year}-08-26", - f"{year}-09-10", - f"{year}-12-25", - f"{year}-12-26", - ) - self.assertNoHolidayName( - "Day of the Namibian Women and International Human Rights Day", range(1990, 2005) + def test_new_years_day(self): + name = "New Year's Day" + self.assertHolidayName(name, (f"{year}-01-01" for year in range(1991, 2050))) + obs_dt = ( + "1995-01-02", + "2006-01-02", + "2012-01-02", + "2017-01-02", + "2023-01-02", ) - self.assertHolidayName( - "International Human Rights Day", (f"{year}-09-10" for year in range(1990, 2005)) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_independence_day(self): + name = "Independence Day" + self.assertHolidayName(name, (f"{year}-03-21" for year in range(1991, 2050))) + obs_dt = ( + "1993-03-22", + "1999-03-22", + "2004-03-22", + "2010-03-22", + "2021-03-22", ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) - def test_easter(self): - self.assertHoliday( - # Good Friday - "2018-03-30", - "2019-04-19", + def test_good_friday(self): + name = "Good Friday" + self.assertHolidayName( + name, "2020-04-10", "2021-04-02", "2022-04-15", - # Easter Monday - "2018-04-02", - "2019-04-22", + "2023-04-07", + "2024-03-29", + "2025-04-18", + ) + self.assertHolidayName(name, range(1991, 2050)) + + def test_easter_monday(self): + name = "Easter Monday" + self.assertHolidayName( + name, "2020-04-13", "2021-04-05", "2022-04-18", - # Ascension Day - "2018-05-10", - "2019-05-30", + "2023-04-10", + "2024-04-01", + "2025-04-21", + ) + self.assertHolidayName(name, range(1991, 2050)) + + def test_workers_day(self): + name = "Workers' Day" + self.assertHolidayName(name, (f"{year}-05-01" for year in range(1991, 2050))) + obs_dt = ( + "1994-05-02", + "2005-05-02", + "2011-05-02", + "2016-05-02", + "2022-05-02", + ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_cassinga_day(self): + name = "Cassinga Day" + self.assertHolidayName(name, (f"{year}-05-04" for year in range(1991, 2050))) + obs_dt = ( + "1997-05-05", + "2003-05-05", + "2008-05-05", + "2014-05-05", + "2025-05-05", + ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_africa_day(self): + name = "Africa Day" + self.assertHolidayName(name, (f"{year}-05-25" for year in range(1991, 2050))) + obs_dt = ( + "1997-05-26", + "2003-05-26", + "2008-05-26", + "2014-05-26", + "2025-05-26", + ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_genocide_remembrance_day(self): + name = "Genocide Remembrance Day" + self.assertHolidayName(name, (f"{year}-05-28" for year in range(2025, 2050))) + self.assertNoHolidayName(name, range(1991, 2025)) + + def test_ascension_day(self): + name = "Ascension Day" + self.assertHolidayName( + name, "2020-05-21", "2021-05-13", "2022-05-26", + "2023-05-18", + "2024-05-09", + "2025-05-29", ) + self.assertHolidayName(name, range(1991, 2050)) - def test_observed(self): - dt = ( - "2010-03-22", - "2010-12-27", - "2011-05-02", - "2012-01-02", + def test_heroes_day(self): + name = "Heroes' Day" + self.assertHolidayName(name, (f"{year}-08-26" for year in range(1991, 2050))) + obs_dt = ( + "2001-08-27", + "2007-08-27", "2012-08-27", - "2014-05-05", - "2014-05-26", - "2016-05-02", - "2017-01-02", - "2017-09-11", "2018-08-27", - "2021-03-22", - "2021-12-27", - "2022-05-02", - "2023-01-02", + ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_namibian_women_and_international_human_rights_day(self): + name_1 = "International Human Rights Day" + self.assertHolidayName(name_1, (f"{year}-09-10" for year in range(1991, 2005))) + self.assertNoHolidayName(name_1, range(2005, 2050)) + obs_dt = ( + "1995-09-11", + "2000-09-11", + ) + self.assertHolidayName(f"{name_1} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + name_2 = "Day of the Namibian Women and International Human Rights Day" + self.assertHolidayName(name_2, (f"{year}-09-10" for year in range(2005, 2050))) + self.assertNoHolidayName(name_2, range(1991, 2005)) + obs_dt = ( + "2006-09-11", + "2017-09-11", "2023-09-11", ) - self.assertHoliday(dt) - self.assertNoNonObservedHoliday(dt) + self.assertHolidayName(f"{name_2} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_christmas_day(self): + self.assertHolidayName("Christmas Day", (f"{year}-12-25" for year in range(1991, 2050))) + + def test_family_day(self): + name = "Family Day" + self.assertHolidayName(name, (f"{year}-12-26" for year in range(1991, 2050))) + obs_dt = ( + "1993-12-27", + "1999-12-27", + "2004-12-27", + "2010-12-27", + "2021-12-27", + ) + self.assertHolidayName(f"{name} (observed)", obs_dt) + self.assertNoNonObservedHoliday(obs_dt) + + def test_2024(self): + self.assertHolidays( + Namibia(years=2024), + ("2024-01-01", "New Year's Day"), + ("2024-02-25", "Burial ceremony of Dr. Hage Gottfried Geingob"), + ("2024-03-21", "Independence Day"), + ("2024-03-29", "Good Friday"), + ("2024-04-01", "Easter Monday"), + ("2024-05-01", "Workers' Day"), + ("2024-05-04", "Cassinga Day"), + ("2024-05-09", "Ascension Day"), + ("2024-05-25", "Africa Day"), + ("2024-08-26", "Heroes' Day"), + ("2024-09-10", "Day of the Namibian Women and International Human Rights Day"), + ("2024-11-27", "General Election Day"), + ("2024-12-25", "Christmas Day"), + ("2024-12-26", "Family Day"), + ) + + def test_l10n_default(self): + self.assertLocalizedHolidays( + ("2025-01-01", "New Year's Day"), + ("2025-03-01", "Burial ceremony of Dr. Sam Shafiishuna Nujoma"), + ("2025-03-21", "Independence Day"), + ("2025-04-18", "Good Friday"), + ("2025-04-21", "Easter Monday"), + ("2025-05-01", "Workers' Day"), + ("2025-05-04", "Cassinga Day"), + ("2025-05-05", "Cassinga Day (observed)"), + ("2025-05-25", "Africa Day"), + ("2025-05-26", "Africa Day (observed)"), + ("2025-05-28", "Genocide Remembrance Day"), + ("2025-05-29", "Ascension Day"), + ("2025-08-26", "Heroes' Day"), + ("2025-09-10", "Day of the Namibian Women and International Human Rights Day"), + ("2025-12-25", "Christmas Day"), + ("2025-12-26", "Family Day"), + ) + + def test_l10n_en_us(self): + self.assertLocalizedHolidays( + "en_US", + ("2025-01-01", "New Year's Day"), + ("2025-03-01", "Burial ceremony of Dr. Sam Shafiishuna Nujoma"), + ("2025-03-21", "Independence Day"), + ("2025-04-18", "Good Friday"), + ("2025-04-21", "Easter Monday"), + ("2025-05-01", "Workers' Day"), + ("2025-05-04", "Cassinga Day"), + ("2025-05-05", "Cassinga Day (observed)"), + ("2025-05-25", "Africa Day"), + ("2025-05-26", "Africa Day (observed)"), + ("2025-05-28", "Genocide Remembrance Day"), + ("2025-05-29", "Ascension Day"), + ("2025-08-26", "Heroes' Day"), + ("2025-09-10", "Day of the Namibian Women and International Human Rights Day"), + ("2025-12-25", "Christmas Day"), + ("2025-12-26", "Family Day"), + ) + + def test_l10n_uk(self): + self.assertLocalizedHolidays( + "uk", + ("2025-01-01", "Новий рік"), + ("2025-03-01", "Церемонія поховання Сема Шафіішуна Нуйоми"), + ("2025-03-21", "День незалежності"), + ("2025-04-18", "Страсна пʼятниця"), + ("2025-04-21", "Великодній понеділок"), + ("2025-05-01", "День трудящих"), + ("2025-05-04", "День Кассінги"), + ("2025-05-05", "День Кассінги (вихідний)"), + ("2025-05-25", "День Африки"), + ("2025-05-26", "День Африки (вихідний)"), + ("2025-05-28", "День памʼяті жертв геноциду"), + ("2025-05-29", "Вознесіння Господнє"), + ("2025-08-26", "День Героїв"), + ("2025-09-10", "День намібійських жінок та Міжнародний день прав людини"), + ("2025-12-25", "Різдво Христове"), + ("2025-12-26", "День родини"), + )