electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit b305dd4a8972710dc05a4e1a6677ddfea2efcca2
parent 441c68fbcca691106e3172924136a19c7cee3dfc
Author: ThomasV <thomasv@gitorious>
Date:   Mon, 15 Sep 2014 10:04:36 +0200

make wordlist use default language if available

Diffstat:
Mlib/i18n.py | 1+
Mlib/mnemonic.py | 6++++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/i18n.py b/lib/i18n.py @@ -25,6 +25,7 @@ else: language = gettext.translation('electrum', LOCALE_DIR, fallback = True) + def _(x): global language return language.ugettext(x) diff --git a/lib/mnemonic.py b/lib/mnemonic.py @@ -30,7 +30,7 @@ import util from util import print_error from bitcoin import is_old_seed, is_new_seed import version - +import i18n # http://www.asahi-net.or.jp/~ax2s-kmtn/ref/unicode/e_asia.html CJK_INTERVALS = [ @@ -100,7 +100,9 @@ class Mnemonic(object): # Mnemonic phrase uses a hash based checksum, instead of a wordlist-dependent checksum def __init__(self, lang=None): - if lang is None: lang='en' + if lang in [None, '']: + lang = i18n.language.info().get('language') + print_error('language', lang) filename = filenames.get(lang[0:2], 'english.txt') path = os.path.join(util.data_dir(), 'wordlist', filename) s = open(path,'r').read().strip()