Repository navigation
Use the locale decimal separator in precisedelta - #539
Open
Yasser-Ameur wants to merge 1 commit into
Open
Yasser-Ameur wants to merge 1 commit into
Yasser-Ameur wants to merge 1 commit into
Conversation
`precisedelta` printed a dot as the decimal separator in every locale, for example "1.50 Sekunden" under de_DE, while `intword` and `intcomma` already use `decimal_separator()` for the active locale. The fractional value of the minimum unit was substituted into the translated text through `%` formatting, which always yields a dot. Format the number first, swap the dot for `decimal_separator()` as `intword` does, and substitute the result with `%s`. English output and locales that use a dot are unchanged.
Automation signalsActivity patterns show signs of automation. Evidence
Last 5 PRs: This is an automated analysis by AgentScan |
Yasser-Ameur
marked this pull request as ready for review
December 2, 2026 15:30
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.
Changes proposed in this pull request:
precisedeltaformats its fractional value with%, which always prints a dot, so a decimal comma locale gets a dot inside an otherwise translated sentence, whileintwordandintcommaalready use the locale's separator:The value is now formatted first and the dot replaced with
decimal_separator(), the approachintworduses. English and the locales whose separator is a dot give the same output as before, and a customformatsuch as"%0.1f"is still honoured.Adds
test_precisedelta_i18n_decimal_separatorfor en_US, de_DE, fr_FR and es_ES. The de_DE and fr_FR cases fail on main.naturalsizehas the same gap (naturalsize() ignores the locale decimal separator #460) and is not touched here.