* when locale is not set (C locale) we use en locale

This commit is contained in:
Eray Özkural
2005-12-10 21:11:31 +00:00
parent f922cf330c
commit eba70e9fac
+3
View File
@@ -113,6 +113,9 @@ class LocalText(dict):
(lang, encoding) = locale.getlocale() (lang, encoding) = locale.getlocale()
if not lang: if not lang:
(lang, encoding) = locale.getdefaultlocale() (lang, encoding) = locale.getdefaultlocale()
if lang==None: # stupid python means it is C locale
return 'en'
else:
return lang[0:2] return lang[0:2]
except: except:
raise Error(_('LocalText: unable to get either current or default locale')) raise Error(_('LocalText: unable to get either current or default locale'))