|
Hi guys,
I was using the following function for re-translate my
application at runtime but after compiling my application with new
PyQt version it became need to be restarted... do you know what's
wrong?
PS
Layout changing works perfectly.
def languageChange(self):
translator = QTranslator(self)
currentLangFile = QString(":/l10n/%1.qm").arg(self.getLang())
if not translator.load(currentLangFile):
print QString("Couldn't load language file")
widget = QWidget(self)
if self.lang == 'ar':
print 'isAr'
qApp.setLayoutDirection(Qt.RightToLeft)
QLocale.setDefault(QLocale(QLocale.Arabic, QLocale.SyrianArabRepublic))
for widget in qApp.allWidgets():
widget.setLayoutDirection(Qt.RightToLeft)
else:
print 'isEn'
qApp.setLayoutDirection(Qt.LeftToRight)
for widget in qApp.allWidgets():
widget.setLayoutDirection(Qt.LeftToRight)
qApp.installTranslator(translator)
self.retranslateUi(self)
--
Best Regards
Muhammad Bashir Al-Noimi
My Blog: http://mbnoimi.net
|
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt