[PyQt] pylupdate5 doesn't find all translations

Hans-Peter Jansen hpj at urpla.net
Sun Nov 13 00:46:54 GMT 2016


Hi Phil,

here's an excerpt, where the second translation is missing in the resulting ts:

test.py:
#-*- coding: utf-8 -*-

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QMessageBox

def ErrorReport(cfg, msg):
    _translate = QCoreApplication.translate

    msgBox = QMessageBox(QMessageBox.Critical,
                         _translate("ErrorReport", "Oops"),
                         _translate("ErrorReport", "<h3>An unexpected {0} exception has "
        "been occured:</h3><pre><font face='Bitstream Vera Sans Mono'>{1}\n</pre><br>"
        "Please report this problem to: {2}".format(cfg.exc_type, msg, "me")))
    msgBox.exec_()

$ pylupdate5 test.py -ts test.ts
$cat test.ts
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
<context>
    <name>ErrorReport</name>
    <message>
        <location filename="test.py" line="9"/>
        <source>Oops</source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>

Is that to be expected?

Cheers,
Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161113/5f8d4aaa/attachment.html>


More information about the PyQt mailing list