This commit is contained in:
Kovid Goyal 2012-08-14 18:21:26 +05:30
parent e0308df2b1
commit d87a8756f3

View File

@ -57,7 +57,12 @@ def get_lang():
lang = os.environ.get('CALIBRE_OVERRIDE_LANG', lang) lang = os.environ.get('CALIBRE_OVERRIDE_LANG', lang)
if lang: if lang:
return lang return lang
lang = get_system_locale() try:
lang = get_system_locale()
except:
import traceback
traceback.print_exc()
lang = None
if lang: if lang:
match = re.match('[a-z]{2,3}(_[A-Z]{2}){0,1}', lang) match = re.match('[a-z]{2,3}(_[A-Z]{2}){0,1}', lang)
if match: if match: