[PyQt] Translation not working for QSystemTrayIcon

Dmitry Shachnev mitya57 at ubuntu.com
Thu Mar 21 12:17:46 GMT 2019


Hello,

On Thu, Mar 21, 2019 at 09:32:37AM +0100, Zdenko Podobny wrote:
> I am not sure what I am doing wrong, but translation is not working for my
> QSystemTrayIcon app. Here is my testing code:
>
> [...]
> app = QtWidgets.QApplication(sys.argv)
> widget = QtWidgets.QWidget()
> trayIcon = SystemTrayIcon(QtGui.QIcon('logo.ico'), widget)
> qtTranslator = QtCore.QTranslator()
> appTranslator = QtCore.QTranslator(app)
> loaded = appTranslator.load('sk_SK.qm')
> [...]

Try creating SystemTrayIcon after you load the translation, not before.

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190321/a66d93b1/attachment.sig>


More information about the PyQt mailing list