Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use %d for year translations, convert to string for intcomma after #23

Merged
merged 3 commits into from Jun 22, 2022

Conversation

carterbox
Copy link
Contributor

This patch fixes a bug introduced in 3.14.0, where the format
string was changed from %d to %s to add separators to the year.
However, this needs to happen after translation because the
translator uses the format strings as part of the translation.

Closes #21

This patch fixes a bug introduced in 3.14.0, where the format
string was changed from %d to %s to add separators to the year.
However, this needs to happen after translation because the
translator uses the format strings as part of the translation.

Closes python-humanize#21
@hugovk hugovk added the changelog: Fixed For any bug fixes label Jun 20, 2022
@hugovk
Copy link
Member

hugovk commented Jun 20, 2022

Thanks for the fix!

Please could you also add a test to test_i18n.py? For either naturaltime or naturaldelta.

@carterbox
Copy link
Contributor Author

Could you please assign me so I don't forget! Thanks!

@hugovk
Copy link
Member

hugovk commented Jun 21, 2022

Done! Will set to draft as well.

@hugovk hugovk marked this pull request as draft June 21, 2022 18:46
@codecov-commenter
Copy link

codecov-commenter commented Jun 22, 2022

Codecov Report

Merging #23 (e34f1cc) into main (29d37fb) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   99.09%   99.11%   +0.01%     
==========================================
  Files           9        9              
  Lines         666      678      +12     
==========================================
+ Hits          660      672      +12     
  Misses          6        6              
Flag Coverage Δ
macos-latest 97.64% <84.61%> (-0.26%) ⬇️
ubuntu-latest 97.64% <84.61%> (-0.26%) ⬇️
windows-latest 97.19% <76.92%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/humanize/time.py 99.53% <100.00%> (ø)
tests/test_i18n.py 100.00% <100.00%> (ø)
tests/test_number.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29d37fb...e34f1cc. Read the comment docs.

@carterbox carterbox marked this pull request as ready for review June 22, 2022 02:27
@hugovk hugovk enabled auto-merge June 22, 2022 05:06
@hugovk hugovk merged commit 6871118 into python-humanize:main Jun 22, 2022
@hugovk
Copy link
Member

hugovk commented Jun 22, 2022

Thank you!

@carterbox carterbox deleted the intcomma-translation branch June 22, 2022 14:30
@hugovk hugovk changed the title BUG: Use %d for year translations convert to string for intcomma after BUG: Use %d for year translations, convert to string for intcomma after Jun 23, 2022
@hugovk hugovk changed the title BUG: Use %d for year translations, convert to string for intcomma after Use %d for year translations, convert to string for intcomma after Jun 23, 2022
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.

naturaltime: wrong translation with delta >= 2 years
3 participants