Skip to content

feat: add Hindi (hi) localization support #902

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gjaynir0508
Copy link

Add Localization Support for Hindi (hi) (Indian Language)

This PR adds Hindi (hi) locale support for Pendulum's date and time formatting.

Includes:

  • Full translations for relative time phrases (ago, in, before, after)
  • Abbreviated and full month/day names
  • Date/time format definitions (L, LL, etc.)
  • Patterns similar to existing locales

Note:
Hindi typically does not use ordinal indicators (like "1st", "2nd") in standard date or time expressions.
As such, this PR omits ordinal mappings (Do, Qo, etc.) for now.

If needed in future use cases (like grammatical sentence generation or quarter formatting), a limited ordinal map can be added later.

Tested against typical diff_for_humans() and formatting scenarios.

Let me know if any adjustments are needed!

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code. (Not Applicable)

@gjaynir0508
Copy link
Author

Note: I noticed that the clock utility currently doesn't specify encoding when opening files.
For certain environments (especially on Windows) this can cause issues when reading locale files that contain Unicode (e.g., Hindi).

While it's not included in this PR to keep the scope limited to locale data, I suggest updating the open() calls in the clock utility to:

open(path, "w", encoding="utf-8")

Copy link

codspeed-hq bot commented Jun 12, 2025

CodSpeed Performance Report

Merging #902 will not alter performance

Comparing gjaynir0508:hindi-localization (22c2662) with master (fc386be)

Summary

✅ 1 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant