Skip to content

Commit

Permalink
Add Congo holidays (#2037)
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius authored Oct 4, 2024
1 parent 7c69ef0 commit 318aa36
Show file tree
Hide file tree
Showing 8 changed files with 919 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Available Countries
.. _ISO 639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _ISO 639-2 code: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

We currently support 153 country codes. The standard way to refer to a country
We currently support 154 country codes. The standard way to refer to a country
is by using its `ISO 3166-1 alpha-2 code`_, the same used for domain names, and
for a subdivision its `ISO 3166-2 code`_. Some countries have common or foreign
names or abbreviations as aliases for their subdivisions. These are defined in
Expand Down Expand Up @@ -345,6 +345,11 @@ All other default values are highlighted with bold:
-
- en_US, **es**, uk
-
* - Congo
- CG
-
- en_US, **fr**
-
* - Costa Rica
- CR
-
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from .chile import Chile, CL, CHL
from .china import China, CN, CHN
from .colombia import Colombia, CO, COL
from .congo import Congo, CG, COG
from .costa_rica import CostaRica, CR, CRI
from .croatia import Croatia, HR, HRV
from .cuba import Cuba, CU, CUB
Expand Down
82 changes: 82 additions & 0 deletions holidays/countries/congo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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)

from gettext import gettext as tr

from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase


class Congo(HolidayBase, ChristianHolidays, InternationalHolidays):
"""
References:
- Loi N° 2-94:
- http://mokili.free.fr/jours_feries.php
- Loi N° l8-20l0:
- https://www.finances.gouv.cg/sites/default/files/documents/n¯18-2010%20du%2027%20novembre%202010.PDF
Cross-Checked With:
- https://en.wikipedia.org/wiki/Public_holidays_in_the_Republic_of_the_Congo
"""

country = "CG"
default_language = "fr"
supported_languages = ("en_US", "fr")

def __init__(self, *args, **kwargs) -> None:
ChristianHolidays.__init__(self)
InternationalHolidays.__init__(self)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
# Loi N° 2-94 of 1 March 1994
if self._year <= 1993:
return None

# New Year's Day.
self._add_new_years_day(tr("Jour de l'An"))

# Easter Monday.
self._add_easter_monday(tr("Lundi de Pâques"))

# Labor Day.
self._add_labor_day(tr("Fête du Travail"))

# Ascension Day.
self._add_ascension_thursday(tr("Ascension"))

# Whit Monday.
self._add_whit_monday(tr("Lundi de Pentecôte"))

# Reconciliation Day.
self._add_holiday_jun_10(tr("Fête de la Réconciliation"))

# National Day.
self._add_holiday_aug_15(tr("Fête Nationale"))

# All Saints' Day.
self._add_all_saints_day(tr("Toussaint"))

if self._year >= 2010:
# Republic Day.
self._add_holiday_nov_28(tr("Jour de la République"))

# Christmas Day.
self._add_christmas_day(tr("Noël"))


class CG(Congo):
pass


class COG(Congo):
pass
67 changes: 67 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/CG.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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)
#
# Congo holidays en_US localization.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.58\n"
"POT-Creation-Date: 2024-10-04 18:14+0700\n"
"PO-Revision-Date: 2024-10-04 18:17+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python 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.3\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Jour de l'An"
msgstr "New Year's Day"

#. Easter Monday.
msgid "Lundi de Pâques"
msgstr "Easter Monday"

#. Labor Day.
msgid "Fête du Travail"
msgstr "Labor Day"

#. Ascension Day.
msgid "Ascension"
msgstr "Ascension Day"

#. Whit Monday.
msgid "Lundi de Pentecôte"
msgstr "Whit Monday"

#. Reconciliation Day.
msgid "Fête de la Réconciliation"
msgstr "Reconciliation Day"

#. National Day.
msgid "Fête Nationale"
msgstr "National Day"

#. All Saints' Day.
msgid "Toussaint"
msgstr "All Saints' Day"

#. Republic Day.
msgid "Jour de la République"
msgstr "Republic Day"

#. Christmas Day.
msgid "Noël"
msgstr "Christmas Day"
67 changes: 67 additions & 0 deletions holidays/locale/fr/LC_MESSAGES/CG.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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)
#
# Congo holidays.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.58\n"
"POT-Creation-Date: 2024-10-04 18:14+0700\n"
"PO-Revision-Date: 2024-10-04 18:17+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Localization Team\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Lingva 5.0.3\n"
"X-Generator: Poedit 3.5\n"

#. New Year's Day.
msgid "Jour de l'An"
msgstr ""

#. Easter Monday.
msgid "Lundi de Pâques"
msgstr ""

#. Labor Day.
msgid "Fête du Travail"
msgstr ""

#. Ascension Day.
msgid "Ascension"
msgstr ""

#. Whit Monday.
msgid "Lundi de Pentecôte"
msgstr ""

#. Reconciliation Day.
msgid "Fête de la Réconciliation"
msgstr ""

#. National Day.
msgid "Fête Nationale"
msgstr ""

#. All Saints' Day.
msgid "Toussaint"
msgstr ""

#. Republic Day.
msgid "Jour de la République"
msgstr ""

#. Christmas Day.
msgid "Noël"
msgstr ""
1 change: 1 addition & 0 deletions holidays/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"chile": ("Chile", "CL", "CHL"),
"china": ("China", "CN", "CHN"),
"colombia": ("Colombia", "CO", "COL"),
"congo": ("Congo", "CG", "COG"),
"costa_rica": ("CostaRica", "CR", "CRI"),
"croatia": ("Croatia", "HR", "HRV"),
"cuba": ("Cuba", "CU", "CUB"),
Expand Down
Loading

0 comments on commit 318aa36

Please sign in to comment.