Skip to content

Use Turkish numeric separators - #465

Merged
hugovk merged 1 commit into
python-humanize:mainfrom
emrehangorgec:fix/turkish-number-separators
Oct 22, 2026
Merged

hugovk merged 1 commit into
python-humanize:mainfrom
emrehangorgec:fix/turkish-number-separators

Conversation

@emrehangorgec

Copy link
Copy Markdown
Contributor

Activating tr_TR translates words but leaves English numeric separators. intcomma(1_234_567.89) returns 1,234,567.89, and the Turkish string "1234567,89" is read as 123,456,789.

Changes proposed in this pull request:

  • Register tr_TR with a dot for grouping and a comma for decimals, following Unicode CLDR.
  • Extend the existing intcomma and intword locale tests, and add a README example.

Found through code inspection and reproduced locally. Three regression checks fail before the fix. No matching issue or PR was found.

Validation on Windows with Python 3.14:

  • python -m pytest tests src/humanize --doctest-modules --benchmark-disable --cov=humanize: 873 passed, 99% coverage.
  • python -m mypy .: passed for all 14 source files.
  • prek run --all-files --show-diff-on-failure: passed.
  • The README example passed all four doctest checks. git diff --check passed.

Translation catalogs were compiled before testing. Local hook setup required reinstalling validate-pyproject==0.26 to restore missing schema files. Benchmark timings and other platforms were not tested.

Does this handle Turkish numeric inputs as intended, including strings passed to intcomma?

@hugovk hugovk added the changelog: Fixed For any bug fixes label Oct 22, 2026
@hugovk
hugovk enabled auto-merge (squash) October 22, 2026 12:34
@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.70%. Comparing base (785e5dc) to head (3abaf89).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #465   +/-   ##
=======================================
  Coverage   99.69%   99.70%           
=======================================
  Files          12       12           
  Lines         995     1000    +5     
=======================================
+ Hits          992      997    +5     
  Misses          3        3           
Flag Coverage Δ
macos-latest 97.60% <100.00%> (+0.01%) ⬆️
ubuntu-latest 97.60% <100.00%> (+0.01%) ⬆️
windows-latest 92.80% <0.00%> (-0.47%) ⬇️

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 merged commit a2006ea into python-humanize:main Oct 22, 2026
44 of 45 checks passed
@emrehangorgec
emrehangorgec deleted the fix/turkish-number-separators branch October 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Fixed For any bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants