This is a static archive of the Python wiki, which was retired in February 2026 due to lack of usage and the resources necessary to serve it — predominately to bots, crawlers, and LLM companies.
Pages are preserved as they were at the time of archival. For current information, please visit python.org.
If a change to this archive is absolutely needed, requests can be made via the infrastructure@python.org mailing list.

Using a translation of Qt

On the #pyqt channel on freenode, Fisiu asked about getting localized versions of the Qt dialogs.

   1 import sys
   2 from PyQt4.QtCore import *
   3 from PyQt4.QtGui import *
   4 
   5 if __name__ == "__main__":
   6 
   7     app = QApplication(sys.argv)
   8     
   9     qt_translator = QTranslator()
  10     qt_translator.load("qt_" + QLocale.system().name(),
  11                        QLibraryInfo.location(QLibraryInfo.TranslationsPath))
  12     app.installTranslator(qt_translator)
  13     
  14     QMessageBox.aboutQt(None)
  15     sys.exit()

2026-02-14 16:12