1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Workaround to load right language (#2148)

This commit is contained in:
Manu 2024-11-22 17:32:14 +00:00 committed by GitHub
parent 64586dff07
commit 108d64816c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,7 +65,9 @@ def init_translations(app):
qm_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'qm'))
ui_langs = locale.uiLanguages()
succeeded = translator.load(locale, 'vorta', prefix='.', directory=qm_path) # e.g. vorta/i18n/qm/vorta.de_DE.qm
succeeded = translator.load(
QLocale(ui_langs[0]), 'vorta', prefix='.', directory=qm_path
) # e.g. vorta/i18n/qm/vorta.de_DE.qm
if succeeded:
app.installTranslator(translator)
logger.debug('Loading translation %s for %r.' % ('succeeded' if succeeded else 'failed', ui_langs))