V0.6 #852
|
@ -69,11 +69,27 @@ def _translate(context, text):
|
||||||
return QtGui.QApplication.translate(context, text)
|
return QtGui.QApplication.translate(context, text)
|
||||||
|
|
||||||
def change_translation(locale):
|
def change_translation(locale):
|
||||||
global qtranslator
|
global qmytranslator, qsystranslator
|
||||||
qtranslator = QtCore.QTranslator()
|
try:
|
||||||
|
if not qmytranslator.isEmpty():
|
||||||
|
QtGui.QApplication.removeTranslator(qmytranslator)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if not qsystranslator.isEmpty():
|
||||||
|
QtGui.QApplication.removeTranslator(qsystranslator)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
qmytranslator = QtCore.QTranslator()
|
||||||
translationpath = os.path.join (shared.codePath(), 'translations', 'bitmessage_' + locale)
|
translationpath = os.path.join (shared.codePath(), 'translations', 'bitmessage_' + locale)
|
||||||
qtranslator.load(translationpath)
|
qmytranslator.load(translationpath)
|
||||||
QtGui.QApplication.installTranslator(qtranslator)
|
QtGui.QApplication.installTranslator(qmytranslator)
|
||||||
|
|
||||||
|
qsystranslator = QtCore.QTranslator()
|
||||||
|
translationpath = os.path.join (str(QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)), 'qt_' + locale)
|
||||||
|
qsystranslator.load(translationpath)
|
||||||
|
QtGui.QApplication.installTranslator(qsystranslator)
|
||||||
|
|
||||||
class MyForm(settingsmixin.SMainWindow):
|
class MyForm(settingsmixin.SMainWindow):
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user