This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author a.badger
Recipients a.badger, fmoreau, jwilk
Date 2019-05-12.14:29:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557671387.19.0.337406446492.issue20044@roundup.psfhosted.org>
In-reply-to
Content
I tested a small C program and found that setlocale takes precedence for LC_ALL, LC_MESSAGES, and LANG but not for LANGUAGE.

int main(int argc, char **argv) {
    char *message1;

    //setlocale (LC_ALL, "");
    setlocale (LC_ALL, "pt_BR.utf-8");
    bindtextdomain ("testc", "/srv/python/cpython/tmp");
    textdomain ("testc");

    message1 = gettext("lemon");
    printf("%s\n", message1);
    return 0;
}

$ LC_ALL=es_MX.utf-8 LANGUAGE= LC_MESSAGES=es_MX.utf-8 LANG=es_MX.utf-8 ./test
limão

$ LANGUAGE=es_MX  LANG=es_MX.utf-8 ./test
limón


So this could be considered a bug in the stdlib's gettext.  If we fix it, we'll need to make sure that we continue to honor LANGUAGE, though.
History
Date User Action Args
2019-05-12 14:29:47a.badgersetrecipients: + a.badger, jwilk, fmoreau
2019-05-12 14:29:47a.badgersetmessageid: <1557671387.19.0.337406446492.issue20044@roundup.psfhosted.org>
2019-05-12 14:29:47a.badgerlinkissue20044 messages
2019-05-12 14:29:47a.badgercreate