gettext.install()
gettext.install() is a Python function in the Gettext Module category. Installs _() in Python's builtins for easy translation calls. The syntax is gettext.install(domain, localedir=None, codeset=None, names=None). Returns: None. A typical example: gettext.install("myapp", "locale")
print(_("Welcome")) # Translated. A close sibling is gettext.translation(), which loads a translation file (.mo) and returns a GNUTranslations object. A close sibling is gettext.gettext(), which returns the translated version of a message (alias _()). More about this category: Internationalization — translation, find, textdomain, bindtextdomain, gettext. Related Gettext Module entries: gettext.translation(), gettext.gettext(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try gettext.install() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.