Skip to content

Commit

Permalink
Update China holidays add non-statutory holidays support, l10n, optio…
Browse files Browse the repository at this point in the history
…nal half-day holidays (#1491)

Co-authored-by: Arkadii Yakovets <[email protected]>
Co-authored-by: Arkadii Yakovets <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2023
1 parent 0f71c73 commit 5c3ac9e
Show file tree
Hide file tree
Showing 9 changed files with 2,915 additions and 246 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ The list of supported countries, their subdivisions and supported languages
* - China
- CN
-
-
- en_US, th, **zh_CN**, zh_TW
* - Colombia
- CO
-
Expand Down
370 changes: 339 additions & 31 deletions holidays/countries/china.py

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions holidays/groups/chinese.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ def _add_chinese_new_years_day_five(self, name) -> Optional[date]:
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+4
)

def _add_chinese_new_years_day_six(self, name) -> Optional[date]:
"""
Add Chinese New Year's Day Six.
https://en.wikipedia.org/wiki/Chinese_New_Year
"""
return self._add_chinese_calendar_holiday(
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+5
)

def _add_chinese_new_years_day_seven(self, name) -> Optional[date]:
"""
Add Chinese New Year's Day Seven.
https://en.wikipedia.org/wiki/Chinese_New_Year
"""
return self._add_chinese_calendar_holiday(
name, self._chinese_calendar.lunar_new_year_date(self._year), days_delta=+6
)

def _add_qingming_festival(self, name) -> date:
"""
Add Qingming Festival (15th day after the Spring Equinox).
Expand Down
61 changes: 61 additions & 0 deletions holidays/locale/en_US/LC_MESSAGES/CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Chinese holidays en_US localization.
# Authors: PPsyrius <[email protected]>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.35\n"
"POT-Creation-Date: 2023-09-28 19:23+0700\n"
"PO-Revision-Date: 2023-09-28 19:49+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Translation 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"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.3.2\n"

#. New Year's Day.
msgid "元旦"
msgstr "New Year's Day"

#. National Day.
msgid "国庆节"
msgstr "National Day"

#. Mid-Autumn Festival.
msgid "中秋节"
msgstr "Mid-Autumn Festival"

#. Chinese New Year (Spring Festival).
msgid "春节"
msgstr "Chinese New Year (Spring Festival)"

#. Labor Day.
msgid "劳动节"
msgstr "Labor Day"

#. Tomb-Sweeping Day.
msgid "清明节"
msgstr "Tomb-Sweeping Day"

#. Dragon Boat Festival.
msgid "端午节"
msgstr "Dragon Boat Festival"

#. International Women's Day.
msgid "国际妇女节"
msgstr "International Women's Day"

#. Youth Day.
msgid "五四青年节"
msgstr "Youth Day"

#. Children's Day.
msgid "六一儿童节"
msgstr "Children's Day"

#. Army Day.
msgid "建军节"
msgstr "Army Day"
61 changes: 61 additions & 0 deletions holidays/locale/th/LC_MESSAGES/CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Chinese holidays th localization.
# Authors: PPsyrius <[email protected]>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.35\n"
"POT-Creation-Date: 2023-09-28 19:23+0700\n"
"PO-Revision-Date: 2023-09-28 19:57+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Translation 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"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.3.2\n"

#. New Year's Day.
msgid "元旦"
msgstr "วันปีใหม่สากล"

#. National Day.
msgid "国庆节"
msgstr "วันชาติจีน"

#. Mid-Autumn Festival.
msgid "中秋节"
msgstr "วันไหว้พระจันทร์"

#. Chinese New Year (Spring Festival).
msgid "春节"
msgstr "วันตรุษจีน"

#. Labor Day.
msgid "劳动节"
msgstr "วันแรงงาน"

#. Tomb-Sweeping Day.
msgid "清明节"
msgstr "วันเช็งเม้ง"

#. Dragon Boat Festival.
msgid "端午节"
msgstr "วันไหว้บ๊ะจ่าง"

#. International Women's Day.
msgid "国际妇女节"
msgstr "วันสตรีสากล"

#. Youth Day.
msgid "五四青年节"
msgstr "วันเยาวชนห่งชาติจีน"

#. Children's Day.
msgid "六一儿童节"
msgstr "วันเด็กสากล"

#. Army Day.
msgid "建军节"
msgstr "วันสถาปนากองทัพปลดปล่อยประชาชนจีน"
61 changes: 61 additions & 0 deletions holidays/locale/zh_CN/LC_MESSAGES/CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Chinese holidays.
# Authors: PPsyrius <[email protected]>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.35\n"
"POT-Creation-Date: 2023-09-28 19:23+0700\n"
"PO-Revision-Date: 2023-09-28 19:42+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Translation Team\n"
"Language: zh_CN\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"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.3.2\n"

#. New Year's Day.
msgid "元旦"
msgstr ""

#. National Day.
msgid "国庆节"
msgstr ""

#. Mid-Autumn Festival.
msgid "中秋节"
msgstr ""

#. Chinese New Year (Spring Festival).
msgid "春节"
msgstr ""

#. Labor Day.
msgid "劳动节"
msgstr ""

#. Tomb-Sweeping Day.
msgid "清明节"
msgstr ""

#. Dragon Boat Festival.
msgid "端午节"
msgstr ""

#. International Women's Day.
msgid "国际妇女节"
msgstr ""

#. Youth Day.
msgid "五四青年节"
msgstr ""

#. Children's Day.
msgid "六一儿童节"
msgstr ""

#. Army Day.
msgid "建军节"
msgstr ""
61 changes: 61 additions & 0 deletions holidays/locale/zh_TW/LC_MESSAGES/CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Chinese holidays zh_TW localization.
# Authors: PPsyrius <[email protected]>, (c) 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: Python Holidays 0.35\n"
"POT-Creation-Date: 2023-09-28 19:23+0700\n"
"PO-Revision-Date: 2023-09-28 19:43+0700\n"
"Last-Translator: PPsyrius <[email protected]>\n"
"Language-Team: Python Holidays Translation Team\n"
"Language: zh_TW\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"
"Generated-By: Lingua 4.15.0\n"
"X-Generator: Poedit 3.3.2\n"

#. New Year's Day.
msgid "元旦"
msgstr "元旦"

#. National Day.
msgid "国庆节"
msgstr "國慶日"

#. Mid-Autumn Festival.
msgid "中秋节"
msgstr "中秋節"

#. Chinese New Year (Spring Festival).
msgid "春节"
msgstr "春節"

#. Labor Day.
msgid "劳动节"
msgstr "勞動節"

#. Tomb-Sweeping Day.
msgid "清明节"
msgstr "清明節"

#. Dragon Boat Festival.
msgid "端午节"
msgstr "端午節"

#. International Women's Day.
msgid "国际妇女节"
msgstr "國際婦女節"

#. Youth Day.
msgid "五四青年节"
msgstr "五四青年節"

#. Children's Day.
msgid "六一儿童节"
msgstr "六一兒童節"

#. Army Day.
msgid "建军节"
msgstr "建軍節"
Loading

0 comments on commit 5c3ac9e

Please sign in to comment.