Repository navigation
Preserve formatting of existing files is not respected #922
Description
Activity
Please read this document, and provide detailed and self-contained steps to reproduce, and a clear description of what you believe is incorrect. It doesn’t help that the issue subject appears corrupted.
I’m happy to look into it, but I can’t reasonably be expected to investigate details scattered across another repository and figure them on my own. Having all relevant information in one place makes it much easier to understand and address the issue.
Reacted by Mihai VasiliuI’m happy to look into it, but I can’t reasonably be expected to investigate details scattered across another repository and figure them on my own. Having all relevant information in one place makes it much easier to understand and address the issue.
Thanks, I updated the PR with the steps to reproduce.
- changed the title
[-]Lines wrap at not preserved[/-][+]Preserve formatting of existing files is not respected[/+]on Mar 1, 2026 Thanks, I updated
The appropriate way of doing clarifications in response to a comment is to add an explanatory comment too, not to rewrite history. The latter is hard to follow in a conversation, so please don't do it.
the PR
(You didn't make any "PR" - that would have received enthusiastic response. You filed a bug report.)
Anyway:
It took me a while to understand that you complain about editing the file outside of Poedit.
You modified the file to use non-standard formatting. Poedit did its best to detect the desired line width, but couldn’t, because you edited the file to be internally inconsistent.
The only lines that should have changed are lines 3778 and 3779. All others have no reason to change.
Poedit uses
msgcat- that is to say, expects normal formatting of files. That may result in normalization of weird files. Poedit doesn’t promise not to normalize, and the UI you screenshotted doesn’t claim so.Ideally, Poedit would only update edited portions of the file, regardless of how bizarre the rest might be. We don’t live in an ideal world. Changing the implementation to behave like that, while on my todo list, is no small undertaking — a complete rewrite of all of
catalog_po.cppbasically — for only limited gains. IOW, it should be done, but I can’t promise when, or if, I will do it.If you care about this, contributing a PR (as in, a pull request with code) would be most welcome.
Thanks, I updated
The appropriate way of doing clarifications in response to a comment is to add an explanatory comment too, not to rewrite history. The latter is hard to follow in a conversation, so please don't do it.
I usually do this because whoever new here and starts to read, to not waste time with incorrect info, just read the correct steps.
the PR
(You didn't make any "PR" - that would have received enthusiastic response. You filed a bug report.)
My bad, I was working on other PRs in the same time, and just wrote PR withouth thinking :)
It took me a while to understand that you complain about editing the file outside of Poedit.
You modified the file to use non-standard formatting. Poedit did its best to detect the desired line width, but couldn’t, because you edited the file to be internally inconsistent.
I sort-of understand what you are saying, and it makes sense to a point.
The reason that I edited the po file outside poedit was because I corrected some issues in the oringinal PR, so the issues were correctly directly with an external editor, being easier to make corrections at the lines indicated in the PR defects.
Still, I would have expected that if all other lines were correct, poedit to just rework the offending lines.
Would be a good improvement somewhere in the future to have this non-intrusive behaviour :)
Cheers!
I got to this issue via python-babel/babel#1266 and the (maybe obvious) work around is to disable the
preserve formatting ...option to let poedit enforce line length
Hi,
It seems that Poedit is not respecting the line wrap settings in some cases. I especially refer to Preserve formatting of existing files setting.
I have my settings setup this way (the default):
I am using Poedit version 3.8.2 on Windows 11 to edit translations. I am working on the following file: original.zip
Steps to reproduce:
Why did this change occur? I cannot explain it myself. The only lines that should have changed are lines 3778 and 3779. All others have no reason to change.