music-dl/src/i18n.py

14 lines
396 B
Python
Raw Normal View History

2018-01-24 17:43:35 -06:00
# -*- coding: utf-8 -*-
import os
import gettext
import locale
import sys
2018-01-24 17:43:35 -06:00
from platform_utils import paths
def setup():
2018-02-27 13:41:18 -06:00
lang = locale.getdefaultlocale()[0]
os.environ["lang"] = lang
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)