[r21554]GrampsLocale:Move setlocale from _set_from_environment to
__init_first_instance So that encoding is set for Mac as well. svn: r21555
This commit is contained in:
parent
3e0fd433b5
commit
7e749a9e25
@ -102,9 +102,6 @@ class GrampsLocale(object):
|
||||
return super(GrampsLocale, cls).__new__(cls)
|
||||
|
||||
def __init_from_environment(self, lang=None, language=None):
|
||||
#First, globally set the locale to what's in the environment:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
if not lang:
|
||||
lang = ' '
|
||||
try:
|
||||
@ -165,6 +162,9 @@ class GrampsLocale(object):
|
||||
def __init_first_instance(self, localedir=None, lang=None,
|
||||
domain=None, language=None):
|
||||
|
||||
#First, globally set the locale to what's in the environment:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
if localedir and os.path.exists(localedir):
|
||||
self.localedir = localedir
|
||||
else:
|
||||
@ -217,7 +217,6 @@ class GrampsLocale(object):
|
||||
locale.setlocale(locale.LC_MONETARY, self.currency)
|
||||
#Next, we need to know what is the encoding from the native environment:
|
||||
self.encoding = locale.getlocale()[1]
|
||||
|
||||
#GtkBuilder depends on reading Glade files as UTF-8 and crashes if it
|
||||
#doesn't, so set $LANG to have a UTF-8 locale. NB: This does *not*
|
||||
#affect locale.getpreferredencoding() or sys.getfilesystemencoding()
|
||||
|
Loading…
Reference in New Issue
Block a user