[PyQt] pylupdate4 problem with translatable strings

Phil Thompson phil at riverbankcomputing.com
Tue Apr 9 14:24:54 BST 2013


On Sun, 07 Apr 2013 09:26:56 +0300, Antti-Pekka Meronen
<webmaster at relicon.info> wrote:
> 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?

Yes - fixed in tonight's snapshot.

Thanks,
Phil


More information about the PyQt mailing list