SomberNight
4 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
2 changed files with
12 additions and
2 deletions
-
electrum/gui/kivy/main_window.py
-
electrum/gui/kivy/util.py
|
|
@ -28,6 +28,7 @@ from electrum.bitcoin import COIN |
|
|
|
|
|
|
|
from electrum.gui import messages |
|
|
|
from .i18n import _ |
|
|
|
from .util import get_default_language |
|
|
|
from . import KIVY_GUI_PATH |
|
|
|
|
|
|
|
from kivy.app import App |
|
|
@ -402,7 +403,7 @@ class ElectrumWindow(App, Logger): |
|
|
|
Logger.__init__(self) |
|
|
|
|
|
|
|
self.electrum_config = config = kwargs.get('config', None) # type: SimpleConfig |
|
|
|
self.language = config.get('language', 'en') |
|
|
|
self.language = config.get('language', get_default_language()) |
|
|
|
self.network = network = kwargs.get('network', None) # type: Network |
|
|
|
if self.network: |
|
|
|
self.num_blocks = self.network.get_local_height() |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
from kivy.utils import get_color_from_hex |
|
|
|
from kivy.utils import get_color_from_hex, platform |
|
|
|
|
|
|
|
|
|
|
|
def address_colors(wallet, addr): |
|
|
@ -21,3 +21,12 @@ def address_colors(wallet, addr): |
|
|
|
elif wallet.is_billing_address(addr): |
|
|
|
colors = BLUE |
|
|
|
return (get_color_from_hex(color) for color in colors) |
|
|
|
|
|
|
|
|
|
|
|
def get_default_language() -> str: |
|
|
|
if platform != 'android': |
|
|
|
return 'en_UK' |
|
|
|
from jnius import autoclass |
|
|
|
Locale = autoclass("java.util.Locale") |
|
|
|
lang = str(Locale.getDefault().toString()) |
|
|
|
return lang if lang else 'en_UK' |
|
|
|