Browse Source

Merge pull request #4724 from un1t/master

use system language by default
3.3.3.1
ThomasV 6 years ago
committed by GitHub
parent
commit
04571d3b20
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      electrum/gui/qt/__init__.py
  2. 7
      electrum/gui/qt/util.py

2
electrum/gui/qt/__init__.py

@ -87,7 +87,7 @@ class ElectrumGui(PrintError):
@profiler
def __init__(self, config, daemon, plugins):
set_language(config.get('language'))
set_language(config.get('language', get_default_language()))
# Uncomment this call to verify objects are being properly
# GC-ed when windows are closed
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,

7
electrum/gui/qt/util.py

@ -10,7 +10,7 @@ from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from electrum.i18n import _
from electrum.i18n import _, languages
from electrum.util import FileImportFailed, FileExportFailed
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_EXPIRED
@ -817,6 +817,11 @@ class IconCache:
return self.__cache[file_name]
def get_default_language():
name = QLocale.system().name()
return name if name in languages else 'en_UK'
if __name__ == "__main__":
app = QApplication([])
t = WaitingDialog(None, 'testing ...', lambda: [time.sleep(1)], lambda x: QMessageBox.information(None, 'done', "done"))

Loading…
Cancel
Save