+
Skip to content

Update Hong Kong holidays: standardizes en_US l10n with China's and Macau's implementation #2326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Mar 5, 2025

Proposed change

Standardizes Hong Kong's en_US l10n based on China's and Macau's ( #2323 ) implementation, as suggested by @KJhellico; en_HK on the other hand has been kept as-is as issued by Hong Kong S.A.R. government's own sources.

Type of change

  • New country/market holidays support (thank you!)
  • Supported country/market holidays update (calendar discrepancy fix, localization)
  • Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
  • Dependency update (version deprecation/pin/upgrade)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (a code change causing existing functionality to break)
  • New feature (new holidays functionality in general)

Checklist

@PPsyrius PPsyrius marked this pull request as ready for review March 5, 2025 03:54
Copy link
Contributor

coderabbitai bot commented Mar 5, 2025

Summary by CodeRabbit

  • Documentation
    • Revised holiday names and descriptions across multiple localizations for improved clarity and cultural relevance. Terms like "Chinese Mid-Autumn Festival" have been updated to "Mid-Autumn Festival," and similar adjustments were made for other holidays to ensure consistency.
  • Tests
    • Aligned test cases with the new naming conventions to maintain consistency with the updated holiday representations.

Walkthrough

The changes standardize holiday naming conventions across the codebase. In the core holiday definitions, comments have been updated to remove or adjust terms such as "Chinese" from holiday names. Corresponding translation files for multiple locales have had their version numbers, PO revision dates, and holiday name strings updated to reflect these changes. Additionally, test cases have been renamed and updated to match the new standardized naming, ensuring consistency throughout the project. No functional or logic changes have been introduced.

Changes

File(s) Change Summary
holidays/countries/hongkong.py Updated holiday comments to use standardized naming (e.g., "Chinese Mid-Autumn Festival" → "Mid-Autumn Festival", "Lunar New Year's Day" → "Chinese New Year", etc.)
holidays/locale/.../LC_MESSAGES/HK.po (en_HK, en_US, th, zh_CN, zh_HK) Updated version (0.67 → 0.69) and PO revision dates; modified translation strings and comments to align holiday names with standardized naming (e.g., "Ching Ming Festival" → "Tomb-Sweeping Day", adjustments to descriptions for holiday days, etc.)
tests/countries/test_hongkong.py Renamed test methods (e.g., test_first_day_of_januarytest_new_years_day, test_lunar_new_yeartest_chinese_new_year, etc.) and updated localized assertions to reflect the new holiday naming conventions

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f52858 and 9bdbf97.

📒 Files selected for processing (7)
  • holidays/countries/hongkong.py (9 hunks)
  • holidays/locale/en_HK/LC_MESSAGES/HK.po (5 hunks)
  • holidays/locale/en_US/LC_MESSAGES/HK.po (5 hunks)
  • holidays/locale/th/LC_MESSAGES/HK.po (5 hunks)
  • holidays/locale/zh_CN/LC_MESSAGES/HK.po (5 hunks)
  • holidays/locale/zh_HK/LC_MESSAGES/HK.po (5 hunks)
  • tests/countries/test_hongkong.py (8 hunks)
🔇 Additional comments (74)
holidays/locale/th/LC_MESSAGES/HK.po (17)

17-17: Project version increment looks correct.

This update increases the version from 0.67 to 0.69, which appears consistent with the localization standardization effort.


19-19: Recent revision date confirmed.

PO-Revision-Date has been properly updated to reflect the latest changes to the file.


34-36: Standardized name format for Mid-Autumn Festival follow-up day.

The comment now consistently uses "The Day following Mid-Autumn Festival" without the "Chinese" qualifier, matching the naming convention used for China and Macau implementations.


38-40: Standardized name format for second follow-up day.

Consistent with other changes, "The Second Day following Mid-Autumn Festival" properly removes the "Chinese" qualifier for standardization.


42-44: Main Mid-Autumn Festival naming standardized.

The modification simplifies the comment to "Mid-Autumn Festival" without the "Chinese" qualifier, aligning with the PR objective.


46-48: New Year terminology updated for consistency.

Changed from likely "Lunar New Year's Day" to "Chinese New Year", which standardizes the naming with China and Macau implementations as intended.


