◐ Shell
clean mode source ↗

gh-142927: Tachyon: Comma separate thousands and fix singular/plurals by hugovk · Pull Request #142934 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented

Dec 18, 2025

edited by bedevere-app Bot

Loading

@picnixz

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

@StanFromIreland

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

@hugovk

I'd like to suggest using a locale translation for separating numbers instead of using english-based values. I am personally always confused when commas are used to separate thousands and I think it's better if it's using a localized output.

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

@hugovk

I disagree with the "Single file specialisation," IMO the plural sounds better and in general zero takes a plural noun form?

"x/y" is like saying "x of y", and it's the "y" that matters for the plural:

  • "0 of 0 instructions"
  • "0 of 1 instruction"
  • "1 of 1 instruction"
  • "1 of 4 instructions"
  • "3 of 4 instructions"

@picnixz

Right now, the numbers are formatted in the Python script, and then put into the HTML. I guess one way would be to put unformatted numbers in the HTML and use some JS to do locale conversion in the browser?

Can't we use localized messages? or maybe pass through locale.(...) for formatting numbers?

@hugovk

Yes, and that's much simpler :)

How does this 9cfd9ef look?

@picnixz

It looks better (and simpler). For the "words" we can also use gettext.ngettext to get a possible localized plural form (I don't know if you want all messages to be localized actually, but I think it may makes sense. argparse has localized output and profiling is something that is also very user-facing)

@hugovk

I'll let you open a followup if you'd like to localise the words :)

pablogsal

@hugovk hugovk deleted the 3.15-tachyon-formatting branch

December 22, 2025 15:17

Labels