You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
362 B

import gettext
from pathlib import Path
script_dir = Path(__file__).resolve().parent
locale_dir = script_dir / "locale"
def setup_i18n():
translate = gettext.translation("statemachine", locale_dir, fallback=True)
gettext.bindtextdomain("statemachine", locale_dir)
gettext.textdomain("statemachine")
return translate.gettext
_ = setup_i18n()