-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
More consistent line breaks in exported po files #11615
Comments
The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable). |
Indeed the implementation in translate-toolkit and gettext do differ. I think I've posted some summary years ago on some translate-toolkit issue, but I can't find it right now. |
Thanks, will do. |
Posted it as an issue here: translate/translate#5251 |
Closing this now as there is nothing to be done in Weblate to fix this. |
Describe the problem
When I export a po file in Weblate and edit it using an external editor like poedit, I get inconsistent line breaks, which makes merging and comparing changes from weblate with the exported file nearly impossible. Poedit allows setting different line break values, but no matter which value I use, I can't get it to align with the weblate output.
I am currently working on https://hosted.weblate.org/projects/godot-engine/godot-class-reference/de/
Describe the solution you would like
I'd like weblate to create po files on export that are identical (down to the line breaks) to the files generated by the most popular po file editors (e.g. poedit).
Describe alternatives you have considered
A workaround would be to always pass the downloaded files through poedit before attempting a merge, but I was hoping for a more consistent output from weblate directly.
Screenshots
Additional context
Here are some observations I made, and I can't get a grasp on the logic behind where line breaks occur and where they are prevented:
So generally weblate seems to target a maximum line length of 80, but I have also (very rarely) seen longer lines, like these:
85:
"permission#BIND_NOTIFICATION_LISTENER_SERVICE]BIND_NOTIFICATION_LISTENER_SERVICE[/"
81:
"print(ts.string_get_word_breaks(\"Test ❤️🔥 Test\")) # Prints [1, 2, 3, 4, 5, "
The first one might not have found any character at which a break is allowed, and the second one might be confused with the unicode emojis.
These corner cases aside, Weblate seems to try to avoid breaking up words, but the rules seem inconsistent:
Here, breaking after the "[" is allowed (top line length: 76):
But here it is not, even though it would still fit into the top line (length: 77):
Sometimes I even get a forced break inside a word (here: "erhöht"), even though there is a space before the word that could have been used as the break. Also, the line like this is only 79 characters long, so there would still be space for the "h". Maybe the ö is represented as unicode and weblate is allowed to break after unicode characters?
I could try and provide more example if that helps.
It would be nice if we could get po files that are more consistent.
The text was updated successfully, but these errors were encountered: