import gettext
import locale
import os

from stillControl import constants

DOMAIN = "stillcontrol"
LOCALE_DIR = os.path.join(constants.MAIN_DIR, "locale")

locale.bindtextdomain(DOMAIN, LOCALE_DIR)
locale.textdomain(DOMAIN)

_translation = gettext.translation(DOMAIN, localedir=LOCALE_DIR, fallback=True)
_ = _translation.gettext
ngettext = _translation.ngettext
