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

Enclose white spaces in references #1105

Merged
merged 4 commits into from
Sep 4, 2024

Conversation

Dunedan
Copy link
Contributor

@Dunedan Dunedan commented Jul 22, 2024

Since version 0.22 gettext encloses file names in references which contain white spaces or tabs within First Strong Isolate (U+2068) and Pop Directional Isolate (U+2069). This commit adds the same behavior for Babel.

Fixes #654

Since version 0.22 gettext encloses file names in references which
contain white spaces or tabs within First Strong Isolate (U+2068) and
Pop Directional Isolate (U+2069). This commit adds the same behavior for
Babel.
@akx
Copy link
Member

akx commented Jul 23, 2024

Hi! Thanks for the contribution – could you link to gettext changelog/code for this?

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.26%. Comparing base (2f87363) to head (f9f15fa).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
babel/messages/pofile.py 95.34% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1105      +/-   ##
==========================================
+ Coverage   91.09%   91.26%   +0.16%     
==========================================
  Files          26       27       +1     
  Lines        4470     4602     +132     
==========================================
+ Hits         4072     4200     +128     
- Misses        398      402       +4     
Flag Coverage Δ
macos-12-3.10 90.06% <95.34%> (+0.15%) ⬆️
macos-12-3.11 90.00% <95.34%> (+0.09%) ⬆️
macos-12-3.12 90.17% <95.34%> (-0.03%) ⬇️
macos-12-3.13-dev 89.70% <95.34%> (?)
macos-12-3.8 89.99% <95.34%> (+0.16%) ⬆️
macos-12-3.9 89.99% <95.34%> (+0.09%) ⬆️
macos-12-pypy3.10 90.06% <95.34%> (+0.15%) ⬆️
ubuntu-22.04-3.10 90.09% <95.34%> (+0.15%) ⬆️
ubuntu-22.04-3.11 90.02% <95.34%> (+0.09%) ⬆️
ubuntu-22.04-3.12 90.19% <95.34%> (-0.03%) ⬇️
ubuntu-22.04-3.13-dev 89.72% <95.34%> (?)
ubuntu-22.04-3.8 90.01% <95.34%> (+0.16%) ⬆️
ubuntu-22.04-3.9 90.01% <95.34%> (+0.09%) ⬆️
ubuntu-22.04-pypy3.10 90.09% <95.34%> (+0.15%) ⬆️
windows-2022-3.10 90.21% <95.34%> (-0.07%) ⬇️
windows-2022-3.11 90.14% <95.34%> (-0.14%) ⬇️
windows-2022-3.12 90.31% <95.34%> (-0.26%) ⬇️
windows-2022-3.13-dev 89.84% <95.34%> (?)
windows-2022-3.8 90.13% <95.34%> (-0.07%) ⬇️
windows-2022-3.9 90.13% <95.34%> (-0.14%) ⬇️
windows-2022-pypy3.10 90.21% <95.34%> (-0.07%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Dunedan
Copy link
Contributor Author

Dunedan commented Jul 23, 2024

Hi! Thanks for the contribution – could you link to gettext changelog/code for this?

Sorry, of course. Here you go:

https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff;h=4cacad44e67171ce136cf5c1ae01093aa8e7a7ad
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=NEWS;h=4f126cab47b2eb462fbb844f5c785ab905661c3f;hb=HEAD#l68

Copy link
Member

@akx akx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond the inline comment – we should probably also strip these delimiters when parsing a .po file? A roundtrip test would be neat.

babel/messages/pofile.py Outdated Show resolved Hide resolved
@Dunedan
Copy link
Contributor Author

Dunedan commented Jul 26, 2024

Beyond the inline comment – we should probably also strip these delimiters when parsing a .po file?

Yes of course. I didn't think about that initially, but this makes perfect sense. I added the necessary logic for that.

A roundtrip test would be neat.

I added a bunch of additional tests, including a roundtrip test.

@akx akx self-requested a review August 5, 2024 15:11
@akx akx added this to the Babel 2.17 milestone Aug 7, 2024
Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one nit, otherwise looks good to me, thanks!

babel/messages/pofile.py Outdated Show resolved Hide resolved
@tomasr8
Copy link
Member

tomasr8 commented Aug 23, 2024

@akx in case you missed this ;)

@akx
Copy link
Member

akx commented Aug 28, 2024

@akx in case you missed this ;)

I was getting married and on holiday. Back in the proverbial office now :)

@tomasr8
Copy link
Member

tomasr8 commented Aug 28, 2024

@akx in case you missed this ;)

I was getting married and on holiday. Back in the proverbial office now :)

No worries then :) And Congrats! 🎉

Copy link
Member

@akx akx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One performance comment :)

babel/messages/pofile.py Show resolved Hide resolved
@akx akx merged commit f91754b into python-babel:master Sep 4, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract messes up file names with whitespace
3 participants