-
Notifications
You must be signed in to change notification settings - Fork 62
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
Default behavior for wrapping in PO files, or confusion between wrapping in content and in PO #291
Comments
These are excellent questions. I stumbled upon them while trying to unwrap the content for asciidoc. So, from what I understand:
|
Thank you for your answer, but I'm afraid we are talking about two different functions. The The issue I'm facing is with the translation of a KDE website, well it's not really an issue or a problem, just an annoyance: translation commits do not only contain translation updates but also changes in how messages are wrapped. So far there's no problem for the content with this behavior, but the annoyance led me to find out how po4a works and to open this issue. Here is how it is: before I started using po4a for the translation of the website (timeline.kde.org), there was no
I have tried running Where does this If I could choose to wrap or not to wrap the PO file, I would myself choose not to wrap as well. However, the system has already worked like that, it would be nice if that can be supported. @jnavila could you also tell why you had to set the |
Hello, thanks for your interest. I have the feeling that you are right and that the source code is very intermixed between wrapping the content and wrapping the po-file. I think that we should sort things out. First the Then, Patches going to that direction would be more than welcome. |
Replying to @PhuNH and elaborating on @mquinson, I would say there are 3 types of wrapping flags:
msgid "a very long string" versus msgid ""
"a very long string" the po file format is quite plastic but this is a drawback for management in version control systems which are not aware of its semantic. |
Thank you both very much for providing instructions. I'm not entirely sure that I can handle this, because, as I understand for now, this will involve with every format module of po4a, which is quite a lot of work, but I will try to look into doing this. |
I have only read po4a code for a while, so if I misunderstand anything and/or miss any important parts, please correct me, I would really appreciate.
As I can see in the documentation of po4a and PO module, the default behavior for wrapping in PO files is to wrap (after the 76th column). For
gettext
, at leastmsgmerge
also behaves similarly: when I usemsgmerge
to merge a POT file and a translated PO file, if an entry in the POT file doesn't have any flag (and thus doesn't have theno-wrap
flag) then the result PO entry is wrapped (bothmsgid
andmsgstr
). On the other hand, the POT entry needs to have theno-wrap
flag for bothmsgid
andmsgstr
of the result PO entry not to be wrapped.Now I'm reading the code of the Text and Yaml modules, and see that most of the calls to the
translate
function passwrap => 0
(and some passwrap => $defaultwrap
which I think is a confusion between wrapping in PO and wrapping in content, but I myself might be the one that is confused here). Some examples are Text, Text, Text, Yaml. Moreover, the defaultwrap
value is also 0. The result is that in all of these cases, the output PO entries have theno-wrap
flag and are never wrapped. This is not configurable and not the default behavior that is expected for PO files as I mentioned above.Also what the TransTractor documentation writes about the
wrap
parameter, to me, sounds like it is about wrapping in content, however the PO module shows that it is for wrapping in PO file.So I have some questions here, and I would be very thankful if someone can provide answers:
wrap
parameter of thetranslate
function?po4a
command and (at least)msgmerge
? Or perhaps should we add a--wrap-po
parameter to other po4a commands similar to that ofpo4a
command, and then somehow pass the argument down to the parsing modules and use it to decide how to wrap the output PO entries?The text was updated successfully, but these errors were encountered: