Table headers and others string are not translated
It appears that all strings marked with the QT_TRANSLATE_NOOP macro are not translated.
QT_TRANSLATE_NOOP("CertificationView", "No more certifications"),
It is normal as this macro just mark the string for translation but do not translate anything at all.
But it is very useful when you pass strings to QCoreApplication.translate()
in a variable, as no string will be extracted from this line:
QCoreApplication.translate("NetworkTableModel", variable),
- Translation for standardsButtons are in the QT lib file
qtbase_[lang].qm
. It is required to add the qm file to the ressources (withgen_translations.py
). Then create a new translator for it and install it in the app.
https://stackoverflow.com/questions/2351055/translate-standardbutton-in-qdialogbuttonbox
- We should use PyQt QCoreApplication.translate() everywhere instead of tr() to avoid problems:
https://www.riverbankcomputing.com/static/Docs/PyQt5/i18n.html#differences-between-pyqt5-and-qt