tmake wordlist use default language if available - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit b305dd4a8972710dc05a4e1a6677ddfea2efcca2 DIR parent 441c68fbcca691106e3172924136a19c7cee3dfc HTML Author: ThomasV <thomasv@gitorious> Date: Mon, 15 Sep 2014 10:04:36 +0200 make wordlist use default language if available Diffstat: M lib/i18n.py | 1 + M lib/mnemonic.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) --- DIR diff --git a/lib/i18n.py b/lib/i18n.py t@@ -25,6 +25,7 @@ else: language = gettext.translation('electrum', LOCALE_DIR, fallback = True) + def _(x): global language return language.ugettext(x) DIR diff --git a/lib/mnemonic.py b/lib/mnemonic.py t@@ -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 = [ t@@ -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()