+
Skip to content

Update Timor-Leste holidays: add en_TL, th l10n, update en_US l10n #2407

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 2 commits into from
Apr 4, 2025

Conversation

PPsyrius
Copy link
Collaborator

@PPsyrius PPsyrius commented Apr 3, 2025

Proposed change

Updates Timor-Leste en_US l10n as per discussed in #2394 with @KJhellico , as well as adding source-accurate en_TL and th l10n.

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

Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced additional localization support for Timor-Leste holidays with new language options, including a specific English variant and Thai.
  • Documentation

    • Updated the supported languages list in user-facing materials to reflect the recent language additions and reordering for clarity.
  • Style

    • Standardized holiday names by adopting internationally recognized terminology for key holidays such as Labor Day, Children’s Day, and Human Rights Day.

Walkthrough

This pull request updates the supported languages for Timor Leste by adding the en_TL English variant and the Thai language (th). The changes are applied consistently across the documentation, country-specific holiday definitions, translation files, and test cases. Additionally, holiday naming is standardized by replacing "World" with "International" in both comments and translation entries. Administrative metadata such as version numbers, revision dates, and translator details have also been updated in several files.

Changes

File(s) Change Summary
README.md Updated supported languages list for Timor Leste; added en_TL and th, and reordered language entries.
holidays/countries/timor_leste.py Revised supported_languages attribute to include en_TL and th; updated holiday name comments from "World" to "International".
holidays/locale/{en_US, pt_TL, tet}/LC_MESSAGES/TL.po Updated metadata (project version, revision date, translator, generator) and standardized holiday names by replacing "World" with "International".
holidays/locale/{en_TL, th}/LC_MESSAGES/TL.po Added new localization files for the en_TL (Timor Leste English variant) and Thai (th) languages.
snapshots/countries/TL_COMMON.json Renamed holiday designations from "World" to "International" across multiple dates.
tests/countries/test_timor_leste.py Consolidated assertions in test_no_holidays; added new methods (test_l10n_en_tl, test_l10n_th) for checking localized holiday names; updated holiday names in tests from "World" to "International".

Possibly related PRs

  • Update Pakistan holidays: add l10n support (en_PK, en_US, ur_PK) #2385: The changes in the main PR regarding the supported languages for Timor Leste are directly related to the modifications in the supported_languages attribute in the retrieved PR for Pakistan, as both involve updating language codes in their respective files.
  • Update Philippines holidays: adjust Bonifacio Day for 2023 #2370: The changes in the main PR regarding the supported languages for Timor Leste are related to the modifications in the supported_languages attribute in the retrieved PR, as both involve updates to language codes in their respective files.
  • Reformat BY.po files #2365: The changes in the main PR are related to the updates in the supported_languages attribute in the holidays/countries/timor_leste.py file, which directly corresponds to the modifications made in the main PR regarding supported languages.

Suggested reviewers

  • KJhellico

📜 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 9e18c7c and bd2508e.

📒 Files selected for processing (8)
  • holidays/countries/timor_leste.py (4 hunks)
  • holidays/locale/en_TL/LC_MESSAGES/TL.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TL.po (3 hunks)
  • holidays/locale/pt_TL/LC_MESSAGES/TL.po (4 hunks)
  • holidays/locale/tet/LC_MESSAGES/TL.po (4 hunks)
  • holidays/locale/th/LC_MESSAGES/TL.po (1 hunks)
  • snapshots/countries/TL_COMMON.json (75 hunks)
  • tests/countries/test_timor_leste.py (5 hunks)
