(I also posted this to qt-project.org, but that forum seems very quiet. Trying my luck also here :))
Hi,
I’ve just migrated from PyQt to PySide and I’m now working with translations. With PyQt the translations worked perfectly, but now with PySide there’re some texts that aren’t translated. I’m very confused, as I think I’m handling all the texts the same way.
What I’ve done so far:
Changed the string formatting from PyQt format “Hello %1” to PySide format “Hello {0}”
Deleted old .ts translation files (lupdate had some problems, better to start from scratch)
Generated new .ts files with command
C:\Python27\Lib\site-packages\PySide\pyside-lupdate.exe Ui_MainWindow.py MainWindow.py -ts translations\German.ts
Translated all texts using Qt Linguist and marked text status to “ready”
Compiled .qm files with command
C:\Python27\Lib\site-packages\PySide\lrelease.exe translations\German.ts
After this most of the translations are working, e.g.:
self.loggedStatus.setText(self.tr('User: {0}').format(self.user.name))
…but in the same file some of the texts are not translated, e.g.:
reply = QMessageBox.question(self, self.tr('Quit program'),
self.tr('Exiting program. Do you want to save the changes to report data?'),
QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel)
When I look into .ts files, I see that both these texts are translated and their translation status is the same. I’d be very happy for any clues where to continue investigating the problem.
Thanks!
My configuration:
Windows 7 (64 bit)
Python 2.7.3 (32 bit)
PySide 1.1.2 (32 bit)