[PyQt] pylupdate4 vs QButtonBox

David Boddie david at boddie.org.uk
Sun Aug 19 01:22:57 BST 2007

On Fri, 17 Aug 2007 19:09:12 +0200, Juergen Urner wrote:

> Ah... I see. Its there in translations/qt_*.ts/QDialogButtonBox. Still
> puzzled, so time to ask a naive question cos I can' t seem to find anything
> about it in the docs. How would I convince my app to use, lets say
> qt_de.qm?

Create a translator, load the translation, then "install" it so that the
application can use it:

  translator = QTranslator()
  translator.load(translations_path + "qt_"+QLocale.system().name())

You can locate the translations that were installed alongside Qt by querying
the QLibraryInfo class:

  translations_path = QLibraryInfo.location(QLibraryInfo.TranslationsPath)

That way, you don't have to hard code the path.


More information about the PyQt mailing list