🧰 Additional context used
🧠 Learnings (5)
holidays/locale/tet/LC_MESSAGES/TL.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: holidays/locale/en_TL/LC_MESSAGES/TL.po:42-44
Timestamp: 2025-04-03T05:58:01.573Z
Learning: The en_TL (English for Timor-Leste) localization for holidays intentionally uses "World" instead of "International" (e.g., "World Labour Day") to maintain accuracy with official Timor-Leste government sources, even though code comments and other localizations like en_US use "International".
holidays/locale/pt_TL/LC_MESSAGES/TL.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: holidays/locale/en_TL/LC_MESSAGES/TL.po:42-44
Timestamp: 2025-04-03T05:58:01.573Z
Learning: The en_TL (English for Timor-Leste) localization for holidays intentionally uses "World" instead of "International" (e.g., "World Labour Day") to maintain accuracy with official Timor-Leste government sources, even though code comments and other localizations like en_US use "International".
holidays/locale/th/LC_MESSAGES/TL.po (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: holidays/locale/en_TL/LC_MESSAGES/TL.po:42-44
Timestamp: 2025-04-03T05:58:01.573Z
Learning: The en_TL (English for Timor-Leste) localization for holidays intentionally uses "World" instead of "International" (e.g., "World Labour Day") to maintain accuracy with official Timor-Leste government sources, even though code comments and other localizations like en_US use "International".
holidays/locale/en_TL/LC_MESSAGES/TL.po (2)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: holidays/locale/en_TL/LC_MESSAGES/TL.po:42-44
Timestamp: 2025-04-03T05:58:01.573Z
Learning: The en_TL (English for Timor-Leste) localization for holidays intentionally uses "World" instead of "International" (e.g., "World Labour Day") to maintain accuracy with official Timor-Leste government sources, even though code comments and other localizations like en_US use "International".
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: holidays/locale/en_TL/LC_MESSAGES/TL.po:42-44
Timestamp: 2025-04-03T05:58:01.572Z
Learning: The en_TL (English for Timor-Leste) localization for holidays intentionally uses "World" instead of "International" (e.g., "World Labour Day") to maintain accuracy with official Timor-Leste government sources, even though code comments and other localizations like en_US use "International".
snapshots/countries/TL_COMMON.json (1)
Learnt from: PPsyrius
PR: vacanza/holidays#2407
File: snapshots/countries/TL_COMMON.json:7-7
Timestamp: 2025-04-03T05:59:57.480Z
Learning: In the holidays project, snapshot files (like snapshots/countries/TL_COMMON.json) are auto-generated when running `make snapshot` and should not be manually edited. Semicolons (;) in holiday entries are used as separators when multiple holidays occur on the same date.
🧬 Code Definitions (1)
tests/countries/test_timor_leste.py (3)
holidays/countries/timor_leste.py (1)
  • TimorLeste (27-182)
tests/countries/test_indonesia.py (1)
  • test_l10n_th (600-623)
tests/countries/test_brunei.py (1)
  • test_l10n_th (217-238)
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: Test build on windows-latest
🔇 Additional comments (31)
holidays/locale/th/LC_MESSAGES/TL.po (6)

1-28: Well-structured Thai localization for Timor-Leste holidays

The metadata section is complete with all necessary project information, version details, and translator information. Good attention to detail in setting up the proper encoding and language specifications.


42-44: Correct terminology in Thai translation

The Thai translation uses "วันแรงงานสากล" which correctly translates to "International Worker's Day" while the Portuguese source uses "Mundial" (World). This ensures consistency with the standardized terminology in the code comments.


47-48: Clear and accurate translation of complex holiday name

The translation "วันรำลึกการกอบกู้เอกราชติมอร์-เลสเต" accurately conveys the meaning of "Restoration of Independence Day" in Thai, including the context of remembrance associated with this national holiday.


79-80: Thorough translation of religious holiday name

The Thai translation effectively captures the full religious context of "Day of Our Lady of Immaculate Conception and Timor-Leste Patroness" with appropriate religious terminology.


110-112: Consistent terminology for international observance

"วันเด็กสากล" correctly translates to "International Children's Day" while maintaining consistency with the standardized terminology pattern in comments.


119-121: Correctly translated international observance

"วันสิทธิมนุษยชนสากล" correctly translates to "International Human Rights Day," maintaining consistency with the comment style.

holidays/locale/tet/LC_MESSAGES/TL.po (4)

17-27: Properly updated metadata information

The project version has been updated to 0.70, revision date changed to the current date, and translator information has been updated. These consistent metadata updates align with the other localization files.


42-44: Updated comment terminology while preserving translation

The comment now uses "International Worker's Day" instead of "World Worker's Day" for standardization across files, while correctly preserving the original Tetum translation "Loron Mundiál Serbisu-na'in sira nian".


110-112: Standardized comment terminology

Updated comment from "World Children's Day" to "International Children's Day" for consistency, while maintaining the original Tetum translation "Loron Mundial ba Labarik".


119-121: Consistent terminology update in comment

Updated comment from "World Human Rights Day" to "International Human Rights Day" for standardization, preserving the existing Tetum translation "Loron Mundiál Direitu Umanu".

holidays/locale/en_TL/LC_MESSAGES/TL.po (4)

1-28: Well-structured new English localization for Timor-Leste

The metadata section is complete with all necessary project information, version, and translation details. This new localization file for English specific to Timor-Leste is a valuable addition to the project.


42-44: Source-accurate terminology maintained

The use of "World Labour Day" instead of "International Labour Day" correctly follows official Timor-Leste government sources, as documented in the PR discussion and learnings. This deliberate choice maintains source accuracy even though the comments use "International".


110-112: Source-accurate terminology preserved

The use of "World Children's Day" is consistent with official Timor-Leste terminology, aligning with the approach taken for other holiday names in this locale.


119-121: Source-accurate terminology maintained

"World Human Rights Day" follows Timor-Leste's official terminology conventions, maintaining consistency with the other holiday translations in this locale.

holidays/locale/pt_TL/LC_MESSAGES/TL.po (4)

17-27: Properly updated metadata information

The project version has been updated to 0.70, revision date changed to the current date, and translator information has been updated. These metadata updates are consistent with changes across all localization files.


42-44: Standardized comment terminology

The comment has been updated from "World Worker's Day" to "International Worker's Day" for standardization across the project while keeping the original Portuguese msgid intact.


110-112: Standardized comment terminology for consistency

Updated comment from "World Children's Day" to "International Children's Day" to maintain consistency across the project's comments.


119-121: Consistent terminology update in comment

Updated comment from "World Human Rights Day" to "International Human Rights Day" for standardization across the project's documentation.

holidays/countries/timor_leste.py (4)

51-51: LGTM: Language support expansion for Timor-Leste.

The addition of "en_TL" and "th" languages is well-aligned with the PR objective to enhance localization support. The ordering with en_TL first also makes sense as a country-specific English variant.


83-83: Standardized holiday naming from "World" to "International".

This change improves naming consistency across holidays and aligns with KJhellico's suggestion in previous comments.


153-153: Standardized holiday naming from "World" to "International".

Consistent with the earlier changes to standardize holiday naming.


170-170: Standardized holiday naming from "World" to "International".

Final instance of standardizing the naming convention for global holidays.

tests/countries/test_timor_leste.py (4)

30-30: Code simplification: Combined category assertions.

Good simplification that reduces code duplication by checking both GOVERNMENT and WORKDAY categories in a single assertion.


608-648: Added tests for new en_TL localization.

Complete test coverage for the newly added English (Timor-Leste) language variant. All holiday names are properly localized and consistent with the existing English variants.


664-664: Updated holiday names in en_US tests for consistency.

The test now correctly uses "International" instead of "World" in the holiday names, matching the changes made in the source files.

Also applies to: 669-669, 686-686


731-768: Added tests for new Thai localization.

Comprehensive test coverage for the Thai language implementation. The test structure follows the same pattern as other language tests in the codebase (like those in test_brunei.py and test_indonesia.py).

holidays/locale/en_US/LC_MESSAGES/TL.po (4)

17-27: Updated project metadata.

Version number, revision date, translator information, and generator version have been properly updated to reflect the latest changes.


42-44: Standardized "Worker's Day" naming.

Changed from "World Labor Day" to "International Worker's Day" for consistency with other holiday names and international standards.


110-112: Standardized "Children's Day" naming.

Changed from "World Children's Day" to "International Children's Day" for consistency.


119-121: Standardized "Human Rights Day" naming.

Changed from "World Human Rights Day" to "International Human Rights Day" for consistency.

snapshots/countries/TL_COMMON.json (1)

7-1140:

✅ Verification successful

Consistent Holiday Renaming Across All Years

All the updated holiday names now use the “International” prefix instead of “World” (for example, "International Worker's Day", "International Children's Day", and "International Human Rights Day") consistently throughout the file—from 2006 up to 2050. The composite entries, such as the one on line 51 where “International Worker's Day” is combined with “The Day of Ascension of Jesus Christ into Heaven” via a semicolon, correctly follow the established auto‐generation process and the intended use of semicolon separators.

Since snapshot files are automatically generated by running make snapshot (and not meant to be manually edited), please double-check that these changes exactly reflect the output of that process and align with the updated l10n guidelines discussed in PR #2407. Overall, these updates look consistent and meet the PR objectives.


Below is a shell script to verify that no instance of the legacy “World” prefix remains in the file:

#!/bin/bash
grep "World" snapshots/countries/TL_COMMON.json || echo "No 'World' entries found."

Assuming this script returns no output (aside from the echo confirmation), we can conclude that every holiday uses the “International” prefix as intended. The composite entries (e.g., using semicolon-delimited holidays) also appear to follow the auto-generation process described in PR #2407.

Approved: Holiday Name Update Verified
The file consistently uses the “International” prefix (e.g., "International Worker's Day", "International Children's Day", and "International Human Rights Day") across all entries from 2006 to 2050.

Overall, these updates look consistent and correctly reflect the automated output from make snapshot.

✨ 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 plan to trigger planning for file edits and PR creation.
  • @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

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ee26941) to head (bd2508e).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2407   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          208       208           
  Lines        13244     13244           
  Branches      1899      1899           
=========================================
  Hits         13244     13244           

☔ 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
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ee26941 and 9e18c7c.

📒 Files selected for processing (9)
  • README.md (1 hunks)
  • holidays/countries/timor_leste.py (4 hunks)
  • holidays/locale/en_TL/LC_MESSAGES/TL.po (1 hunks)
  • holidays/locale/en_US/LC_MESSAGES/TL.po (3 hunks)
  • holidays/locale/pt_TL/LC_MESSAGES/TL.po (4 hunks)
  • holidays/locale/tet/LC_MESSAGES/TL.po (4 hunks)
  • holidays/locale/th/LC_MESSAGES/TL.po (1 hunks)
  • snapshots/countries/TL_COMMON.json (75 hunks)
  • tests/countries/test_timor_leste.py (5 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/countries/test_timor_leste.py (3)
holidays/countries/timor_leste.py (1)
  • TimorLeste (27-182)
tests/countries/test_indonesia.py (1)
  • test_l10n_th (600-623)
tests/countries/test_brunei.py (1)
  • test_l10n_th (217-238)
🔇 Additional comments (17)
README.md (1)

1155-1155: Addition of new supported languages for Timor Leste

The update adds en_TL and th to the list of supported languages for Timor Leste, aligning with the PR objectives to enhance localization support.

holidays/locale/th/LC_MESSAGES/TL.po (1)

1-165: New Thai localization file for Timor Leste holidays

This new localization file adds proper Thai translations for all Timor Leste holidays, enhancing the library's internationalization capabilities. The translations appear accurate and follow the proper structure for PO files.

holidays/locale/tet/LC_MESSAGES/TL.po (2)

17-17: Updated metadata information

Project version, revision date, and generator version have been properly updated, along with translator information.

Also applies to: 19-20, 27-27


42-42: Standardized holiday name comments

The comments have been updated to use "International" instead of "World" for labor, children's, and human rights days, providing consistent terminology across localization files.

Also applies to: 110-110, 119-119

holidays/locale/en_TL/LC_MESSAGES/TL.po (1)

1-165: New English (Timor Leste) localization file

This new localization file provides English translations specific to Timor Leste, enhancing the regional language support as intended in the PR objectives.

holidays/locale/pt_TL/LC_MESSAGES/TL.po (2)

17-17: Metadata updates look good.

Updated version number, revision date, translator information, and generator version successfully reflect this contribution.

Also applies to: 19-20, 27-27


42-42: Consistent terminology update from "World" to "International".

The update from "World" to "International" for these holiday comments is consistent with changes in other localization files and aligns with standard terminology.

Also applies to: 110-110, 119-119

holidays/countries/timor_leste.py (2)

51-51: Language support expansion looks good.

Successfully added "en_TL" and "th" to the supported languages attribute while preserving existing languages. The sequence also matches the documentation updates.


83-83: Consistent terminology change from "World" to "International".

The comment updates properly align with the terminology changes in the localization files and maintain consistency across the codebase.

Also applies to: 153-153, 170-170

tests/countries/test_timor_leste.py (4)

30-30: Code simplification in test_no_holidays is good.

Consolidated multiple assertions into a single assertion that simultaneously tests for both GOVERNMENT and WORKDAY categories, making the code more concise.


608-648: Well-implemented test for en_TL localization.

The new test method thoroughly validates the English for Timor-Leste localization with comprehensive holiday coverage. This supports the PR's objective of adding en_TL support.


664-664: Consistent terminology updates in test assertions.

The holiday name updates from "World" to "International" in the en_US test assertions align with the changes made to the localization files.

Also applies to: 669-669, 686-686


731-768: Well-implemented test for Thai localization.

The new test method provides thorough validation of Thai holiday names, following similar patterns seen in tests for other languages like Indonesian and Brunei. This supports the PR's objective to add Thai language support.

holidays/locale/en_US/LC_MESSAGES/TL.po (2)

17-17: Metadata updates look good.

Updated version number, revision date, translator information, and generator version successfully reflect this contribution.

Also applies to: 19-20, 27-27


42-44: Consistent terminology and translation updates.

The changes from "World" to "International" for holiday names are well-implemented and consistently applied across all relevant holiday entries.

Also applies to: 110-112, 119-121

snapshots/countries/TL_COMMON.json (2)

10-10: Uniform Renaming for Children’s Day
The holiday formerly labeled as “World Children's Day” has been updated uniformly to “International Children's Day” (e.g. at 2006-06-01 on line 10 and 2007-06-01 on line 32, with similar changes later). This change appears consistent across the dataset and supports the new localization standards.

Also applies to: 32-32, 74-74


22-22: Standardizing Human Rights Day Naming
The holiday now reads “International Human Rights Day” (as seen at 2006-12-10 on line 22, 2007-12-10 on line 44, and 2008-12-10 on line 65), replacing any previous “World Human Rights Day” variations. This consistent update supports clarity in the holiday naming conventions.

Also applies to: 44-44, 65-65

@PPsyrius PPsyrius requested a review from KJhellico April 3, 2025 09:42
Copy link

sonarqubecloud bot commented Apr 3, 2025

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.

@arkid15r arkid15r added this pull request to the merge queue Apr 4, 2025
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.

LGTM 👍

Merged via the queue into vacanza:dev with commit 51d8be5 Apr 4, 2025
33 checks passed
@PPsyrius PPsyrius deleted the timor_leste_l10n_standard branch April 4, 2025 00:46
@arkid15r arkid15r mentioned this pull request Apr 7, 2025
@coderabbitai coderabbitai bot mentioned this pull request Jul 9, 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浏览器服务,不要输入任何密码和下载