From 8769efd0da3cb5f211403e40524ea0c64229e591 Mon Sep 17 00:00:00 2001 From: Raphael Ackermann Date: Sat, 3 Apr 2010 11:59:53 +0000 Subject: [PATCH] 0003770: Transutils crashes if it cannot find /usr/local/share/locale svn: r15006 --- src/TransUtils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/TransUtils.py b/src/TransUtils.py index 5eaca26f8..e817b6a97 100644 --- a/src/TransUtils.py +++ b/src/TransUtils.py @@ -51,8 +51,12 @@ if "GRAMPSI18N" in os.environ: LOCALEDIR = os.environ["GRAMPSI18N"] elif os.path.exists( os.path.join(const.ROOT_DIR, "lang") ): LOCALEDIR = os.path.join(const.ROOT_DIR, "lang") -else: +elif os.path.exists(os.path.join(const.PREFIXDIR, "share/locale")): LOCALEDIR = os.path.join(const.PREFIXDIR, "share/locale") +else: + print 'Locale dir does not exist at' + os.path.join(const.PREFIXDIR, "share/locale") + print 'Running ./configure --prefix=YourPrefixDir might fix the problem' + LOCALEDIR = None LOCALEDOMAIN = 'gramps' @@ -237,6 +241,9 @@ def get_available_translations(): """ languages = ["en"] + if LOCALEDIR is None: + return languages + for langdir in os.listdir(LOCALEDIR): mofilename = os.path.join( LOCALEDIR, langdir, "LC_MESSAGES", "%s.mo" % LOCALEDOMAIN )