GrampsLocale: Don't try to set self.localedir to _first.localedir if the latter path doesn't exist.
This commit is contained in:
parent
c1dcd6f59e
commit
10921cee29
@ -533,10 +533,11 @@ class GrampsLocale(object):
|
||||
# _init_secondary_locale if this comes up empty.
|
||||
if localedir and os.path.exists(os.path.abspath(localedir)):
|
||||
self.localedir = localedir
|
||||
elif _first and hasattr(_first, 'localedir'):
|
||||
elif (_first and hasattr(_first, 'localedir') and
|
||||
os.path.exists(os.path.abspath(_first.localedir))):
|
||||
self.localedir = _first.localedir
|
||||
else:
|
||||
LOG.warn("No Localedir or localdir %s invalid", localedir)
|
||||
LOG.warn('Missing or invalid localedir %s; no translations will be available.', repr(localedir))
|
||||
|
||||
self.lang = lang
|
||||
self.localedomain = domain or 'gramps'
|
||||
@ -547,7 +548,6 @@ class GrampsLocale(object):
|
||||
else:
|
||||
self.language = None
|
||||
|
||||
_first = self._GrampsLocale__first_instance
|
||||
if self == _first:
|
||||
self._GrampsLocale__init_first_instance()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user