Skip to content

GetText PO Multiline not handled correctly #128

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

Open
Drkie opened this issue Mar 11, 2023 · 1 comment
Open

GetText PO Multiline not handled correctly #128

Drkie opened this issue Mar 11, 2023 · 1 comment

Comments

@Drkie
Copy link

Drkie commented Mar 11, 2023

Summary

When translating a multiline string in a POT/PO file, the msgstr generated isn't valid.

Steps to reproduce

Translate a multiline string in a PO file, then save. For example:

msgid ""
"Line 1\n"
"Line 2\n"
"Line 3"
msgstr ""

Repository URL

https://gitlocalize.com/repo/8365

What is the current bug behavior?

After saving, the generated msgstr looks like this:

msgstr "Line 1\n
Line 2\n
Line 3"

Notice the missing quotes on each line, as well as the deleted "" that should be on the first line.

What is the expected correct behavior?

The expected msgstr should look like this:

msgstr ""
"Line 1\n"
"Line 2\n"
"Line 3"

Relevant logs and/or screenshots

Please note that even if you don't make any changes in the file, GitLocalize will re-save over existing multiline strings and break them. Example diff:
image
On very large files, this makes it so having to go over every single multiline string and fix it manually can be extremely tedious.

Possible fixes

GitLocalize should ideally follow the correct formatting for PO files. The generated files become invalid/corrupted. A good way to validate this is opening the resulting files with Poedit, which shows the errors:
image

@ilyaspiridonov
Copy link
Member

Thanks for reporting this, we will review and raise this internally.

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

No branches or pull requests

3 participants