def install_translator(qapp):
 global QT_TRANSLATOR
 if (QT_TRANSLATOR is None):
  qt_translator = QTranslator()
  if qt_translator.load(('qt_' + QLocale.system().name()), QLibraryInfo.location(QLibraryInfo.TranslationsPath)):
   QT_TRANSLATOR = qt_translator
 if (QT_TRANSLATOR is not None):
  qapp.installTranslator(QT_TRANSLATOR)

def install_translator ( qapp ) : global QT_TRANSLATOR if ( QT_TRANSLATOR is None ) : qt_translator = QTranslator ( ) if qt_translator . load ( ( 'qt_' + QLocale . system ( ) . name ( ) ) , QLibraryInfo . location ( QLibraryInfo . TranslationsPath ) ) : QT_TRANSLATOR = qt_translator if ( QT_TRANSLATOR is not None ) : qapp . installTranslator ( QT_TRANSLATOR )
install qt translator to the qapplication instance .