Add Sinhala (si_LK) locale - #360
Merged
hugovk merged 1 commit intoJul 25, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hugovk
enabled auto-merge (squash)
July 25, 2026 13:54
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
src/humanize/locale/si_LK/LC_MESSAGES/humanize.potranslating all time, number-scale and file-size phrases into formal written Sinhala, verified by a native speaker.README.md(alphabetical position).tests/test_i18n.py(naturaltime,precisedelta,intword,naturalsize).Notes for reviewers:
nplurals=2; plural=(n > 1);.පැයකට පෙර= "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 everynaturaltimeoutput grammatical; the only visible effect is that a directnaturaldelta(timedelta(hours=1))returns the bare nounපැයrather than an article form. Givennaturaltimeis the dominant consumer of these strings, this was the correct trade-off.Full local run:
789 passed(including the new Sinhala i18n assertions),ruff/blackclean.