From 10921cee2974f41219aad7c34bacf681e69f606c Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 20 Apr 2014 14:28:30 -0700 Subject: [PATCH] GrampsLocale: Don't try to set self.localedir to _first.localedir if the latter path doesn't exist. --- gramps/gen/utils/grampslocale.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index c55326249..f832d0371 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -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: