Skip to content

Correct Chinese quadrillion translations - #473

Open
Plastic-time wants to merge 1 commit into
python-humanize:mainfrom
Plastic-time:codex/chinese-quadrillion
Open

Plastic-time wants to merge 1 commit into
python-humanize:mainfrom
Plastic-time:codex/chinese-quadrillion

Conversation

@Plastic-time

Copy link
Copy Markdown

With zh_CN active, intword(10**15) currently returns 1.0 万亿; zh_HK returns 1.0 萬億. Those labels mean 10**12, so the displayed quantity is a thousand times too small. Cambridge's definition of quadrillion is 1,000,000,000,000,000 (1000万亿 / 1000萬億).

Changes proposed in this pull request:

  • Correct both plural entries to 千万亿 and 千萬億 in the respective catalogs.
  • Extend the existing localization tests with positive, negative, plural and rounding-to-quadrillion cases, plus checks that the neighboring trillion and quintillion labels stay unchanged.

Before the catalog change, eight new cases fail and four neighboring-scale cases pass. After recompiling the catalogs, all twelve pass.

Validation on Windows, CPython 3.12.14:

  • Full tests and source doctests, with benchmark timing disabled: 903 passed, 2 skipped. The two translation-update tests require GNU gettext command-line tools that are unavailable locally; all 36 catalogs were compiled with polib, and the Chinese regression tests ran.
  • All applicable configured prek hooks passed over the full repository.
  • Mypy passed for all 14 source files; git diff --check passed.

This is based on current main and is independent of the missing translations in #472. The placeholder migration in #403 touches these entries but retains the incorrect labels; if that merges first, this correction will need to be carried over to its new message IDs.

Prepared and tested with OpenAI Codex assistance. Other platforms and Python versions were not run locally.

@hugovk hugovk added the changelog: Fixed For any bug fixes label Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.70%. Comparing base (a2006ea) to head (30ca107).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #473   +/-   ##
=======================================
  Coverage   99.70%   99.70%           
=======================================
  Files          12       12           
  Lines        1020     1020           
=======================================
  Hits         1017     1017           
  Misses          3        3           
Flag Coverage Δ
macos-latest 97.25% <ø> (ø)
ubuntu-latest 97.25% <ø> (ø)
windows-latest 92.35% <ø> (ø)

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.

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