50-52: Eve terminology updated to match main holiday.

The change to "Chinese New Year's Eve" maintains consistency with the updated main holiday name.


54-56: Standardized naming for Chinese New Year sequence.

The comments for second, third, and fourth days of Chinese New Year have been updated with consistent terminology that aligns with the main holiday's new name.

Also applies to: 58-60, 62-64


66-68: Western New Year's Day naming standardized.

Consistency in naming for "New Year's Day" maintained across localization files.


82-84: Cultural festival name standardized.

"Tomb-Sweeping Day" is now used instead of likely "Ching Ming Festival", providing a more standardized term across implementations.


86-88: Buddha's Birthday naming convention updated.

Changed from likely "The Birthday of the Buddha" to "The Buddha's Birthday" for consistency across localizations.


94-96: Dragon Boat Festival naming standardized.

Updated from likely "Tuen Ng Festival" to "Dragon Boat Festival", aligning with naming conventions used in China and Macau implementations.


98-100: Hong Kong S.A.R. naming standardized.

The comment now uses a consistent abbreviation format across all localizations.


102-104: Double Ninth Festival naming standardized.

Consistent terminology used for this traditional festival across all localizations.


110-112: Winter Solstice naming standardized.

Consistent naming applied for this seasonal holiday.


122-124: "Following day" terminology standardized across all holidays.

All "day following" comments have been updated with consistent naming that mirrors their respective main holidays, maintaining clear relationships between related holidays.

Also applies to: 126-128, 134-136, 142-144, 146-148, 150-152


190-197: Expanded war anniversary description for clarity.

The full title "70th Anniversary of the Victory of the Chinese People's War of Resistance against Japanese Aggression and the World Anti-Fascist War" is now properly documented, providing better context for translators.

holidays/locale/zh_CN/LC_MESSAGES/HK.po (11)

17-17: Project version increment matches other localization files.

The version has been properly updated from 0.67 to 0.69, maintaining consistency across localization files.


19-19: Revision date synchronized with other localization files.

The PO-Revision-Date update to 2025-03-05 matches the date in the Thai localization file, ensuring version control consistency.


34-36: Mid-Autumn Festival naming standardization in Simplified Chinese.

The comments for Mid-Autumn Festival and following days have been standardized without the "Chinese" qualifier, consistent with other localization files.

Also applies to: 38-40, 42-44


46-48: Chinese New Year terminology consistently applied.

All references to the Lunar New Year and its related days now use "Chinese New Year" terminology in the comments, creating consistency across all localization files.

Also applies to: 50-52, 54-56, 58-60, 62-64


66-68: New Year's Day standard naming.

The Western calendar New Year's Day naming is consistently applied.


82-84: Tomb-Sweeping Day standardized naming.

The comment now uses the standardized "Tomb-Sweeping Day" terminology instead of "Ching Ming Festival".


86-88: Buddha's Birthday naming convention standardized.

The naming convention has been updated to use "The Buddha's Birthday" format.


94-96: Dragon Boat Festival standard terminology.

Updated to use "Dragon Boat Festival" terminology for consistency.


98-100: Administrative and traditional festivals naming standardized.

Hong Kong S.A.R. Establishment Day, Double Ninth Festival, and Winter Solstice all use consistent terminology across localization files.

Also applies to: 102-104, 110-112


122-124: "Following day" terminology standardization.

All comments for days following major holidays use consistent phrasing that matches the parent holiday naming.

Also applies to: 126-128, 134-136, 142-144, 146-148, 150-152


190-194: War anniversary description expanded for clarity.

The comment now provides the complete official name of the anniversary for proper context.

holidays/locale/zh_HK/LC_MESSAGES/HK.po (9)

17-17: Version number increment properly applied.

The version update from 0.67 to 0.69 maintains consistency across all localization files.


19-19: Revision date matches other localization files.

The PO-Revision-Date update maintains synchronization across all related files.


34-36: Mid-Autumn Festival standardized terminology.

The comments for Mid-Autumn Festival and its following days now use consistent terminology without the "Chinese" qualifier.

Also applies to: 38-40, 42-44


46-48: Chinese New Year standardized naming applied.

All references to Lunar New Year and its related days now use consistent "Chinese New Year" terminology in comments.

Also applies to: 50-52, 54-56, 58-60, 62-64


66-68: New Year's Day consistent naming.

Western calendar New Year terminology standardized.


82-84: Traditional festival terminology standardized.

Tomb-Sweeping Day, Buddha's Birthday, and Dragon Boat Festival all use consistent naming conventions across localization files.

Also applies to: 86-88, 94-96


98-100: Administrative and seasonal holiday standardization.

Hong Kong S.A.R. Establishment Day, Double Ninth Festival, and Winter Solstice all use consistent terminology.

Also applies to: 102-104, 110-112


122-124: "Following day" terminology consistency maintained.

Comments for days following holidays use standardized phrasing across all files.

Also applies to: 126-128, 134-136, 142-144, 146-148, 150-152


190-194: War anniversary description properly expanded.

The multi-line comment now provides complete context for this historical commemoration.

holidays/countries/hongkong.py (17)

89-90: Mid-Autumn Festival terminology standardized in core implementation.

All references to the Mid-Autumn Festival and its following days have been updated to remove the "Chinese" qualifier, matching the localization files and creating consistency throughout the codebase.

Also applies to: 94-97, 99-102


115-124: Chinese New Year terminology standardized.

Updated references to Lunar New Year to consistently use "Chinese New Year" throughout the implementation, aligned with the standardization in localization files.


159-160: New Year's Day naming standardized.

Western calendar New Year's Day terminology consistent with localization files.


176-177: Tomb-Sweeping Day standardized terminology.

Updated from likely "Ching Ming Festival" to "Tomb-Sweeping Day" to maintain naming consistency.


180-181: Buddha's Birthday naming convention updated.

Changed from likely "The Birthday of the Buddha" to "The Buddha's Birthday" for consistent naming across the codebase.


187-188: Dragon Boat Festival naming standardized.

Updated from likely "Tuen Ng Festival" to "Dragon Boat Festival" for consistency.


191-192: Hong Kong S.A.R. Establishment Day abbreviation standardized.

The naming convention now uses consistent abbreviation format.


197-199: Double Ninth Festival standardized terminology.

Consistent naming applied for this traditional festival.


214-215: Winter Solstice naming standardized.

Comment updated to use consistent terminology.


229-233: New Year's Day and following day terminology standardized.

The comments for New Year's Day and its following day use consistent naming.


240-244: Tomb-Sweeping Day and following day terminology standardized.

Both the main holiday and following day comments have been updated with consistent terminology.


262-266: Buddha's Birthday and following day terminology standardized.

Main holiday and following day comments consistently use "The Buddha's Birthday" format.


279-283: Dragon Boat Festival and following day terminology standardized.

Both the main holiday and following day comments now use consistent "Dragon Boat Festival" terminology.


287-291: Hong Kong S.A.R. Establishment Day and following day standardized.

The abbreviation format is consistently applied in both the main holiday and following day comments.


298-302: Double Ninth Festival and following day terminology standardized.

Consistent naming convention applied for both the main festival and its following day.


403-404: Hong Kong S.A.R. Establishment Day following day in static definitions.

The comment for the following day variable also updates the abbreviation format for consistency.


406-408: War anniversary expanded description.

The multi-line comment now properly documents the full official name of this historical commemoration.

tests/countries/test_hongkong.py (8)

55-55: Method name updated to reflect standard holiday naming.

The test method has been renamed from test_first_day_of_january to test_new_years_day to better align with the standardized holiday naming convention used across the codebase.


101-101: Method name standardized to match Chinese New Year naming.

The test method has been renamed from test_lunar_new_year to test_chinese_new_year for consistency with how this holiday is referenced in China and Macau implementations.


374-374: Method name updated to use internationally recognized term.

Changed from test_ching_ming_festival to test_tomb_sweeping_day to use the more widely recognized international name for this holiday.


469-469: Method name standardized for Buddha's Birthday.

Renamed from test_birthday_of_buddha to test_the_buddhas_birthday to maintain consistent naming conventions with other localization files.


561-561: Method name updated to international standard.

