<div dir="ltr"><div>Adding back the _escape in <a href="https://invent.kde.org/sdk/pology/-/blob/python3/pology/message.py#L556">https://invent.kde.org/sdk/pology/-/blob/python3/pology/message.py#L556</a></div><div>self.__dict__[att_lins] = wrapf(fname, msgsth, <br></div><div>-></div><div>self.__dict__[att_lins] = wrapf(fname, _escape(msgsth),</div><div>fixes it for the msgid, but I haven't found the one for msgstr.</div><div><br></div><div>If I add back the one that was in <a href="https://invent.kde.org/sdk/pology/-/blob/python3/pology/message.py#L574">https://invent.kde.org/sdk/pology/-/blob/python3/pology/message.py#L574</a>, it works again if I don't do the previous change in the header.py.</div><div>I've attached the patch.</div><div><br></div><div>It causes multiple changes in the formatting of the po:</div><div>-#, kde-kuit-format, no-c-format<br>+#, no-c-format, kde-kuit-format</div><div>...</div><div>-msgid ""<br>-"The folder %1 is part of the album path and cannot be imported recursively!"<br>-msgstr ""<br>-"Le dossier %1 fait partie d'un emplacement d'album et ne peut être importé"<br>-" récursivement !"<br>+msgid "The folder %1 is part of the album path and cannot be imported recursively!"<br>+msgstr "Le dossier %1 fait partie d'un emplacement d'album et ne peut être importé récursivement !"<br> </div><div>Except this, the results look good but I would need to check more the diff..</div><div>Thank you for working on porting these scripts to python3!</div><div><br></div><div>Cheers,</div><div><br></div><div>Johnny<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 5 oct. 2022 à 21:24, Johnny Jazeix <<a href="mailto:jazeix@gmail.com">jazeix@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>This can be fixed by replacing in:<a href="https://invent.kde.org/sdk/pology/-/blob/master/pology/header.py#L245" target="_blank">https://invent.kde.org/sdk/pology/-/blob/master/pology/header.py#L245</a></div><div>
<code> "%s: %s\n" % tuple(field)</code> with 
<code> r"%s: %s\n" % tuple(field)</code>

</div><div>After fixing it, I have another issue in /tmp/calendarjanitor.po~merged-70359:307: missing 'msgstr' section</div><div>#. +> trunk5 stable5<br>#: calendarjanitor.cpp:621<br>#, kde-format<br>msgid "id=%1; summary="%2""<br>msgstr "id=%1; summary= « %2 »"</div><div><br></div><div>The " are not escaped in the msgid.</div><div>I'm taking a quick look in case I find it but I don't guarantee anything.</div><div><br></div><div>Cheers,</div><div><br></div><div>Johnny<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 5 oct. 2022 à 19:41, Karl Ove Hufthammer <<a href="mailto:karl@huftis.org" target="_blank">karl@huftis.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Luigi Toscano skreiv 05.10.2022 19:25:<br>
>> Traceback (most recent call last):<br>
>>   File "/path/to/pology/bin/./posummit", line 21, in <module><br>
>>     from pology import version, _, n_, t_, PologyError<br>
>> ModuleNotFoundError: No module named 'pology'<br>
>>  From which folder should I run the script?<br>
> Add the path to the pology directory to PYTHONPATH.<br>
><br>
> In the long run we should add the support for properly installing pology with<br>
> python tools, not with cmake.<br>
<br>
Thanks. Adding the directory to PYTHONPATH worked.<br>
<br>
Running posummit, I got an error message about invalid syntax in the <br>
summit_helpers_NO.py script that we use for the Norwegian translations. <br>
But this was easily fixed using 2to3.<br>
<br>
Then running posummit quickly resulted in an error message about an <br>
invalid .po file akonadi-calendar-tools._desktop_.po. The original file <br>
was valid, but Pology writes an invalid file. The original file looked <br>
like this:<br>
<br>
msgid ""<br>
msgstr ""<br>
"Project-Id-Version: desktop_kdepim\n"<br>
"Report-Msgid-Bugs-To: <a href="https://bugs.kde.org" rel="noreferrer" target="_blank">https://bugs.kde.org</a>\n"<br>
"POT-Creation-Date: 2019-05-20 12:22+0200\n"<br>
"PO-Revision-Date: 2015-05-08 01:10+0200\n"<br>
[…]<br>
<br>
But Pology writes out this file (to /tmp):<br>
<br>
msgid ""<br>
msgstr "Project-Id-Version: desktop_kdepim<br>
Report-Msgid-Bugs-To: <a href="https://bugs.kde.org" rel="noreferrer" target="_blank">https://bugs.kde.org</a><br>
POT-Creation-Date: 2019-05-20 12:22+0200<br>
PO-Revision-Date: 2015-05-08 01:10+0200<br>
[…]<br>
<br>
So it looks like the \n" is missing from the header lines.<br>
<br>
<br>
-- <br>
Karl Ove Hufthammer<br>
<br>
</blockquote></div>
</blockquote></div>