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

Extract messes up file names with whitespace #654

Closed
Dreamsorcerer opened this issue Jul 15, 2019 · 3 comments · Fixed by #1105
Closed

Extract messes up file names with whitespace #654

Dreamsorcerer opened this issue Jul 15, 2019 · 3 comments · Fixed by #1105

Comments

@Dreamsorcerer
Copy link

If a file with whitespace is extracted with the command line tool, the comments include it as 2 different files split on the space, and then sorts them individually. Example output:

#: landing.html:77 web/templates/logged_out/endnote-landing.html:131
#: web/templates/logged_out/wos web/templates/partials/home_page.html:319

Where one of the files is actually "wos landing.html".

Not an urgent issue, I only noticed this while looking at how to handle this edge case for my own code.

@miluchen
Copy link

It's a bad idea to include whitespace in the name. You may have to use escape character for space to create a file on Mac/Linux. e.g.: touch wos\ landing.html.
I don't think it's an issue that should be fixed here.

@Dreamsorcerer
Copy link
Author

Or touch 'wos landing.html', or just type it in the GUI as many users do, or in Python with open("wos landing.html"). It's not difficult or even that uncommon for someone to use spaces in a filename.

While I agree that it is recommended not to use spaces in a development project, that doesn't mean this library should break when a developer does a somewhat discouraged, but legitimate thing. If there is a way to escape whitespace in the reference line, then Babel should do so. If not, then Babel should give an error, or just remove the whitespace, so that the name is still close to the original. It definitely shouldn't just output some nonsense invalid references.

@Dunedan
Copy link
Contributor

Dunedan commented Jul 21, 2024

In my opinion this is a bug in Babel. What Babel should do in this case is to enclose the white space in the filename within First Strong Isolate (U+2068) and Pop Directional Isolate (U+2069) characters, as defined in the portable object template format description (https://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/PO-Files.html).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants