diff --git a/README.rst b/README.rst index c6bc670d7..374cd23d1 100644 --- a/README.rst +++ b/README.rst @@ -109,7 +109,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 129 country codes. The standard way to refer to a country +We currently support 130 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 of the countries support more than one language for holiday names output. @@ -229,6 +229,10 @@ The list of supported countries, their subdivisions and supported languages - BI - - + * - Cambodia + - KH + - + - en_US, **km**, th * - Cameroon - CM - diff --git a/holidays/calendars/__init__.py b/holidays/calendars/__init__.py index f67f16d76..a783db160 100644 --- a/holidays/calendars/__init__.py +++ b/holidays/calendars/__init__.py @@ -24,6 +24,8 @@ GREGORIAN_CALENDAR = "GREGORIAN_CALENDAR" JULIAN_CALENDAR = "JULIAN_CALENDAR" +KHMER_CALENDAR = "KHMER_CALENDAR" +THAI_CALENDAR = "THAI_CALENDAR" def _get_nth_weekday_from(n: int, weekday: int, from_dt: date) -> date: diff --git a/holidays/calendars/thai.py b/holidays/calendars/thai.py index d1abbf014..d1e45d5cd 100644 --- a/holidays/calendars/thai.py +++ b/holidays/calendars/thai.py @@ -14,6 +14,10 @@ from functools import lru_cache from typing import Optional +# Manual Assign to avoid circular import +KHMER_CALENDAR = "KHMER_CALENDAR" +THAI_CALENDAR = "THAI_CALENDAR" + class _ThaiLunisolar: """ @@ -25,7 +29,7 @@ class _ThaiLunisolar: 3-year types for calendar intercalation: - Pakatimat (Normal Year): consist of 12 months, has 354 days. - - Athikawan (Extra-Day Year): a + - Athikawan (Extra-Day Year): add a day to the 7th month of the year, has 355 days for the synodic month correction. - Athikamat (Extra-Month Year): @@ -41,27 +45,40 @@ class _ThaiLunisolar: the usual calendar by 1 month. List of public holidays dependent on the Thai Lunar Calendar: - - Magha Puja/Makha Bucha: + - Magha Puja/Makha Bucha/Meak Bochea: 15th Waxing Day (Full Moon) of Month 3 (On Month 4 for Athikamat Years). - - Royal Ploughing Ceremony: + KHMER_CALENDAR always fall on Month 3. + - Vesak/Visakha Bucha/Visaka Bochea: + 15th Waxing Day (Full Moon) of Month 6 + (On Month 7 for Athikamat Years). + KHMER_CALENDAR always fall on Month 6. + - Thai Royal Ploughing Ceremony/Raeknakhwan: Based on this, though Court Astrologer picks the auspicious dates, which sadly don't fall into a predictable pattern; see its specific section below. - - Vesak/Visakha Bucha: - 15th Waxing Day (Full Moon) of Month 6 + - Cambodian Royal Ploughing Ceremony/Preah Neangkol: + 4th Waning Day of Month 6 (On Month 7 for Athikamat Years). + This defaults to KHMER_CALENDAR (its sole user). - Asalha Puja/Asarnha Bucha: 15th Waxing Day (Full Moon) of Month 8 (On Month 8/8 for Athikamat Years). + KHMER_CALENDAR always fall on Month 8. - Buddhist Lent Day/Wan Khao Phansa: 1st Waning Day of Month 8 (On Month 8/8 for Athikamat Years). + KHMER_CALENDAR always fall on Month 8. + - Pchum Ben/Prachum Bandar: + 15th Waning Day (New Moon) of Month 10. + - Loy Krathong/Boun That Louang/Bon Om Touk: + 15th Waxing Day (Full Moon) of Month 12. Other Buddhist date on Thai Lunar Calendar: - Buddha's Cremation Day/Atthami Bucha 8th Waning Day of Month 6 (On Month 7 for Athikamat Years). + KHMER_CALENDAR always fall on Month 6 - End of Buddhist Lent Day/Ok Phansa: 15th Waxing Day (Full Moon) of Month 11 @@ -167,6 +184,29 @@ class _ThaiLunisolar: START_YEAR = 1941 END_YEAR = 2057 + def __init__(self, calendar=THAI_CALENDAR) -> None: + self.__verify_calendar(calendar) + self.__calendar = calendar + + @staticmethod + def __is_khmer_calendar(calendar): + """ + Return True if `calendar` is Khmer calendar. + Return False otherwise. + """ + return calendar == KHMER_CALENDAR + + @staticmethod + def __verify_calendar(calendar): + """ + Verify calendar type. + """ + if calendar not in {KHMER_CALENDAR, THAI_CALENDAR}: + raise ValueError( + f"Unknown calendar name: {calendar}. " + "Use `KHMER_CALENDAR` or `THAI_CALENDAR`." + ) + @lru_cache() def _get_start_date(self, year: int) -> Optional[date]: """ @@ -198,14 +238,16 @@ def _get_start_date(self, year: int) -> Optional[date]: iter_start_year += 1 return iter_start_date - def makha_bucha_date(self, year: int) -> Optional[date]: + def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]: """ Calculate the estimated Gregorian date of Makha Bucha. - If the Gregorian year input is invalud, this will outputs None instead. + If the Gregorian year input is invalid, this will outputs None instead. - Also known as "Magha Puja". This concides with - the 15th Waxing Day of Month 3 in Thai Lunar Calendar, - or Month 4 in Athikamat years. + Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea". + This concides with the 15th Waxing Day of Month 3 + in Thai Lunar Calendar, or Month 4 in Athikamat years. + + KHMER_CALENDAR will always use Month 3 regardless of year type. To calculate, we use use the following time delta: - Athikamat: 15th Waxing Day of Month 4 @@ -218,30 +260,41 @@ def makha_bucha_date(self, year: int) -> Optional[date]: :param year: The Gregorian year. + :param calendar: + Calendar type, this defaults to THAI_CALENDAR. + :return: Estimated Gregorian date of Makha Bucha. """ + calendar = calendar or self.__calendar + self.__verify_calendar(calendar) + start_date = self._get_start_date(year) if not start_date: return None return start_date + td( days=+102 - if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + if ( + year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + and not self.__is_khmer_calendar(calendar) + ) else +73 ) - def visakha_bucha_date(self, year: int) -> Optional[date]: + def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]: """ Calculate the estimated Gregorian date of Visakha Bucha. - If the Gregorian year input is invalud, this will outputs None instead. + If the Gregorian year input is invalid, this will outputs None instead. Also known as "Vesak" and "Buddha Day". This concides with the 15th Waxing Day of Month 6 in Thai Lunar Calendar, or Month 7 in Athikamat years. + KHMER_CALENDAR will always use Month 6 regardless of year type. + To calculate, we use use the following time delta: - - Athikamat: 15th Waxing Day of Month 6 + - Athikamat: 15th Waxing Day of Month 7 or 177[1-6] + 15[7] -1 = 191 - Athikawan: 15th Waxing Day of Month 6 or 147[1-5] + 15[6] -1 = 161 @@ -251,28 +304,68 @@ def visakha_bucha_date(self, year: int) -> Optional[date]: :param year: The Gregorian year. + :param calendar: + Calendar type, this defaults to THAI_CALENDAR. + :return: Estimated Gregorian date of Visakha Bucha. """ + calendar = calendar or self.__calendar + self.__verify_calendar(calendar) + start_date = self._get_start_date(year) if not start_date: return None return start_date + td( days=+191 - if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + if ( + year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + and not self.__is_khmer_calendar(calendar) + ) else +161 ) - def atthami_bucha_date(self, year: int) -> Optional[date]: + def preah_neangkoal_date(self, year: int) -> Optional[date]: + """ + Calculate the estimated Gregorian date of Preah Neangkoal. + If the Gregorian year input is invalid, this will outputs None instead. + + Also known as "Cambodian Royal Ploughing Ceremony". This always + concides with the 4th Waning Day of Month 6 in Khmer Lunar Calendar. + + To calculate, we use use the following time delta: + - Athikamat: 15th Waxing Day of Month 6 + or 177[1-6] + 19[7] -1 = 165 + - Athikawan: 15th Waxing Day of Month 6 + or 147[1-5] + 19[6] -1 = 165 + - Pakatimat: 15th Waxing Day of Month 6 + or 147[1-5] + 19[6] -1 = 165 + Or as in simpler terms: "Visakha Bucha" +4 + + :param year: + The Gregorian year. + + :return: + Estimated Gregorian date of Preah Neangkoal. + """ + start_date = self._get_start_date(year) + if not start_date: + return None + + return start_date + td(days=+165) + + def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]: """ Calculate the estimated Gregorian date of Atthami Bucha. - If the Gregorian year input is invalud, this will outputs None instead. + If the Gregorian year input is invalid, this will outputs None instead. Also known as "Buddha's Cremation Day". This concides with the 8th Waning Day of Month 6 in Thai Lunar Calendar, or Month 7 in Athikamat years. + KHMER_CALENDAR will always use Month 6 regardless of year type. + To calculate, we use use the following time delta: - Athikamat: 8th Waning Day of Month 7 or 177[1-6] + 23[7] -1 = 199 @@ -285,28 +378,39 @@ def atthami_bucha_date(self, year: int) -> Optional[date]: :param year: The Gregorian year. + :param calendar: + Calendar type, this defaults to THAI_CALENDAR. + :return: Estimated Gregorian date of Atthami Bucha. """ + calendar = calendar or self.__calendar + self.__verify_calendar(calendar) + start_date = self._get_start_date(year) if not start_date: return None return start_date + td( days=+199 - if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + if ( + year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + and not self.__is_khmer_calendar(calendar) + ) else +169 ) - def asarnha_bucha_date(self, year: int) -> Optional[date]: + def asarnha_bucha_date(self, year: int, calendar=None) -> Optional[date]: """ Calculate the estimated Gregorian date of Asarnha Bucha. - If the Gregorian year input is invalud, this will outputs None instead. + If the Gregorian year input is invalid, this will outputs None instead. Also known as "Asalha Puja". This concides with the 15th Waxing Day of Month 8 in Thai Lunar Calendar, or Month 8.8 in Athikamat years. + KHMER_CALENDAR will always use Month 8 regardless of year type. + To calculate, we use use the following time delta: - Athikamat: 15th Waxing Day of Month 8/8 or 177[1-6] + 29[7] + 30[8] + 15[8.8] -1 = 250 @@ -318,14 +422,23 @@ def asarnha_bucha_date(self, year: int) -> Optional[date]: :param year: The Gregorian year. + :param calendar: + Calendar type, this defaults to THAI_CALENDAR. + :return: Estimated Gregorian date of Asarnha Bucha. """ + calendar = calendar or self.__calendar + self.__verify_calendar(calendar) + start_date = self._get_start_date(year) if not start_date: return None - if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN: + if ( + year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + and not self.__is_khmer_calendar(calendar) + ): delta_days = 250 elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN: delta_days = 221 @@ -333,15 +446,17 @@ def asarnha_bucha_date(self, year: int) -> Optional[date]: delta_days = 220 return start_date + td(days=delta_days) - def khao_phansa_date(self, year: int) -> Optional[date]: + def khao_phansa_date(self, year: int, calendar=None) -> Optional[date]: """ Calculate the estimated Gregorian date of Khao Phansa. - If the Gregorian year input is invalud, this will outputs None instead. + If the Gregorian year input is invalid, this will outputs None instead. Also known as "(Start of) Buddhist Lent" and "Start of Vassa". This concides with the 1st Waning Day of Month 8 in Thai Lunar Calendar, or Month 8.8 in Athikamat years. + KHMER_CALENDAR will always use Month 8 regardless of year type. + To calculate, we use use the following time delta: - Athikamat: 1st Waning Day of Month 8.8 or 177[1-6] + 29[7] + 30[8] + 16[8.8] -1 = 251 @@ -354,14 +469,23 @@ def khao_phansa_date(self, year: int) -> Optional[date]: :param year: The Gregorian year. + :param calendar: + Calendar type, this defaults to THAI_CALENDAR. + :return: Estimated Gregorian date of Khao Phansa. """ + calendar = calendar or self.__calendar + self.__verify_calendar(calendar) + start_date = self._get_start_date(year) if not start_date: return None - if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN: + if ( + year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN + and not self.__is_khmer_calendar(calendar) + ): delta_days = 251 elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN: delta_days = 222 @@ -369,10 +493,45 @@ def khao_phansa_date(self, year: int) -> Optional[date]: delta_days = 221 return start_date + td(days=delta_days) + def pchum_ben_date(self, year: int) -> Optional[date]: + """ + Calculate the estimated Gregorian date of Pchum Ben. + If the Gregorian year input is invalid, this will outputs None instead. + + Also known as "Prachum Bandar". + This concides with the 15th Waning Day of Month 10 in + Thai Lunar Calendar. + + To calculate, we use use the following time delta: + - Athikamat: 15th Waning Day of Month 10 + or 265[1-9] + 30[8.8] + 30[10] -1 = 324 + - Athikawan: 15th Waning Day of Month 10 + or 265[1-9] + 1[7] + 30[10] -1 = 295 + - Pakatimat: 15th Waning Day of Month 10 + or 265[1-9] + 30[10] -1 = 294 + + :param year: + The Gregorian year. + + :return: + Estimated Gregorian date of Pchum Ben. + """ + start_date = self._get_start_date(year) + if not start_date: + return None + + if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN: + delta_days = 324 + elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN: + delta_days = 295 + else: + delta_days = 294 + return start_date + td(days=delta_days) + def ok_phansa_date(self, year: int) -> Optional[date]: """ - Calculate the estimated Gregorian date of Ok Phansa - If the Gregorian year input is invalud, this will outputs None instead. + Calculate the estimated Gregorian date of Ok Phansa. + If the Gregorian year input is invalid, this will outputs None instead. Also known as "End of Buddhist Lent" and "End of Vassa". This concides with the 15th Waxing Day of Month 11 @@ -403,3 +562,38 @@ def ok_phansa_date(self, year: int) -> Optional[date]: else: delta_days = 309 return start_date + td(days=delta_days) + + def loy_krathong_date(self, year: int) -> Optional[date]: + """ + Calculate the estimated Gregorian date of Loy Krathong. + If the Gregorian year input is invalid, this will outputs None instead. + + Also known as "Boun That Louang" and "Bon Om Touk". + This concides with the 15th Waxing Day of Month 12 + in Thai Lunar Calendar. + + To calculate, we use use the following time delta: + - Athikamat: 15th Waxing Day of Month 12 + or 324[1-11] + 30[8.8] + 15[11] -1 = 368 + - Athikawan: 15th Waxing Day of Month 12 + or 324[1-11] + 1[7] + 15[11] -1 = 339 + - Pakatimat: 15th Waxing Day of Month 12 + or 324[1-11] + 15[11] -1 = 338 + + :param year: + The Gregorian year. + + :return: + Estimated Gregorian date of Loy Krathong. + """ + start_date = self._get_start_date(year) + if not start_date: + return None + + if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN: + delta_days = 368 + elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN: + delta_days = 339 + else: + delta_days = 338 + return start_date + td(days=delta_days) diff --git a/holidays/countries/__init__.py b/holidays/countries/__init__.py index aa860a45e..b360bcf4c 100644 --- a/holidays/countries/__init__.py +++ b/holidays/countries/__init__.py @@ -33,6 +33,7 @@ from .bulgaria import Bulgaria, BG, BLG from .burkina_faso import BurkinaFaso, BF, BFA from .burundi import Burundi, BI, BDI +from .cambodia import Cambodia, KH, KHM from .cameroon import Cameroon, CM, CMR from .canada import Canada, CA, CAN from .chad import Chad, TD, TCD diff --git a/holidays/countries/cambodia.py b/holidays/countries/cambodia.py new file mode 100644 index 000000000..0ae18c861 --- /dev/null +++ b/holidays/countries/cambodia.py @@ -0,0 +1,325 @@ +# python-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: dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/dr-prodigy/python-holidays +# License: MIT (see LICENSE file) + +from datetime import timedelta as td +from gettext import gettext as tr + +from holidays.calendars import KHMER_CALENDAR +from holidays.constants import JAN, APR, MAY, JUN, AUG, SEP, OCT, NOV, DEC +from holidays.holiday_base import HolidayBase +from holidays.holiday_groups import InternationalHolidays, ThaiCalendarHolidays + + +class Cambodia(HolidayBase, InternationalHolidays, ThaiCalendarHolidays): + """ + A subclass of :py:class:`HolidayBase` representing public holidays + in Cambodia. + + References: + + - Based on: https://www.nbc.gov.kh/english/news_and_events/official_holiday.php + https://www.nbc.gov.kh/news_and_events/official_holiday.php + https://en.wikipedia.org/wiki/Public_holidays_in_Cambodia + + - Checked with: https://asean.org/wp-content/uploads/2021/12/ASEAN-National-Holidays-2022.pdf # noqa: E501 + https://asean.org/wp-content/uploads/2022/12/ASEAN-Public-Holidays-2023.pdf # noqa: E501 + https://www.timeanddate.com/holidays/cambodia/ + + Limitations: + + - Cambodian holidays only works from 1993 onwards. + + - Exact Public Holidays as per Cambodia's Official Gazette are only + available from 2015 onwards. + + - Cambodian Lunar Calendar Holidays only work from 1941 (B.E. 2485) onwards + until 2057 (B.E. 2601) as we only have Thai year-type data for + cross-checking until then for Cambodian Buddhist Holidays. + + + Country created by: `PPsyrius `__ + + Country maintained by: `PPsyrius `__ + """ + + country = "KH" + default_language = "km" + + # Special Cases. + + sangkranta_in_lieu_covid = tr( + # Khmer New Year's Replacement Holiday + "ថ្ងៃឈប់សម្រាកសងជំនួសឲ្យពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" + ) + # Special Public Holiday + special_in_lieu_holidays = tr("ថ្ងៃឈប់សម្រាកសងជំនួស") + + special_holidays = { + 2016: ( + (MAY, 2, special_in_lieu_holidays), + (MAY, 16, special_in_lieu_holidays), + ), + 2018: (MAY, 21, special_in_lieu_holidays), + 2019: (SEP, 30, special_in_lieu_holidays), + 2020: ( + (MAY, 11, special_in_lieu_holidays), + (AUG, 17, sangkranta_in_lieu_covid), + (AUG, 18, sangkranta_in_lieu_covid), + (AUG, 19, sangkranta_in_lieu_covid), + (AUG, 20, sangkranta_in_lieu_covid), + (AUG, 21, sangkranta_in_lieu_covid), + ), + } + supported_languages = ("en_US", "km", "th") + + def __init__(self, *args, **kwargs): + InternationalHolidays.__init__(self) + ThaiCalendarHolidays.__init__(self, KHMER_CALENDAR) + super().__init__(*args, **kwargs) + + def _populate(self, year): + # Available post-Independence from 1993 afterwards + if year <= 1992: + return None + + super()._populate(year) + + # Fixed Holidays + + # ទិវាចូលឆ្នាំសាកល + # Status: In-Use. + + # International New Year Day. + self._add_new_years_day(tr("ទិវាចូលឆ្នាំសាកល")) + + # ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍ + # Status: In-Use. + # Commemorates the end of the Khmer Rouge regime in 1979 + + # Day of Victory over the Genocidal Regime. + self._add_holiday(tr("ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍"), JAN, 7) + + # ទិវាអន្តរជាតិនារី + # Status: In-Use. + + # International Women's Rights Day + self._add_womens_day(tr("ទិវាអន្តរជាតិនារី")) + + # ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ + # Status: In-Use. + # Usually falls on April 13th except for 2017-2018 and 2021-2023 + # for years 2001-2050. + + if year != 2020: + # Khmer New Year's Day + sangkranta = tr("ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ") + sangkranta_years_apr14 = {2017, 2018, 2021, 2022, 2023} + dt = self._add_holiday( + sangkranta, APR, 14 if year in sangkranta_years_apr14 else 13 + ) + self._add_holiday(sangkranta, dt + td(days=+1)) + self._add_holiday(sangkranta, dt + td(days=+2)) + + # ទិវាពលកម្មអន្តរជាតិ + # Status: In-Use. + + # International Labor Day + self._add_labor_day(tr("ទិវាពលកម្មអន្តរជាតិ")) + + # ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ + # នរោត្តម សីហមុនី + # Status: In-Use. + # Assumed to start in 2005. Was celebrated for 3 days until 2020. + + if year >= 2005: + king_sihamoni_bday = tr( + # Birthday of His Majesty Preah Bat Samdech Preah Boromneath + # NORODOM SIHAMONI, King of Cambodia + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី" + ) + dt = self._add_holiday(king_sihamoni_bday, MAY, 14) + if year <= 2019: + self._add_holiday(king_sihamoni_bday, MAY, 13) + self._add_holiday(king_sihamoni_bday, MAY, 15) + + # ទិវាជាតិនៃការចងចាំ + # Status: Defunct. + # Active between 2018-2019 as Public Holiday. + # Was ទិវាចងកំហឹង (National Day of Anger) between 1983-2000. + # Its celebration was put onhold by UN administration with + # its name changed to present one in 2001. + + if 2018 <= year <= 2019: + # National Day of Remembrance + self._add_holiday(tr("ទិវាជាតិនៃការចងចាំ"), MAY, 20) + + # ទិវាកុមារអន្តរជាតិ + # Status: Defunct. + # Assumed to start in 1993, defunct from 2020 onwards. + + if year <= 2019: + # International Children Day + self._add_childrens_day(tr("ទិវាកុមារអន្តរជាតិ")) + + # ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា + # នរោត្តម មុនិនាថ​ សីហនុ + # Status: In-Use. + # Assumed to start in 1994. A public holiday since 2015 at least. + + if year >= 1994: + self._add_holiday( + # Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH + # SIHANOUK of Cambodia + tr( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី " + "ព្រះវររាជមាតា នរោត្តម មុនិនាថ​ សីហនុ" + ), + JUN, + 18, + ) + + # ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ + # Status: In-Use. + # Starts in 1993 + + # Constitution Day + self._add_holiday(tr("ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ"), SEP, 24) + + # ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា ព្រះបាទសម្តេចព្រះ + # នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី + # និងឯកភាពជាតិខ្មែរ ព្រះបរមរតនកោដ្ឋ + # Status: In-Use. + # Starts in 2012. + + if year >= 2012: + self._add_holiday( + # Mourning Day of the Late King-Father + # NORODOM SIHANOUK of Cambodia + tr( + "ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះ នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ " + "ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " + "ព្រះបរមរតនកោដ្ឋ" + ), + OCT, + 15, + ) + + # ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស + # Status: Defunct. + # Assumed to start in 1993, defunct from 2020 onwards. + + if year <= 2019: + self._add_holiday( + # Paris Peace Agreement's Day + tr("ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស"), + OCT, + 23, + ) + + # ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា + # ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី + # ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា + # Status: In-Use. + # Starts in 2004. + + if year >= 2004: + self._add_holiday( + # Coronation Day of His Majesty Preah Bat Samdech Preah + # Boromneath NORODOM SIHAMONI, King of Cambodia + tr( + "ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី " + "ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" + ), + OCT, + 29, + ) + + # ពិធីបុណ្យឯករាជ្យជាតិ + # Status: In-Use. + # Starts in 1953 + + # National Independence Day + self._add_holiday(tr("ពិធីបុណ្យឯករាជ្យជាតិ"), NOV, 9) + + # ទិវាសិទ្ធិមនុស្សអន្តរជាតិ + # Status: Defunct. + # Assumed to start in 1993, defunct from 2020 onwards. + + if year <= 2019: + # International Human Rights Day + self._add_holiday(tr("ទិវាសិទ្ធិមនុស្សអន្តរជាតិ"), DEC, 10) + + # Cambodian Lunar Calendar Holidays + # See `_ThaiLunisolar` in holidays/utils.py for more details. + # Cambodian Lunar Calendar Holidays only work from 1941 to 2057. + + # ពិធីបុណ្យមាឃបូជា + # Status: Defunct. + # 15th Waxing Day of Month 3. + # Defunct from 2020 onwards. + + if year <= 2019: + # Meak Bochea Day + self._add_makha_bucha(tr("ពិធីបុណ្យមាឃបូជា")) + + # ពិធីបុណ្យវិសាខបូជា + # Status: In-Use. + # 15th Waxing Day of Month 6. + # This utilizes Thai calendar as a base, though are calculated to + # always happen in the Traditional Visakhamas month (May). + + # Visaka Bochea Day + self._add_visakha_bucha(tr("ពិធីបុណ្យវិសាខបូជា")) + + # ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល + # Status: In-Use. + # 4th Waning Day of Month 6. + # Unlike Thai ones, Cambodian Royal Ploughing Ceremony is always fixed. + + # Royal Ploughing Ceremony + self._add_preah_neangkoal(tr("ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល")) + + # ពិធីបុណ្យភ្ផុំបិណ្ឌ + # Status: In-Use. + # 14th Waning Day of Month 10 - 1st Waxing Day of Month 11. + # The 3rd day is added as a public holiday from 2017 onwards. + + # Pchum Ben Day + pchum_ben = tr("ពិធីបុណ្យភ្ផុំបិណ្ឌ") + pchum_ben_date = self._add_pchum_ben(pchum_ben) + if pchum_ben_date: + self._add_holiday(pchum_ben, pchum_ben_date + td(days=-1)) + if year >= 2017: + self._add_holiday(pchum_ben, pchum_ben_date + td(days=+1)) + + # ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក + # Status: In-Use. + # 14th Waxing Day of Month 12 - 1st Waning Day of Month 12. + + bon_om_touk = tr( + # Water Festival + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" + ) + bon_om_touk_date = self._add_loy_krathong(bon_om_touk) + if bon_om_touk_date: + self._add_holiday(bon_om_touk, bon_om_touk_date + td(days=-1)) + self._add_holiday(bon_om_touk, bon_om_touk_date + td(days=+1)) + + +class KH(Cambodia): + pass + + +class KHM(Cambodia): + pass diff --git a/holidays/countries/thailand.py b/holidays/countries/thailand.py index ad72d08ef..42c032591 100644 --- a/holidays/countries/thailand.py +++ b/holidays/countries/thailand.py @@ -13,19 +13,17 @@ from datetime import timedelta as td from gettext import gettext as tr -from holidays.calendars import _ThaiLunisolar from holidays.constants import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP from holidays.constants import OCT, NOV, DEC from holidays.holiday_base import HolidayBase -from holidays.holiday_groups import InternationalHolidays +from holidays.holiday_groups import InternationalHolidays, ThaiCalendarHolidays -class Thailand(HolidayBase, InternationalHolidays): +class Thailand(HolidayBase, InternationalHolidays, ThaiCalendarHolidays): """ A subclass of :py:class:`HolidayBase` representing public holidays in Thailand. (Based on South Korean and Singaporean Implementation) - References: - Based on: https://en.wikipedia.org/wiki/Public_holidays_in_Thailand @@ -252,7 +250,7 @@ class Thailand(HolidayBase, InternationalHolidays): def __init__(self, **kwargs) -> None: InternationalHolidays.__init__(self) - self.thls = _ThaiLunisolar() + ThaiCalendarHolidays.__init__(self) super().__init__(**kwargs) def _populate(self, year): @@ -573,50 +571,38 @@ def _add_observed(dt: date) -> None: self._add_new_years_eve(tr("วันสิ้นปี")) # Thai Lunar Calendar Holidays + # See `_ThaiLunisolar` in holidays/utils.py for more details. + # Thai Lunar Calendar Holidays only work from 1941 to 2057. - """ - See `_ThaiLunisolar` in holidays/utils.py for more details. - - Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards - until 2057 (B.E. 2600). - """ # Makha Bucha. # วันมาฆบูชา # Status: In-Use. - makha_bucha_date = self.thls.makha_bucha_date(year) + makha_bucha_date = self._add_makha_bucha(tr("วันมาฆบูชา")) if makha_bucha_date: - _add_observed( - self._add_holiday(tr("วันมาฆบูชา"), makha_bucha_date) - ) + _add_observed(makha_bucha_date) # Visakha Bucha. # วันวิสาขบูชา # Status: In-Use. - visakha_bucha_date = self.thls.visakha_bucha_date(year) + visakha_bucha_date = self._add_visakha_bucha(tr("วันวิสาขบูชา")) if visakha_bucha_date: - _add_observed( - self._add_holiday(tr("วันวิสาขบูชา"), visakha_bucha_date) - ) + _add_observed(visakha_bucha_date) # Asarnha Bucha. # วันอาสาฬหบูชา # Status: In-Use. # This has its own in-lieu trigger. - asarnha_bucha_date = self.thls.asarnha_bucha_date(year) - if asarnha_bucha_date: - self._add_holiday(tr("วันอาสาฬหบูชา"), asarnha_bucha_date) + asarnha_bucha_date = self._add_asarnha_bucha(tr("วันอาสาฬหบูชา")) # Buddhist Lent Day. # วันเข้าพรรษา # Status: In-Use. # This has its own in-lieu trigger. - khao_phansa_date = self.thls.khao_phansa_date(year) - if khao_phansa_date: - self._add_holiday(tr("วันเข้าพรรษา"), khao_phansa_date) + self._add_khao_phansa(tr("วันเข้าพรรษา")) # Asarnha Bucha/Buddhist Lent Day (in lieu). # วันหยุดชดเชยวันอาสาฬหบูชา diff --git a/holidays/groups/__init__.py b/holidays/groups/__init__.py index bdf7cff5a..d4b3e10b1 100644 --- a/holidays/groups/__init__.py +++ b/holidays/groups/__init__.py @@ -15,3 +15,4 @@ from holidays.groups.hindu import HinduCalendarHolidays from holidays.groups.international import InternationalHolidays from holidays.groups.islamic import IslamicHolidays +from holidays.groups.thai import ThaiCalendarHolidays diff --git a/holidays/groups/thai.py b/holidays/groups/thai.py new file mode 100644 index 000000000..7c1fad0de --- /dev/null +++ b/holidays/groups/thai.py @@ -0,0 +1,157 @@ +# python-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: dr-prodigy (c) 2017-2022 +# ryanss (c) 2014-2017 +# Website: https://github.com/dr-prodigy/python-holidays +# License: MIT (see LICENSE file) + +from datetime import date +from typing import Optional + +from holidays.calendars import _ThaiLunisolar, THAI_CALENDAR + + +class ThaiCalendarHolidays: + """ + Thai lunisolar calendar holidays. + + For more info, see class `_ThaiLunisolar`. + Calendar-type checking are done by `_ThaiLunisolar`. + """ + + def __init__(self, calendar=THAI_CALENDAR) -> None: + self.__calendar = calendar + self._thai_calendar = _ThaiLunisolar(calendar) + + def _add_asarnha_bucha(self, name, calendar=None) -> Optional[date]: + """ + Add Asarnha Bucha. + + Asalha Pūjā (also written as Asarnha Bucha Day) is a Buddhist festival + celebrated on the 15th Waxing Day (Full Moon) of Month 8. + + Khmer variant: always fall on Month 8. + Thai variant: will use Month 8.8 instead for Athikamat years. + + https://en.wikipedia.org/wiki/Asalha_Puja + """ + calendar = calendar or self.__calendar + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.asarnha_bucha_date(self._year, calendar) + ) + + def _add_khao_phansa(self, name, calendar=None) -> Optional[date]: + """ + Add Khao Phansa. + + Start of Buddhist Lent (also written as Khao Phansa Day) is a Buddhist + festival celebrated on the 1st Waning Day of Month 8. + + Khmer variant: always fall on Month 8. + Thai variant: will use Month 8.8 instead for Athikamat years. + + https://en.wikipedia.org/wiki/Vassa + """ + calendar = calendar or self.__calendar + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.khao_phansa_date(self._year, calendar) + ) + + def _add_loy_krathong(self, name) -> Optional[date]: + """ + Add Loy Krathong. + + Also known as "Boun That Louang" and "Bon Om Touk". + This concides with the 15th Waxing Day (Full Moon) of Month 12 + in Thai Lunar Calendar. + + https://en.wikipedia.org/wiki/Loy_Krathong + https://en.wikipedia.org/wiki/Bon_Om_Touk + """ + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.loy_krathong_date(self._year) + ) + + def _add_makha_bucha(self, name, calendar=None) -> Optional[date]: + """ + Add Makha Bucha. + + Māgha Pūjā (also written as Makha Bucha Day) is a Buddhist festival + celebrated on the 15th Waxing Day (Full Moon) of Month 3. + + Khmer variant: always fall on Month 3. + Thai variant: will use Month 4 instead for Athikamat years. + + https://en.wikipedia.org/wiki/M%C4%81gha_P%C5%ABj%C4%81 + """ + calendar = calendar or self.__calendar + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.makha_bucha_date(self._year, calendar) + ) + + def _add_pchum_ben(self, name) -> Optional[date]: + """ + Add Pchum Ben. + + Also known as "Prachum Bandar". + This concides with the 15th Waning Day (New Moon) of Month 10 in + Thai Lunar Calendar. + + https://en.wikipedia.org/wiki/Pchum_Ben + """ + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.pchum_ben_date(self._year) + ) + + def _add_preah_neangkoal(self, name) -> Optional[date]: + """ + Add Preah Reach Pithi Chrat Preah Neangkoal. + + Also known as "Cambodian Royal Ploughing Ceremony". This always + concides with the 4th Waning Day of Month 6 in Khmer Lunar Calendar. + + https://en.wikipedia.org/wiki/Royal_Ploughing_Ceremony + """ + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.preah_neangkoal_date(self._year) + ) + + def _add_thai_calendar_holiday(self, name, dt) -> Optional[date]: + """ + Add Thai calendar holiday. + + If the result from `_ThaiLunisolar` is none then no holidays added. + """ + if dt is None: + return None + + return self._add_holiday(name, dt) + + def _add_visakha_bucha(self, name, calendar=None) -> Optional[date]: + """ + Add Visakha Bucha. + + Vesak(also written as Makha Bucha Day and Meak Bochea Day) is a + Buddhist festival celebrated on the 15th Waxing Day (Full Moon) + of Month 6. + + Khmer variant: always fall on Month 6. + Thai variant: will use Month 7 instead for Athikamat years. + + https://en.wikipedia.org/wiki/M%C4%81gha_P%C5%ABj%C4%81 + """ + calendar = calendar or self.__calendar + + return self._add_thai_calendar_holiday( + name, self._thai_calendar.visakha_bucha_date(self._year, calendar) + ) diff --git a/holidays/holiday_groups.py b/holidays/holiday_groups.py index 535cf0918..90c3e825f 100644 --- a/holidays/holiday_groups.py +++ b/holidays/holiday_groups.py @@ -14,3 +14,4 @@ from holidays.groups import BuddhistCalendarHolidays, ChineseCalendarHolidays from holidays.groups import ChristianHolidays, HinduCalendarHolidays from holidays.groups import InternationalHolidays, IslamicHolidays +from holidays.groups import ThaiCalendarHolidays diff --git a/holidays/locale/en_US/LC_MESSAGES/KH.po b/holidays/locale/en_US/LC_MESSAGES/KH.po new file mode 100644 index 000000000..2b1d76a57 --- /dev/null +++ b/holidays/locale/en_US/LC_MESSAGES/KH.po @@ -0,0 +1,139 @@ +# Cambodia holidays en_US localization. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-07 20:10+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \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" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.3.1\n" + +#. Khmer New Year's Replacement Holiday +#: ./holidays/countries/cambodia.py:58 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួសឲ្យពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "Khmer New Year's Replacement Holiday" + +#. Special Public Holiday +#: ./holidays/countries/cambodia.py:63 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួស" +msgstr "Special Public Holiday" + +#. International New Year Day. +#: ./holidays/countries/cambodia.py:101 +msgid "ទិវាចូលឆ្នាំសាកល" +msgstr "International New Year Day" + +#. Day of Victory over the Genocidal Regime. +#: ./holidays/countries/cambodia.py:108 +msgid "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍" +msgstr "Day of Victory over the Genocidal Regime" + +#. International Women's Rights Day +#: ./holidays/countries/cambodia.py:114 +msgid "ទិវាអន្តរជាតិនារី" +msgstr "International Women's Rights Day" + +#. Khmer New Year's Day +#: ./holidays/countries/cambodia.py:123 +msgid "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "Khmer New Year's Day" + +#. International Labor Day +#: ./holidays/countries/cambodia.py:135 +msgid "ទិវាពលកម្មអន្តរជាតិ" +msgstr "International Labor Day" + +#. Birthday of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, +#. King of Cambodia +#: ./holidays/countries/cambodia.py:143 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម " +"សីហមុនី" +msgstr "HM King Norodom Sihamoni's Birthday" + +#. National Day of Remembrance +#: ./holidays/countries/cambodia.py:163 +msgid "ទិវាជាតិនៃការចងចាំ" +msgstr "National Day of Remembrance" + +#. International Children Day +#: ./holidays/countries/cambodia.py:171 +msgid "ទិវាកុមារអន្តរជាតិ" +msgstr "International Children Day" + +#. Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH SIHANOUK of +#. Cambodia +#: ./holidays/countries/cambodia.py:182 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម " +"មុនិនាថ​ សីហនុ" +msgstr "HM Queen Norodom Monineath Sihanouk the Queen-Mother's Birthday" + +#. Constitution Day +#: ./holidays/countries/cambodia.py:195 +msgid "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ" +msgstr "Constitution Day" + +#. Mourning Day of the Late King-Father NORODOM SIHANOUK of Cambodia +#: ./holidays/countries/cambodia.py:207 +msgid "" +"ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា ព្រះបាទសម្តេចព្រះ នរោត្តម " +"សីហនុ ព្រះមហាវីរក្សត្រ ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " +"ព្រះបរមរតនកោដ្ឋ" +msgstr "HM King Norodom Sihanouk Mourning Day" + +#. Paris Peace Agreement's Day +#: ./holidays/countries/cambodia.py:224 +msgid "ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស" +msgstr "Paris Peace Agreement's Day" + +#. Coronation Day of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, King of Cambodia +#: ./holidays/countries/cambodia.py:239 +msgid "" +"ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ " +"នរោត្តម សីហមុនី ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" +msgstr "HM King Norodom Sihamoni's Coronation Day" + +#. National Independence Day +#: ./holidays/countries/cambodia.py:253 +msgid "ពិធីបុណ្យឯករាជ្យជាតិ" +msgstr "National Independence Day" + +#. International Human Rights Day +#: ./holidays/countries/cambodia.py:261 +msgid "ទិវាសិទ្ធិមនុស្សអន្តរជាតិ" +msgstr "International Human Rights Day" + +#. Meak Bochea Day +#: ./holidays/countries/cambodia.py:274 +msgid "ពិធីបុណ្យមាឃបូជា" +msgstr "Meak Bochea Day" + +#. Visaka Bochea Day +#: ./holidays/countries/cambodia.py:283 +msgid "ពិធីបុណ្យវិសាខបូជា" +msgstr "Visaka Bochea Day" + +#. Royal Ploughing Ceremony +#: ./holidays/countries/cambodia.py:291 +msgid "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល" +msgstr "Royal Ploughing Ceremony" + +#. Pchum Ben Day +#: ./holidays/countries/cambodia.py:299 +msgid "ពិធីបុណ្យភ្ផុំបិណ្ឌ" +msgstr "Pchum Ben Day" + +#. Water Festival +#: ./holidays/countries/cambodia.py:310 +msgid "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" +msgstr "Water Festival" diff --git a/holidays/locale/en_US/LC_MESSAGES/TH.po b/holidays/locale/en_US/LC_MESSAGES/TH.po index caa3985a3..1a2eb7d78 100644 --- a/holidays/locale/en_US/LC_MESSAGES/TH.po +++ b/holidays/locale/en_US/LC_MESSAGES/TH.po @@ -14,171 +14,171 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.2.2\n" -#: ./holidays/countries/thailand.py:120 +#: ./holidays/countries/thailand.py:118 msgid "วันหยุดชดเชย" msgstr "Special In Lieu Holiday" -#: ./holidays/countries/thailand.py:121 +#: ./holidays/countries/thailand.py:119 msgid "วันเลือกตั้ง" msgstr "Thai Election Day" -#: ./holidays/countries/thailand.py:122 +#: ./holidays/countries/thailand.py:120 msgid "ชดเชยวันเลือกตั้ง" msgstr "Thai Election Day (in lieu)" -#: ./holidays/countries/thailand.py:123 +#: ./holidays/countries/thailand.py:121 msgid "วันหยุดพิเศษ (เพิ่มเติม)" msgstr "Bridge Public Holiday" -#: ./holidays/countries/thailand.py:127 +#: ./holidays/countries/thailand.py:125 msgid "พระราชพิธีกาญจนาภิเษก พ.ศ. 2539" msgstr "HM King Bhumibol Adulyadej's Golden Jubilee" -#: ./holidays/countries/thailand.py:128 +#: ./holidays/countries/thailand.py:126 msgid "พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี พ.ศ. 2549" msgstr "HM King Bhumibol Adulyadej's 60th Anniversary of Accession Event" -#: ./holidays/countries/thailand.py:131 +#: ./holidays/countries/thailand.py:129 msgid "วันหยุดพิเศษ (คมช.)" msgstr "Emergency Lockdown (Thai Military Coup d'état)" -#: ./holidays/countries/thailand.py:132 +#: ./holidays/countries/thailand.py:130 msgid "วันหยุดพิเศษ (การเมือง)" msgstr "Emergency Lockdown (Thai Political Unrest)" -#: ./holidays/countries/thailand.py:133 +#: ./holidays/countries/thailand.py:131 msgid "วันหยุดพิเศษ (มหาอุทกภัย พ.ศ. 2554)" msgstr "Emergency Lockdown (2011 Thailand Floods)" -#: ./holidays/countries/thailand.py:136 +#: ./holidays/countries/thailand.py:134 msgid "วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)" msgstr "Day of Mourning for HM King Bhumibol Adulyadej" -#: ./holidays/countries/thailand.py:139 +#: ./holidays/countries/thailand.py:137 msgid "" "วันพระราชพิธีถวายพระเพลิงพระบรมศพพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช" msgstr "HM King Bhumibol Adulyadej's Royal Cremation Ceremony" -#: ./holidays/countries/thailand.py:143 +#: ./holidays/countries/thailand.py:141 msgid "พระราชพิธีบรมราชาภิเษก พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัว" msgstr "HM King Maha Vajiralongkorn's Coronation Celebrations" -#: ./holidays/countries/thailand.py:146 +#: ./holidays/countries/thailand.py:144 msgid "ชดเชยวันสงกรานต์" msgstr "Songkran Festival (in lieu)" -#: ./holidays/countries/thailand.py:293 ./holidays/countries/thailand.py:317 -#: ./holidays/countries/thailand.py:369 ./holidays/countries/thailand.py:637 -#: ./holidays/countries/thailand.py:642 +#: ./holidays/countries/thailand.py:291 ./holidays/countries/thailand.py:315 +#: ./holidays/countries/thailand.py:367 ./holidays/countries/thailand.py:623 +#: ./holidays/countries/thailand.py:628 #, c-format msgid "ชดเชย%s" msgstr "%s (in lieu)" -#: ./holidays/countries/thailand.py:305 +#: ./holidays/countries/thailand.py:303 msgid "วันขึ้นปีใหม่" msgstr "New Year's Day" -#: ./holidays/countries/thailand.py:317 ./holidays/countries/thailand.py:573 +#: ./holidays/countries/thailand.py:315 ./holidays/countries/thailand.py:571 msgid "วันสิ้นปี" msgstr "New Year's Eve" -#: ./holidays/countries/thailand.py:331 +#: ./holidays/countries/thailand.py:329 msgid "วันจักรี" msgstr "Chakri Memorial Day" -#: ./holidays/countries/thailand.py:348 +#: ./holidays/countries/thailand.py:346 msgid "วันสงกรานต์" msgstr "Songkran Festival" -#: ./holidays/countries/thailand.py:392 +#: ./holidays/countries/thailand.py:390 msgid "วันแรงงานแห่งชาติ" msgstr "National Labour Day" -#: ./holidays/countries/thailand.py:403 +#: ./holidays/countries/thailand.py:401 msgid "วันชาติ" msgstr "National Day" -#: ./holidays/countries/thailand.py:413 +#: ./holidays/countries/thailand.py:411 msgid "วันฉัตรมงคล" msgstr "Coronation Day" -#: ./holidays/countries/thailand.py:428 +#: ./holidays/countries/thailand.py:426 msgid "" "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสุทิดา พัชรสุธาพิมลลักษณ พระบรมราชินี" msgstr "HM Queen Suthida's Birthday" -#: ./holidays/countries/thailand.py:445 +#: ./holidays/countries/thailand.py:443 msgid "" "วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรเมนทรรามาธิบดีศรีสินทรมหาวชิราลงกรณ " "พระวชิรเกล้าเจ้าอยู่หัว" msgstr "HM King Maha Vajiralongkorn's Birthday" -#: ./holidays/countries/thailand.py:467 +#: ./holidays/countries/thailand.py:465 msgid "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ" msgstr "HM Queen Sirikit's Birthday" -#: ./holidays/countries/thailand.py:465 +#: ./holidays/countries/thailand.py:463 msgid "วันเฉลิมพระชนมพรรษาสมเด็จพระบรมราชชนนีพันปีหลวง" msgstr "HM Queen Sirikit The Queen Mother's Birthday" -#: ./holidays/countries/thailand.py:482 +#: ./holidays/countries/thailand.py:480 msgid "วันแม่แห่งชาติ" msgstr "National Mother's Day" -#: ./holidays/countries/thailand.py:502 +#: ./holidays/countries/thailand.py:500 msgid "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร" msgstr "HM King Bhumibol Adulyadej Memorial Day" -#: ./holidays/countries/thailand.py:497 +#: ./holidays/countries/thailand.py:495 msgid "" "วันคล้ายวันสวรรคตพระบาทสมเด็จพระบรมชนกาธิเบศร มหาภูมิพลอดุลยเดชมหาราช " "บรมนาถบพิตร" msgstr "HM King Bhumibol Adulyadej the Great Memorial Day" -#: ./holidays/countries/thailand.py:515 +#: ./holidays/countries/thailand.py:513 msgid "วันปิยมหาราช" msgstr "HM King Chulalongkorn Memorial Day" -#: ./holidays/countries/thailand.py:538 +#: ./holidays/countries/thailand.py:536 msgid "วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร" msgstr "HM King Bhumibol Adulyadej's Birthday" -#: ./holidays/countries/thailand.py:533 +#: ./holidays/countries/thailand.py:531 msgid "" "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช " "บรมนาถบพิตร" msgstr "HM King Bhumibol Adulyadej's Birthday" -#: ./holidays/countries/thailand.py:527 +#: ./holidays/countries/thailand.py:525 msgid "" "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระบรมชนกาธิเบศร " "มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร" msgstr "HM King Bhumibol Adulyadej the Great's Birthday" -#: ./holidays/countries/thailand.py:554 +#: ./holidays/countries/thailand.py:552 msgid "วันพ่อแห่งชาติ" msgstr "National Father's Day" -#: ./holidays/countries/thailand.py:563 +#: ./holidays/countries/thailand.py:561 msgid "วันรัฐธรรมนูญ" msgstr "Constitution Day" -#: ./holidays/countries/thailand.py:590 +#: ./holidays/countries/thailand.py:581 msgid "วันมาฆบูชา" msgstr "Makha Bucha" -#: ./holidays/countries/thailand.py:600 +#: ./holidays/countries/thailand.py:589 msgid "วันวิสาขบูชา" msgstr "Visakha Bucha" -#: ./holidays/countries/thailand.py:610 ./holidays/countries/thailand.py:642 +#: ./holidays/countries/thailand.py:598 ./holidays/countries/thailand.py:628 msgid "วันอาสาฬหบูชา" msgstr "Asarnha Bucha" -#: ./holidays/countries/thailand.py:619 ./holidays/countries/thailand.py:637 +#: ./holidays/countries/thailand.py:605 ./holidays/countries/thailand.py:623 msgid "วันเข้าพรรษา" msgstr "Buddhist Lent Day" -#: ./holidays/countries/thailand.py:658 +#: ./holidays/countries/thailand.py:644 msgid "วันพืชมงคล" msgstr "Royal Ploughing Ceremony" diff --git a/holidays/locale/km/LC_MESSAGES/KH.po b/holidays/locale/km/LC_MESSAGES/KH.po new file mode 100644 index 000000000..85f74278f --- /dev/null +++ b/holidays/locale/km/LC_MESSAGES/KH.po @@ -0,0 +1,139 @@ +# Cambodia holidays. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-07 20:10+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \n" +"Language-Team: Python Holidays localization team\n" +"Language: km\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.1\n" + +#. Khmer New Year's Replacement Holiday +#: ./holidays/countries/cambodia.py:58 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួសឲ្យពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "" + +#. Special Public Holiday +#: ./holidays/countries/cambodia.py:63 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួស" +msgstr "" + +#. International New Year Day. +#: ./holidays/countries/cambodia.py:101 +msgid "ទិវាចូលឆ្នាំសាកល" +msgstr "" + +#. Day of Victory over the Genocidal Regime. +#: ./holidays/countries/cambodia.py:108 +msgid "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍" +msgstr "" + +#. International Women's Rights Day +#: ./holidays/countries/cambodia.py:114 +msgid "ទិវាអន្តរជាតិនារី" +msgstr "" + +#. Khmer New Year's Day +#: ./holidays/countries/cambodia.py:123 +msgid "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "" + +#. International Labor Day +#: ./holidays/countries/cambodia.py:135 +msgid "ទិវាពលកម្មអន្តរជាតិ" +msgstr "" + +#. Birthday of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, +#. King of Cambodia +#: ./holidays/countries/cambodia.py:143 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម " +"សីហមុនី" +msgstr "" + +#. National Day of Remembrance +#: ./holidays/countries/cambodia.py:163 +msgid "ទិវាជាតិនៃការចងចាំ" +msgstr "" + +#. International Children Day +#: ./holidays/countries/cambodia.py:171 +msgid "ទិវាកុមារអន្តរជាតិ" +msgstr "" + +#. Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH SIHANOUK of +#. Cambodia +#: ./holidays/countries/cambodia.py:182 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម " +"មុនិនាថ​ សីហនុ" +msgstr "" + +#. Constitution Day +#: ./holidays/countries/cambodia.py:195 +msgid "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ" +msgstr "" + +#. Mourning Day of the Late King-Father NORODOM SIHANOUK of Cambodia +#: ./holidays/countries/cambodia.py:207 +msgid "" +"ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា ព្រះបាទសម្តេចព្រះ នរោត្តម " +"សីហនុ ព្រះមហាវីរក្សត្រ ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " +"ព្រះបរមរតនកោដ្ឋ" +msgstr "" + +#. Paris Peace Agreement's Day +#: ./holidays/countries/cambodia.py:224 +msgid "ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស" +msgstr "" + +#. Coronation Day of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, King of Cambodia +#: ./holidays/countries/cambodia.py:239 +msgid "" +"ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ " +"នរោត្តម សីហមុនី ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" +msgstr "" + +#. National Independence Day +#: ./holidays/countries/cambodia.py:253 +msgid "ពិធីបុណ្យឯករាជ្យជាតិ" +msgstr "" + +#. International Human Rights Day +#: ./holidays/countries/cambodia.py:261 +msgid "ទិវាសិទ្ធិមនុស្សអន្តរជាតិ" +msgstr "" + +#. Meak Bochea Day +#: ./holidays/countries/cambodia.py:274 +msgid "ពិធីបុណ្យមាឃបូជា" +msgstr "" + +#. Visaka Bochea Day +#: ./holidays/countries/cambodia.py:283 +msgid "ពិធីបុណ្យវិសាខបូជា" +msgstr "" + +#. Royal Ploughing Ceremony +#: ./holidays/countries/cambodia.py:291 +msgid "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល" +msgstr "" + +#. Pchum Ben Day +#: ./holidays/countries/cambodia.py:299 +msgid "ពិធីបុណ្យភ្ផុំបិណ្ឌ" +msgstr "" + +#. Water Festival +#: ./holidays/countries/cambodia.py:310 +msgid "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" +msgstr "" diff --git a/holidays/locale/th/LC_MESSAGES/KH.po b/holidays/locale/th/LC_MESSAGES/KH.po new file mode 100644 index 000000000..4540d4da5 --- /dev/null +++ b/holidays/locale/th/LC_MESSAGES/KH.po @@ -0,0 +1,145 @@ +# Cambodia holidays th localization. +# Authors: PPsyrius , (c) 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: Python Holidays 0.27\n" +"POT-Creation-Date: 2023-06-07 20:10+0700\n" +"PO-Revision-Date: \n" +"Last-Translator: PPsyrius \n" +"Language-Team: Python Holidays localization team\n" +"Language: th\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.1\n" + +#. Khmer New Year's Replacement Holiday +#: ./holidays/countries/cambodia.py:58 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួសឲ្យពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "วันหยุดชดเชยเทศกาลขึ้นปีใหม่ประเพณี" + +#. Special Public Holiday +#: ./holidays/countries/cambodia.py:63 +msgid "ថ្ងៃឈប់សម្រាកសងជំនួស" +msgstr "วันหยุดชดเชย" + +#. International New Year Day. +#: ./holidays/countries/cambodia.py:101 +msgid "ទិវាចូលឆ្នាំសាកល" +msgstr "วันปีใหม่สากล" + +#. Day of Victory over the Genocidal Regime. +#: ./holidays/countries/cambodia.py:108 +msgid "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍" +msgstr "วันชัยชนะเหนือระบอบฆ่าล้างเผ่าพันธุ์เขมรแดง" + +#. International Women's Rights Day +#: ./holidays/countries/cambodia.py:114 +msgid "ទិវាអន្តរជាតិនារី" +msgstr "วันสตรีสากล" + +#. Khmer New Year's Day +#: ./holidays/countries/cambodia.py:123 +msgid "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ" +msgstr "เทศกาลขึ้นปีใหม่ประเพณี" + +#. International Labor Day +#: ./holidays/countries/cambodia.py:135 +msgid "ទិវាពលកម្មអន្តរជាតិ" +msgstr "วันแรงงานสากล" + +#. Birthday of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, +#. King of Cambodia +#: ./holidays/countries/cambodia.py:143 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម " +"សីហមុនី" +msgstr "" +"พระราชพิธีเฉลิมพระชนมพรรษา พระบาทสมเด็จพระบรมนาถ นโรดมสีหมุนี " +"พระมหากษัตริย์แห่งราชอาณาจักรกัมพูชา" + +#. National Day of Remembrance +#: ./holidays/countries/cambodia.py:163 +msgid "ទិវាជាតិនៃការចងចាំ" +msgstr "วันแห่งความทรงจำ" + +#. International Children Day +#: ./holidays/countries/cambodia.py:171 +msgid "ទិវាកុមារអន្តរជាតិ" +msgstr "วันเด็กสากล" + +#. Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH SIHANOUK of +#. Cambodia +#: ./holidays/countries/cambodia.py:182 +msgid "" +"ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម " +"មុនិនាថ​ សីហនុ" +msgstr "พระราชพิธีเฉลิมพระชนมพรรษา สมเด็จพระบรมราชินี นโรดม มนีนาถ สีหนุ" + +#. Constitution Day +#: ./holidays/countries/cambodia.py:195 +msgid "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ" +msgstr "วันรัฐธรรมนูญ" + +#. Mourning Day of the Late King-Father NORODOM SIHANOUK of Cambodia +#: ./holidays/countries/cambodia.py:207 +msgid "" +"ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា ព្រះបាទសម្តេចព្រះ នរោត្តម " +"សីហនុ ព្រះមហាវីរក្សត្រ ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " +"ព្រះបរមរតនកោដ្ឋ" +msgstr "" +"วันสดุดีพระบาทสมเด็จพระบรมนาถนโรดม สีหนุ พระบิดาแห่งเอกราช บูรณภาพแห่งดินแดน" +" และเอกภาพของชาติกัมพูชา" + +#. Paris Peace Agreement's Day +#: ./holidays/countries/cambodia.py:224 +msgid "ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស" +msgstr "วันรำลึกข้อตกลงสันติภาพกรุงปารีส" + +#. Coronation Day of His Majesty Preah Bat Samdech Preah Boromneath NORODOM +#. SIHAMONI, King of Cambodia +#: ./holidays/countries/cambodia.py:239 +msgid "" +"ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា ព្រះបាទសម្តេចព្រះបរមនាថ " +"នរោត្តម សីហមុនី ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" +msgstr "" +"พระราชพิธีเฉลิมฉลองการขึ้นครองราชสมบัติ พระบาทสมเด็จพระบรมนาถ นโรดมสีหมุนี " +"พระมหากษัตริย์แห่งราชอาณาจักรกัมพูชา" + +#. National Independence Day +#: ./holidays/countries/cambodia.py:253 +msgid "ពិធីបុណ្យឯករាជ្យជាតិ" +msgstr "วันประกาศเอกราชจากฝรั่งเศส" + +#. International Human Rights Day +#: ./holidays/countries/cambodia.py:261 +msgid "ទិវាសិទ្ធិមនុស្សអន្តរជាតិ" +msgstr "วันสิทธิมนุษยชนโลก" + +#. Meak Bochea Day +#: ./holidays/countries/cambodia.py:274 +msgid "ពិធីបុណ្យមាឃបូជា" +msgstr "วันมาฆบูชา" + +#. Visaka Bochea Day +#: ./holidays/countries/cambodia.py:283 +msgid "ពិធីបុណ្យវិសាខបូជា" +msgstr "วันวิสาขบูชา" + +#. Royal Ploughing Ceremony +#: ./holidays/countries/cambodia.py:291 +msgid "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល" +msgstr "พระราชพิธีบุญจรดพระนังคัลแรกนาขวัญ" + +#. Pchum Ben Day +#: ./holidays/countries/cambodia.py:299 +msgid "ពិធីបុណ្យភ្ផុំបិណ្ឌ" +msgstr "เทศกาลงานวันสาร์ทภจุมบิณฑ์เขมร" + +#. Water Festival +#: ./holidays/countries/cambodia.py:310 +msgid "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" +msgstr "พระราชพิธีบุญแข่งเรือลอยกระทงไฟไหว้พระจันทร์และกินข้าวเม่า" diff --git a/holidays/locale/th/LC_MESSAGES/TH.po b/holidays/locale/th/LC_MESSAGES/TH.po index cb00eceea..81bff4493 100644 --- a/holidays/locale/th/LC_MESSAGES/TH.po +++ b/holidays/locale/th/LC_MESSAGES/TH.po @@ -14,171 +14,171 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.2.2\n" -#: ./holidays/countries/thailand.py:120 +#: ./holidays/countries/thailand.py:118 msgid "วันหยุดชดเชย" msgstr "" -#: ./holidays/countries/thailand.py:121 +#: ./holidays/countries/thailand.py:119 msgid "วันเลือกตั้ง" msgstr "" -#: ./holidays/countries/thailand.py:293 ./holidays/countries/thailand.py:317 -#: ./holidays/countries/thailand.py:369 ./holidays/countries/thailand.py:637 -#: ./holidays/countries/thailand.py:642 +#: ./holidays/countries/thailand.py:291 ./holidays/countries/thailand.py:315 +#: ./holidays/countries/thailand.py:367 ./holidays/countries/thailand.py:623 +#: ./holidays/countries/thailand.py:628 #, c-format msgid "ชดเชย%s" msgstr "" -#: ./holidays/countries/thailand.py:123 +#: ./holidays/countries/thailand.py:121 msgid "วันหยุดพิเศษ (เพิ่มเติม)" msgstr "" -#: ./holidays/countries/thailand.py:127 +#: ./holidays/countries/thailand.py:125 msgid "พระราชพิธีกาญจนาภิเษก พ.ศ. 2539" msgstr "" -#: ./holidays/countries/thailand.py:128 +#: ./holidays/countries/thailand.py:126 msgid "พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี พ.ศ. 2549" msgstr "" -#: ./holidays/countries/thailand.py:131 +#: ./holidays/countries/thailand.py:129 msgid "วันหยุดพิเศษ (คมช.)" msgstr "" -#: ./holidays/countries/thailand.py:132 +#: ./holidays/countries/thailand.py:130 msgid "วันหยุดพิเศษ (การเมือง)" msgstr "" -#: ./holidays/countries/thailand.py:133 +#: ./holidays/countries/thailand.py:131 msgid "วันหยุดพิเศษ (มหาอุทกภัย พ.ศ. 2554)" msgstr "" -#: ./holidays/countries/thailand.py:136 +#: ./holidays/countries/thailand.py:134 msgid "วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)" msgstr "" -#: ./holidays/countries/thailand.py:139 +#: ./holidays/countries/thailand.py:137 msgid "" "วันพระราชพิธีถวายพระเพลิงพระบรมศพพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช" msgstr "" -#: ./holidays/countries/thailand.py:143 +#: ./holidays/countries/thailand.py:141 msgid "พระราชพิธีบรมราชาภิเษก พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัว" msgstr "" -#: ./holidays/countries/thailand.py:348 +#: ./holidays/countries/thailand.py:346 msgid "วันสงกรานต์" msgstr "" -#: ./holidays/countries/thailand.py:305 +#: ./holidays/countries/thailand.py:303 msgid "วันขึ้นปีใหม่" msgstr "" -#: ./holidays/countries/thailand.py:317 ./holidays/countries/thailand.py:573 +#: ./holidays/countries/thailand.py:315 ./holidays/countries/thailand.py:571 msgid "วันสิ้นปี" msgstr "" -#: ./holidays/countries/thailand.py:331 +#: ./holidays/countries/thailand.py:329 msgid "วันจักรี" msgstr "" -#: ./holidays/countries/thailand.py:392 +#: ./holidays/countries/thailand.py:390 msgid "วันแรงงานแห่งชาติ" msgstr "" -#: ./holidays/countries/thailand.py:403 +#: ./holidays/countries/thailand.py:401 msgid "วันชาติ" msgstr "" -#: ./holidays/countries/thailand.py:413 +#: ./holidays/countries/thailand.py:411 msgid "วันฉัตรมงคล" msgstr "" -#: ./holidays/countries/thailand.py:428 +#: ./holidays/countries/thailand.py:426 msgid "" "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสุทิดา พัชรสุธาพิมลลักษณ พระบรมราชินี" msgstr "" -#: ./holidays/countries/thailand.py:445 +#: ./holidays/countries/thailand.py:443 msgid "" "วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรเมนทรรามาธิบดีศรีสินทรมหาวชิราลงกรณ " "พระวชิรเกล้าเจ้าอยู่หัว" msgstr "" -#: ./holidays/countries/thailand.py:467 +#: ./holidays/countries/thailand.py:465 msgid "วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ" msgstr "" -#: ./holidays/countries/thailand.py:465 +#: ./holidays/countries/thailand.py:463 msgid "วันเฉลิมพระชนมพรรษาสมเด็จพระบรมราชชนนีพันปีหลวง" msgstr "" -#: ./holidays/countries/thailand.py:482 +#: ./holidays/countries/thailand.py:480 msgid "วันแม่แห่งชาติ" msgstr "" -#: ./holidays/countries/thailand.py:502 +#: ./holidays/countries/thailand.py:500 msgid "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร" msgstr "" -#: ./holidays/countries/thailand.py:497 +#: ./holidays/countries/thailand.py:495 msgid "" "วันคล้ายวันสวรรคตพระบาทสมเด็จพระบรมชนกาธิเบศร มหาภูมิพลอดุลยเดชมหาราช " "บรมนาถบพิตร" msgstr "" -#: ./holidays/countries/thailand.py:515 +#: ./holidays/countries/thailand.py:513 msgid "วันปิยมหาราช" msgstr "" -#: ./holidays/countries/thailand.py:538 +#: ./holidays/countries/thailand.py:536 msgid "วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร" msgstr "" -#: ./holidays/countries/thailand.py:533 +#: ./holidays/countries/thailand.py:531 msgid "" "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช " "บรมนาถบพิตร" msgstr "" -#: ./holidays/countries/thailand.py:527 +#: ./holidays/countries/thailand.py:525 msgid "" "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระบรมชนกาธิเบศร " "มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร" msgstr "" -#: ./holidays/countries/thailand.py:554 +#: ./holidays/countries/thailand.py:552 msgid "วันพ่อแห่งชาติ" msgstr "" -#: ./holidays/countries/thailand.py:563 +#: ./holidays/countries/thailand.py:561 msgid "วันรัฐธรรมนูญ" msgstr "" -#: ./holidays/countries/thailand.py:590 +#: ./holidays/countries/thailand.py:581 msgid "วันมาฆบูชา" msgstr "" -#: ./holidays/countries/thailand.py:600 +#: ./holidays/countries/thailand.py:589 msgid "วันวิสาขบูชา" msgstr "" -#: ./holidays/countries/thailand.py:610 ./holidays/countries/thailand.py:642 +#: ./holidays/countries/thailand.py:598 ./holidays/countries/thailand.py:628 msgid "วันอาสาฬหบูชา" msgstr "" -#: ./holidays/countries/thailand.py:619 ./holidays/countries/thailand.py:637 +#: ./holidays/countries/thailand.py:605 ./holidays/countries/thailand.py:623 msgid "วันเข้าพรรษา" msgstr "" -#: ./holidays/countries/thailand.py:658 +#: ./holidays/countries/thailand.py:644 msgid "วันพืชมงคล" msgstr "" -#: ./holidays/countries/thailand.py:122 +#: ./holidays/countries/thailand.py:120 msgid "ชดเชยวันเลือกตั้ง" msgstr "" -#: ./holidays/countries/thailand.py:146 +#: ./holidays/countries/thailand.py:144 msgid "ชดเชยวันสงกรานต์" msgstr "" diff --git a/holidays/registry.py b/holidays/registry.py index 3b6324f13..7c97d04ca 100644 --- a/holidays/registry.py +++ b/holidays/registry.py @@ -41,6 +41,7 @@ "bulgaria": ("Bulgaria", "BG", "BLG"), "burkina_faso": ("BurkinaFaso", "BF", "BFA"), "burundi": ("Burundi", "BI", "BDI"), + "cambodia": ("Cambodia", "KH", "KHM"), "cameroon": ("Cameroon", "CM", "CMR"), "canada": ("Canada", "CA", "CAN"), "chad": ("Chad", "TD", "TCD"), diff --git a/tests/countries/test_cambodia.py b/tests/countries/test_cambodia.py new file mode 100644 index 000000000..131fee6b1 --- /dev/null +++ b/tests/countries/test_cambodia.py @@ -0,0 +1,542 @@ +# python-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: dr-prodigy (c) 2017-2023 +# ryanss (c) 2014-2017 +# Website: https://github.com/dr-prodigy/python-holidays +# License: MIT (see LICENSE file) + +from holidays.countries.cambodia import Cambodia, KH, KHM +from tests.common import TestCase + + +class TestCambodia(TestCase): + @classmethod + def setUpClass(cls): + super().setUpClass(Cambodia, years=range(1993, 2059)) + + def test_country_aliases(self): + self.assertCountryAliases(Cambodia, KH, KHM) + + def test_no_holidays(self): + self.assertNoHolidays(Cambodia(years=1992)) + + def test_special_holidays(self): + self.assertHoliday( + "2016-05-02", + "2016-05-16", + "2018-05-21", + "2019-09-30", + "2020-05-11", + "2020-08-17", + "2020-08-18", + "2020-08-19", + "2020-08-20", + "2020-08-21", + ) + + def test_2022(self): + self.assertHolidays( + Cambodia(years=2022), + ("2022-01-01", "ទិវាចូលឆ្នាំសាកល"), + ("2022-01-07", "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍"), + ("2022-03-08", "ទិវាអន្តរជាតិនារី"), + ("2022-04-14", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2022-04-15", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2022-04-16", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2022-05-01", "ទិវាពលកម្មអន្តរជាតិ"), + ( + "2022-05-14", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី" + ), + ), + ("2022-05-15", "ពិធីបុណ្យវិសាខបូជា"), + ("2022-05-19", "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល"), + ( + "2022-06-18", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី " + "ព្រះវររាជមាតា នរោត្តម មុនិនាថ​ សីហនុ" + ), + ), + ("2022-09-24", "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ; ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ("2022-09-25", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ("2022-09-26", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ( + "2022-10-15", + ( + "ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះ នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ " + "ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " + "ព្រះបរមរតនកោដ្ឋ" + ), + ), + ( + "2022-10-29", + ( + "ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី " + "ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" + ), + ), + ( + "2022-11-07", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2022-11-08", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2022-11-09", + ( + "ពិធីបុណ្យឯករាជ្យជាតិ; ព្រះរាជពិធីបុណ្យអុំទូក " + "បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" + ), + ), + ) + + def test_2023(self): + self.assertHolidays( + Cambodia(years=2023), + ("2023-01-01", "ទិវាចូលឆ្នាំសាកល"), + ("2023-01-07", "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍"), + ("2023-03-08", "ទិវាអន្តរជាតិនារី"), + ("2023-04-14", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-04-15", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-04-16", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-05-01", "ទិវាពលកម្មអន្តរជាតិ"), + ("2023-05-04", "ពិធីបុណ្យវិសាខបូជា"), + ("2023-05-08", "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល"), + ( + "2023-05-14", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី" + ), + ), + ( + "2023-06-18", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី " + "ព្រះវររាជមាតា នរោត្តម មុនិនាថ​ សីហនុ" + ), + ), + ("2023-09-24", "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ"), + ("2023-10-13", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ("2023-10-14", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ( + "2023-10-15", + ( + "ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះ នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ " + "ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " + "ព្រះបរមរតនកោដ្ឋ; ពិធីបុណ្យភ្ផុំបិណ្ឌ" + ), + ), + ( + "2023-10-29", + ( + "ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី " + "ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" + ), + ), + ("2023-11-09", "ពិធីបុណ្យឯករាជ្យជាតិ"), + ( + "2023-11-26", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2023-11-27", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2023-11-28", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ) + + def test_day_of_victory_over_genocidal_regime(self): + self.assertHolidayName( + "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍", + (f"{year}-01-07" for year in range(1993, 2058)), + ) + + def test_sangkranta(self): + sangkranta_years_apr14 = {2017, 2018, 2021, 2022, 2023} + for year in set(range(1993, 2058)).difference({2020}): + if year in sangkranta_years_apr14: + self.assertHoliday( + f"{year}-04-14", f"{year}-04-15", f"{year}-04-16" + ) + else: + self.assertHoliday( + f"{year}-04-13", f"{year}-04-14", f"{year}-04-15" + ) + + def test_king_sihamoni_birthday(self): + name = ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី" + ) + self.assertNoHolidayName(name, 2004) + self.assertHolidayName( + name, (f"{year}-05-13" for year in range(2005, 2020)) + ) + self.assertHolidayName( + name, (f"{year}-05-14" for year in range(2005, 2058)) + ) + self.assertHolidayName( + name, (f"{year}-05-15" for year in range(2005, 2020)) + ) + + def test_national_day_of_remembrance(self): + name = "ទិវាជាតិនៃការចងចាំ" + self.assertNoHolidayName(name, 2017) + self.assertHolidayName( + name, (f"{year}-05-20" for year in range(2018, 2020)) + ) + self.assertNoHolidayName(name, 2020) + + def test_international_children_day(self): + name = "ទិវាកុមារអន្តរជាតិ" + self.assertHolidayName( + name, + (f"{year}-06-01" for year in range(1993, 2020)), + ) + self.assertNoHolidayName(name, 2020) + + def test_queen_mother_monineath_birthday(self): + name = ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី " + "ព្រះវររាជមាតា នរោត្តម មុនិនាថ​ សីហនុ" + ) + self.assertNoHolidayName(name, 1993) + self.assertHolidayName( + name, (f"{year}-06-18" for year in range(1994, 2058)) + ) + + def test_constitution_day(self): + self.assertHolidayName( + "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ", + (f"{year}-09-24" for year in range(1993, 2058)), + ) + + def test_king_sihanouk_memorial_day(self): + name = ( + "ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា ព្រះបាទសម្តេចព្រះ" + " នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី" + " និងឯកភាពជាតិខ្មែរ ព្រះបរមរតនកោដ្ឋ" + ) + self.assertNoHolidayName(name, 2011) + self.assertHolidayName( + name, + (f"{year}-10-15" for year in range(2012, 2058)), + ) + + def test_paris_peace_agreement_day(self): + name = "ទិវារំលឹកសន្ធិសញ្ញាសន្តិភាពទីក្រុងប៉ារីស" + self.assertHolidayName( + name, + (f"{year}-10-23" for year in range(1993, 2020)), + ) + self.assertNoHolidayName(name, 2020) + + def test_king_sihamoni_coronation_day(self): + name = ( + "ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី " + "ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" + ) + self.assertNoHolidayName(name, 2003) + self.assertHolidayName( + name, (f"{year}-10-29" for year in range(2004, 2058)) + ) + + def test_national_independence_day(self): + self.assertHolidayName( + "ពិធីបុណ្យឯករាជ្យជាតិ", + (f"{year}-11-09" for year in range(1993, 2058)), + ) + + def test_international_human_rights_day(self): + name = "ទិវាសិទ្ធិមនុស្សអន្តរជាតិ" + self.assertHolidayName( + name, + (f"{year}-12-10" for year in range(1993, 2020)), + ) + self.assertNoHolidayName(name, 2020) + + def test_meak_bochea(self): + name = "ពិធីបុណ្យមាឃបូជា" + self.assertHolidayName( + name, + "2015-02-03", + "2016-02-22", + "2017-02-11", + "2018-01-31", + "2019-02-19", + ) + self.assertNoHolidayName(name, 2058) + + def test_visaka_bochea(self): + name = "ពិធីបុណ្យវិសាខបូជា" + self.assertHolidayName( + name, + "2015-05-02", + "2016-05-20", + "2017-05-10", + "2018-04-29", + "2019-05-18", + "2020-05-06", + "2021-04-26", + "2022-05-15", + "2023-05-04", + ) + self.assertNoHolidayName(name, 2058) + + def test_preah_neangkoal(self): + name = "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល" + self.assertHolidayName( + name, + "2015-05-06", + "2016-05-24", + "2017-05-14", + "2018-05-03", + "2019-05-22", + "2020-05-10", + "2021-04-30", + "2022-05-19", + "2023-05-08", + ) + self.assertNoHolidayName(name, 2058) + + def test_pchum_ben(self): + name = "ពិធីបុណ្យភ្ផុំបិណ្ឌ" + self.assertHolidayName( + name, + # 2 Days Celebration + "2015-10-11", + "2015-10-12", + "2016-09-30", + "2016-10-01", + # 3 Days Celebration + "2017-09-19", + "2017-09-20", + "2017-09-21", + "2018-10-08", + "2018-10-09", + "2018-10-10", + "2019-09-27", + "2019-09-28", + "2019-09-29", + "2020-09-16", + "2020-09-17", + "2020-09-18", + "2021-10-05", + "2021-10-06", + "2021-10-07", + "2022-09-24", + "2022-09-25", + "2022-09-26", + "2023-10-13", + "2023-10-14", + "2023-10-15", + ) + self.assertNoHolidayName(name, 2058) + + def test_bon_om_touk(self): + name = "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក" + self.assertHolidayName( + name, + # 3 Days Celebration + "2015-11-24", + "2015-11-25", + "2015-11-26", + "2016-11-13", + "2016-11-14", + "2016-11-15", + "2017-11-02", + "2017-11-03", + "2017-11-04", + "2018-11-21", + "2018-11-22", + "2018-11-23", + "2019-11-10", + "2019-11-11", + "2019-11-12", + "2020-10-30", + "2020-10-31", + "2020-11-01", + "2021-11-18", + "2021-11-19", + "2021-11-20", + "2022-11-07", + "2022-11-08", + "2022-11-09", + "2023-11-26", + "2023-11-27", + "2023-11-28", + ) + self.assertNoHolidayName(name, 2058) + + def test_l10n_default(self): + self.assertLocalizedHolidays( + ("2023-01-01", "ទិវាចូលឆ្នាំសាកល"), + ("2023-01-07", "ទិវាជ័យជម្នះលើរបបប្រល័យពូជសាសន៍"), + ("2023-03-08", "ទិវាអន្តរជាតិនារី"), + ("2023-04-14", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-04-15", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-04-16", "ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ"), + ("2023-05-01", "ទិវាពលកម្មអន្តរជាតិ"), + ("2023-05-04", "ពិធីបុណ្យវិសាខបូជា"), + ("2023-05-08", "ព្រះរាជពិធីច្រត់ព្រះនង្គ័ល"), + ( + "2023-05-14", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី" + ), + ), + ( + "2023-06-18", + ( + "ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី " + "ព្រះវររាជមាតា នរោត្តម មុនិនាថ​ សីហនុ" + ), + ), + ("2023-09-24", "ទិវាប្រកាសរដ្ឋធម្មនុញ្ញ"), + ("2023-10-13", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ("2023-10-14", "ពិធីបុណ្យភ្ផុំបិណ្ឌ"), + ( + "2023-10-15", + ( + "ទិវាប្រារព្ឋពិធីគោរពព្រះវិញ្ញាណក្ខន្ឋ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះ នរោត្តម សីហនុ ព្រះមហាវីរក្សត្រ " + "ព្រះវររាជបិតាឯករាជ្យ បូរណភាពទឹកដី និងឯកភាពជាតិខ្មែរ " + "ព្រះបរមរតនកោដ្ឋ; ពិធីបុណ្យភ្ផុំបិណ្ឌ" + ), + ), + ( + "2023-10-29", + ( + "ព្រះរាជពិធីគ្រងព្រះបរមរាជសម្បត្តិ របស់ ព្រះករុណា " + "ព្រះបាទសម្តេចព្រះបរមនាថ នរោត្តម សីហមុនី " + "ព្រះមហាក្សត្រនៃព្រះរាជាណាចក្រកម្ពុជា" + ), + ), + ("2023-11-09", "ពិធីបុណ្យឯករាជ្យជាតិ"), + ( + "2023-11-26", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2023-11-27", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ( + "2023-11-28", + "ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក", + ), + ) + + def test_l10n_en_us(self): + self.assertLocalizedHolidays( + "en_US", + ("2023-01-01", "International New Year Day"), + ("2023-01-07", "Day of Victory over the Genocidal Regime"), + ("2023-03-08", "International Women's Rights Day"), + ("2023-04-14", "Khmer New Year's Day"), + ("2023-04-15", "Khmer New Year's Day"), + ("2023-04-16", "Khmer New Year's Day"), + ("2023-05-01", "International Labor Day"), + ("2023-05-04", "Visaka Bochea Day"), + ("2023-05-08", "Royal Ploughing Ceremony"), + ("2023-05-14", "HM King Norodom Sihamoni's Birthday"), + ( + "2023-06-18", + ( + "HM Queen Norodom Monineath Sihanouk " + "the Queen-Mother's Birthday" + ), + ), + ("2023-09-24", "Constitution Day"), + ("2023-10-13", "Pchum Ben Day"), + ("2023-10-14", "Pchum Ben Day"), + ( + "2023-10-15", + "HM King Norodom Sihanouk Mourning Day; Pchum Ben Day", + ), + ("2023-10-29", "HM King Norodom Sihamoni's Coronation Day"), + ("2023-11-09", "National Independence Day"), + ("2023-11-26", "Water Festival"), + ("2023-11-27", "Water Festival"), + ("2023-11-28", "Water Festival"), + ) + + def test_l10n_th(self): + self.assertLocalizedHolidays( + "th", + ("2023-01-01", "วันปีใหม่สากล"), + ("2023-01-07", "วันชัยชนะเหนือระบอบฆ่าล้างเผ่าพันธุ์เขมรแดง"), + ("2023-03-08", "วันสตรีสากล"), + ("2023-04-14", "เทศกาลขึ้นปีใหม่ประเพณี"), + ("2023-04-15", "เทศกาลขึ้นปีใหม่ประเพณี"), + ("2023-04-16", "เทศกาลขึ้นปีใหม่ประเพณี"), + ("2023-05-01", "วันแรงงานสากล"), + ("2023-05-04", "วันวิสาขบูชา"), + ("2023-05-08", "พระราชพิธีบุญจรดพระนังคัลแรกนาขวัญ"), + ( + "2023-05-14", + ( + "พระราชพิธีเฉลิมพระชนมพรรษา พระบาทสมเด็จพระบรมนาถ " + "นโรดมสีหมุนี พระมหากษัตริย์แห่งราชอาณาจักรกัมพูชา" + ), + ), + ( + "2023-06-18", + ( + "พระราชพิธีเฉลิมพระชนมพรรษา สมเด็จพระบรมราชินี " + "นโรดม มนีนาถ สีหนุ" + ), + ), + ("2023-09-24", "วันรัฐธรรมนูญ"), + ("2023-10-13", "เทศกาลงานวันสาร์ทภจุมบิณฑ์เขมร"), + ("2023-10-14", "เทศกาลงานวันสาร์ทภจุมบิณฑ์เขมร"), + ( + "2023-10-15", + ( + "วันสดุดีพระบาทสมเด็จพระบรมนาถนโรดม สีหนุ " + "พระบิดาแห่งเอกราช บูรณภาพแห่งดินแดน " + "และเอกภาพของชาติกัมพูชา; " + "เทศกาลงานวันสาร์ทภจุมบิณฑ์เขมร" + ), + ), + ( + "2023-10-29", + ( + "พระราชพิธีเฉลิมฉลองการขึ้นครองราชสมบัติ " + "พระบาทสมเด็จพระบรมนาถ นโรดมสีหมุนี " + "พระมหากษัตริย์แห่งราชอาณาจักรกัมพูชา" + ), + ), + ("2023-11-09", "วันประกาศเอกราชจากฝรั่งเศส"), + ( + "2023-11-26", + "พระราชพิธีบุญแข่งเรือลอยกระทงไฟไหว้พระจันทร์และกินข้าวเม่า", + ), + ( + "2023-11-27", + "พระราชพิธีบุญแข่งเรือลอยกระทงไฟไหว้พระจันทร์และกินข้าวเม่า", + ), + ( + "2023-11-28", + "พระราชพิธีบุญแข่งเรือลอยกระทงไฟไหว้พระจันทร์และกินข้าวเม่า", + ), + ) diff --git a/tests/test_calendars.py b/tests/test_calendars.py index 9a8e02fba..40d77be1b 100644 --- a/tests/test_calendars.py +++ b/tests/test_calendars.py @@ -13,8 +13,8 @@ from datetime import date from holidays import calendars -from holidays.calendars import _get_nth_weekday_of_month -from holidays.constants import FEB, MAR, MAY, JUN, JUL, AUG, OCT +from holidays.calendars import _get_nth_weekday_of_month, KHMER_CALENDAR +from holidays.constants import FEB, MAR, MAY, JUN, JUL, AUG, SEP, OCT, NOV class TestThaiLunisolarCalendar(unittest.TestCase): @@ -22,7 +22,14 @@ def setUp(self) -> None: super().setUpClass() self.calendar = calendars._ThaiLunisolar() + def test_check_calendar(self): + self.assertRaises( + ValueError, + lambda: calendars._ThaiLunisolar("INVALID_CALENDAR"), + ) + def test_asarnha_bucha_date(self): + # THAI_CALENDAR asarnha_bucha_year_date = { self.calendar.START_YEAR - 1: None, self.calendar.END_YEAR + 1: None, @@ -36,8 +43,23 @@ def test_asarnha_bucha_date(self): asarnha_bucha_year_date[year], self.calendar.asarnha_bucha_date(year), ) + # KHMER_CALENDAR + asanha_bochea_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, JUL, 13), + 2023: date(2023, JUL, 2), + 2024: date(2024, JUL, 20), + 2025: date(2025, JUL, 10), + } + for year in asanha_bochea_year_date: + self.assertEqual( + asanha_bochea_year_date[year], + self.calendar.asarnha_bucha_date(year, KHMER_CALENDAR), + ) def test_atthami_bucha_date(self): + # THAI_CALENDAR atthami_bucha_year_date = { self.calendar.START_YEAR - 1: None, self.calendar.END_YEAR + 1: None, @@ -51,8 +73,23 @@ def test_atthami_bucha_date(self): atthami_bucha_year_date[year], self.calendar.atthami_bucha_date(year), ) + # KHMER_CALENDAR + athami_bochea_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, MAY, 23), + 2023: date(2023, MAY, 12), + 2024: date(2024, MAY, 30), + 2025: date(2025, MAY, 19), + } + for year in athami_bochea_year_date: + self.assertEqual( + athami_bochea_year_date[year], + self.calendar.atthami_bucha_date(year, KHMER_CALENDAR), + ) def test_khao_phansa_date(self): + # THAI_CALENDAR khao_phansa_year_date = { self.calendar.START_YEAR - 1: None, self.calendar.END_YEAR + 1: None, @@ -66,8 +103,38 @@ def test_khao_phansa_date(self): khao_phansa_year_date[year], self.calendar.khao_phansa_date(year), ) + # KHMER_CALENDAR + bony_kanben_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, JUL, 14), + 2023: date(2023, JUL, 3), + 2024: date(2024, JUL, 21), + 2025: date(2025, JUL, 11), + } + for year in bony_kanben_year_date: + self.assertEqual( + bony_kanben_year_date[year], + self.calendar.khao_phansa_date(year, KHMER_CALENDAR), + ) + + def test_loy_krathong_date(self): + loy_krathong_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, NOV, 8), + 2023: date(2023, NOV, 27), + 2024: date(2024, NOV, 15), + 2025: date(2025, NOV, 5), + } + for year in loy_krathong_year_date: + self.assertEqual( + loy_krathong_year_date[year], + self.calendar.loy_krathong_date(year), + ) def test_makha_bucha_date(self): + # THAI_CALENDAR makha_bucha_year_date = { self.calendar.START_YEAR - 1: None, self.calendar.END_YEAR + 1: None, @@ -81,6 +148,20 @@ def test_makha_bucha_date(self): makha_bucha_year_date[year], self.calendar.makha_bucha_date(year), ) + # KHMER_CALENDAR + meak_bochea_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, FEB, 16), + 2023: date(2023, FEB, 5), + 2024: date(2024, FEB, 24), + 2025: date(2025, FEB, 12), + } + for year in meak_bochea_year_date: + self.assertEqual( + meak_bochea_year_date[year], + self.calendar.makha_bucha_date(year, KHMER_CALENDAR), + ) def test_ok_phansa_date(self): ok_phansa_year_date = { @@ -97,7 +178,38 @@ def test_ok_phansa_date(self): self.calendar.ok_phansa_date(year), ) + def test_pchum_ben_date(self): + pchum_ben_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, SEP, 25), + 2023: date(2023, OCT, 14), + 2024: date(2024, OCT, 2), + 2025: date(2025, SEP, 22), + } + for year in pchum_ben_year_date: + self.assertEqual( + pchum_ben_year_date[year], + self.calendar.pchum_ben_date(year), + ) + + def test_preah_neangkoal_date(self): + preah_neangkoal_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, MAY, 19), + 2023: date(2023, MAY, 8), + 2024: date(2024, MAY, 26), + 2025: date(2025, MAY, 15), + } + for year in preah_neangkoal_year_date: + self.assertEqual( + preah_neangkoal_year_date[year], + self.calendar.preah_neangkoal_date(year), + ) + def test_visakha_bucha_date(self): + # THAI_CALENDAR visakha_bucha_year_date = { self.calendar.START_YEAR - 1: None, self.calendar.END_YEAR + 1: None, @@ -111,6 +223,20 @@ def test_visakha_bucha_date(self): visakha_bucha_year_date[year], self.calendar.visakha_bucha_date(year), ) + # KHMER_CALENDAR + visaka_bochea_year_date = { + self.calendar.START_YEAR - 1: None, + self.calendar.END_YEAR + 1: None, + 2022: date(2022, MAY, 15), + 2023: date(2023, MAY, 4), + 2024: date(2024, MAY, 22), + 2025: date(2025, MAY, 11), + } + for year in visaka_bochea_year_date: + self.assertEqual( + visaka_bochea_year_date[year], + self.calendar.visakha_bucha_date(year, KHMER_CALENDAR), + ) class TestRelativeWeekdays(unittest.TestCase):