Test method renamed from test_tuen_ng_festival to test_dragon_boat_festival to use the more globally recognized name for this holiday.


633-633: Method name updated for HKSAR establishment day.

Test method renamed to better align with standardized naming convention used for this holiday across localization files.


737-737: Method name standardized for Double Ninth Festival.

Updated method name to use the internationally recognized term for this traditional Chinese holiday.


1463-1477: Updated en_US localized holiday names to match standardization objectives.

The English (US) localizations have been properly updated to match the standardized naming conventions, aligning with how these holidays are referenced in China and Macau implementations. The changes consistently remove redundant qualifiers and use more internationally recognized terminology.

holidays/locale/en_HK/LC_MESSAGES/HK.po (6)

17-19: Version and revision date updated accordingly.

Version number incremented from 0.67 to 0.69 and revision date updated to reflect current changes.


34-45: Comment updates for Mid-Autumn Festival related entries.

Comments have been updated to use the standardized naming convention while preserving the original translations. This approach aligns with the PR objective to standardize comments without changing the en_HK localization outputs.


46-64: Comment updates for Chinese New Year entries.

Comments have been updated to use "Chinese New Year" terminology in place of "Lunar New Year" while maintaining original translations. This maintains consistency with other files while preserving the official Hong Kong government naming in the translations.


66-68: Comments updated for remaining holiday entries.

Comment lines have been standardized to match naming conventions used in other locales while preserving the original Hong Kong government approved translations in the message strings.

Also applies to: 82-84, 86-88, 94-96, 98-100, 102-104, 110-112


122-153: Comments updated for "day following" holiday entries.

All comments for holidays that follow other holidays have been standardized to match the new naming conventions, maintaining consistency throughout the file.


191-197: Expanded comment for historical commemorative day.

The comment has been expanded to include "and the World Anti-Fascist War" to provide more complete context for this historical commemoration, while maintaining the original translation.

holidays/locale/en_US/LC_MESSAGES/HK.po (6)

17-19: Version and revision date updated accordingly.

Version number incremented from 0.67 to 0.69 and revision date updated to reflect current changes.


34-45: Updated Mid-Autumn Festival related translations.

The translations have been appropriately modified to remove "Chinese" qualifier from Mid-Autumn Festival references, aligning with the standardization objective of the PR.


46-64: Updated Chinese New Year related translations.

All references to "Lunar New Year" have been standardized to "Chinese New Year" in the translations, which aligns with how this holiday is referenced in China and Macau implementations.


66-69: Updated translations for core holidays.

The translations have been appropriately standardized:

  • "New Year's Day" instead of "The first day of January"
  • "Tomb-Sweeping Day" instead of "Ching Ming Festival"
  • "The Buddha's Birthday" instead of "The Birthday of the Buddha"
  • "Dragon Boat Festival" instead of "Tuen Ng Festival"
  • "Hong Kong S.A.R. Establishment Day" (shortened form)
  • "Double Ninth Festival" instead of "Chung Yeung Festival"
  • "Winter Solstice" instead of "Chinese Winter Solstice Festival"

These changes maintain consistency with China and Macau implementations.

Also applies to: 82-89, 94-105, 110-113


122-153: Updated "day following" holiday translations.

All translations for days following holidays have been standardized to match the new naming conventions for their parent holidays, maintaining consistency throughout the file.


190-196: Standardized commemorative day translation.

The translation for the 70th Anniversary has been expanded and standardized to include "and the World Anti-Fascist War", providing more complete context.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

sonarqubecloud bot commented Mar 5, 2025

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3f52858) to head (9bdbf97).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2326   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          201       201           
  Lines        12374     12374           
  Branches      1775      1775           
=========================================
  Hits         12374     12374           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@KJhellico KJhellico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great l10n work 👍

@arkid15r arkid15r added this pull request to the merge queue Mar 5, 2025
Merged via the queue into vacanza:dev with commit 8285586 Mar 5, 2025
33 checks passed
@PPsyrius PPsyrius deleted the hk_en_us_standard branch March 6, 2025 01:54
@KJhellico KJhellico mentioned this pull request Mar 17, 2025
@coderabbitai coderabbitai bot mentioned this pull request Mar 19, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载