-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
POEntry eats escape characters #155
Comments
The escape characters are required in the |
This library does not concern itself only with Python however. It concerns itself with .po files and in extension may concern itself with any source language supported by gettext. When the strings magically change along the way, that is hard to debug and hard to work around. (E.g. my use case where I discovered this issue was to use Python to bulk-update my msgids in the C# source files - but I could not find them, because Python searched for different strings: The real ones contained the character |
But isn't this just the representation of the strings inside the terminal? Or does this affect generated output files as well? |
@Zsar I don't get your problem. Escaped double quotes are required in the PO file because msgstr and msgid are delimited by double quotes as @stefan6419846 said. Outside of the PO file context, there's no reason why the escape characters should be kept ! For example, try opening your file with POEdit or any other PO file editor, and you'll see the escape characters are not present, this is the expected behavior. I'm closing the issue. |
polib 1.2.0 on Python 3.7 installed via pip.
Expected: I can access the string contained in the .po file.
Sample C# source line:
Catalog.GetString("A configuration profile with name \"{0}\" is already existing.")
Sample .po file entry for that line:
Content of POEntry.msgid:
'A configuration profile with name "{0}" is already existing.'
Content of POEntry.msgstr:
'A configuration profile with name "{0}" already exists.'
The eaten characters are (through guesswork?) added back when saving the POFile, but this means writing out the content anywhere will not result in the original string.
The text was updated successfully, but these errors were encountered: