mirror of
https://github.com/Athemis/PyDSF.git
synced 2025-04-19 03:19:13 +00:00
Fix loading of translations
This commit is contained in:
parent
750a9b7157
commit
e1b0edd292
2 changed files with 14 additions and 10 deletions
11
main.py
11
main.py
|
@ -11,11 +11,14 @@ if __name__ == "__main__":
|
|||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
translationFiles = glob.glob("i18n/*.qm")
|
||||
translator = QtCore.QTranslator()
|
||||
for translationFile in translationFiles:
|
||||
translator.load(translationFile)
|
||||
app.installTranslator(translator)
|
||||
# get system locale
|
||||
systemLocale = QtCore.QLocale.system().name()
|
||||
translationFile = "i18n/{}".format(systemLocale)
|
||||
# load translation file and install translator
|
||||
translator.load(translationFile)
|
||||
app.installTranslator(translator)
|
||||
# fire up main ui
|
||||
ui = MainWindow()
|
||||
ui.show()
|
||||
sys.exit(app.exec_())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue