[PyQt] pylupdate4 problem with translatable strings

Antti-Pekka Meronen webmaster at relicon.info
Sun Apr 7 07:26:56 BST 2013


When I convert my Qt Designer mainwindow.ui file into mainwindow.py, 
mainwindow.py file makes the translatable strings like this:
MainWindow.setWindowTitle(_translate("MainWindow", "Program name", None))

And when I convert my .pro file using pylupdate4.exe, the .ts 
translation files come up empty. Unless I change my mainwindow.py file 
like this:
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", 
"Program name", None))

And it works fine. So this is a bug in pylupdate4?



More information about the PyQt mailing list