0003770: Transutils crashes if it cannot find /usr/local/share/locale
svn: r15007
This commit is contained in:
parent
fa97100070
commit
9c514656a2
@ -51,8 +51,12 @@ if "GRAMPSI18N" in os.environ:
|
|||||||
LOCALEDIR = os.environ["GRAMPSI18N"]
|
LOCALEDIR = os.environ["GRAMPSI18N"]
|
||||||
elif os.path.exists( os.path.join(const.ROOT_DIR, "lang") ):
|
elif os.path.exists( os.path.join(const.ROOT_DIR, "lang") ):
|
||||||
LOCALEDIR = 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")
|
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'
|
LOCALEDOMAIN = 'gramps'
|
||||||
|
|
||||||
@ -237,6 +241,9 @@ def get_available_translations():
|
|||||||
"""
|
"""
|
||||||
languages = ["en"]
|
languages = ["en"]
|
||||||
|
|
||||||
|
if LOCALEDIR is None:
|
||||||
|
return languages
|
||||||
|
|
||||||
for langdir in os.listdir(LOCALEDIR):
|
for langdir in os.listdir(LOCALEDIR):
|
||||||
mofilename = os.path.join( LOCALEDIR, langdir,
|
mofilename = os.path.join( LOCALEDIR, langdir,
|
||||||
"LC_MESSAGES", "%s.mo" % LOCALEDOMAIN )
|
"LC_MESSAGES", "%s.mo" % LOCALEDOMAIN )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user