`intword` inserts the unit without any `%` substitution:
return f"{negative_prefix}{number} {unit}"
so a placeholder left in a translated unit is printed literally. The
Bengali, Korean and Vietnamese catalogues still carry `%d` or
`%(value)s` on the `thousand`..`googol` units, presumably from an older
API:
activate("bn_BD"); intword(1_500_000_000) -> '1.5 %d '
activate("vi_VN"); intword(1_200_000) -> '1.2 %(value)s triu'
Strip the placeholder and the separator after it, leaving the translated
words untouched. Only the `intword` power units are changed; placeholders
in other messages are substituted normally and are left alone.
After this, none of the 36 catalogues emits a placeholder for any of the
12 powers.
intwordinserts the unit without any%substitution:so a printf placeholder left in a translated unit is printed literally. The Bengali, Korean and Vietnamese catalogues still carry
%dor%(value)son thethousandgoogolunits:On
main:With this PR:
This strips the placeholder and the separator that follows it (a plain space or U+00A0) and leaves the translated words untouched.
Scope is deliberately narrow: only the twelve
intwordpower msgids are changed. Placeholders elsewhere in these catalogues are substituted normally and are left alonenaturaldelta's"%d day"and friends still need theirs. After the change, none of the 36 catalogues emits a placeholder for any of the twelve powers.Added a parametrised regression test over the three locales, checking that
intwordnever returns a%at any power. It fails 3/3 onmainand passes here.Two notes I did not act on, since both need a native speaker rather than a scripted edit:
ko_KRrenders several powers as the English words (million,billion), and itstrillionentry readsbillion.ko_KRandvi_VNalso contain a couple of French leftovers (dcillion,gogol).Happy to split those out separately if you would like them addressed.