Skip to content

Add Sinhala (si_LK) locale - #360

Merged
hugovk merged 1 commit into
python-humanize:mainfrom
RavinduPabasara:feature/si_LK-locale
Jul 25, 2026
Merged

Add Sinhala (si_LK) locale#360
hugovk merged 1 commit into
python-humanize:mainfrom
RavinduPabasara:feature/si_LK-locale

Conversation

@RavinduPabasara

Copy link
Copy Markdown
Contributor

Adds a Sinhala (si_LK) locale — the language of ~17 million speakers in Sri Lanka, previously unsupported by humanize.

Changes proposed in this pull request:

  • Add src/humanize/locale/si_LK/LC_MESSAGES/humanize.po translating all time, number-scale and file-size phrases into formal written Sinhala, verified by a native speaker.
  • Add Sinhala to the localized-languages list in README.md (alphabetical position).
  • Add Sinhala coverage to tests/test_i18n.py (naturaltime, precisedelta, intword, naturalsize).

Notes for reviewers:

  • Plural rule follows CLDR for Sinhala: nplurals=2; plural=(n > 1);.
  • A grammatical subtlety worth knowing: Sinhala marks "ago"/"from now" with a case suffix on the duration (පැයකට පෙර = "an hour ago", පැය 2කට පෙර = "2 hours ago"). Because gettext does plain substitution and cannot perform සන්ධි (morphophonemic joining), the single-unit forms (an hour, a minute, …) are rendered as bare nouns (පැය, විනාඩිය) so they compose correctly through %s ago / %s from now. This makes every naturaltime output grammatical; the only visible effect is that a direct naturaldelta(timedelta(hours=1)) returns the bare noun පැය rather than an article form. Given naturaltime is the dominant consumer of these strings, this was the correct trade-off.

Full local run: 789 passed (including the new Sinhala i18n assertions), ruff/black clean.

@hugovk hugovk added the changelog: Added For new features label Jul 25, 2026
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.56%. Comparing base (c3a124c) to head (24b7038).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #360   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files          12       12           
  Lines         913      916    +3     
=======================================
+ Hits          909      912    +3     
  Misses          4        4           
Flag Coverage Δ
macos-latest 97.59% <100.00%> (+<0.01%) ⬆️
ubuntu-latest 97.59% <100.00%> (+<0.01%) ⬆️
windows-latest 95.41% <0.00%> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@hugovk
hugovk enabled auto-merge (squash) July 25, 2026 13:54
@hugovk

hugovk commented Jul 25, 2026

Copy link
Copy Markdown
Member

Thank you!

@codspeed-hq

codspeed-hq Bot commented Jul 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing RavinduPabasara:feature/si_LK-locale (24b7038) with main (c3a124c)

Open in CodSpeed

@hugovk
hugovk merged commit 42b4a1d into python-humanize:main Jul 25, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Added For new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants