Fix bindtextdomain not available on MacOS

This commit is contained in:
Philipp Hörist 2017-10-17 16:28:56 +02:00
parent f234722456
commit 1f0cc2b665
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ else:
if base is None or base[0] != '/':
base = os.path.expanduser('~/.local/share')
localedir = os.path.join(base, "locale")
locale.bindtextdomain(APP, localedir)
if hasattr(locale, 'bindtextdomain'):
locale.bindtextdomain(APP, localedir)
gettext.install(APP, localedir)
if gettext._translations: