import gettext


def app_translator(lang):
    """Localization of the application.

    Arguments
    ---------
        lang: "String containing application language"

    Modules
    -------
        gettext: "Internationalization and localization support"

    Returns
    -------
        trad: "Function to translate string"
    """
    language = gettext.translation('PyArchboot',
                                   localedir='locales',
                                   languages=['{lang}'.format(lang=lang)])
    trad = language.gettext
    return trad