Install unicode gettext function if Python 2

This commit is contained in:
Manuel Cortez 2018-03-12 09:27:03 -06:00
parent c67c835ecd
commit 39994be579

View File

@ -2,9 +2,13 @@
import os
import gettext
import locale
import sys
from platform_utils import paths
def setup():
lang = locale.getdefaultlocale()[0]
os.environ["lang"] = lang
gettext.install("musicdl", localedir=os.path.join(paths.app_path(), "locales"))
if sys.version[0] == "3":
gettext.install("musicdl", localedir=os.path.join(paths.app_path(), "locales"))
else:
gettext.install("musicdl", localedir=os.path.join(paths.app_path(), "locales"), unicode=True)