We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = None created_at = <Date 2013-12-21.16:15:20.607> labels = ['library'] title = 'gettext.install() ignores previous call to locale.setlocale()' updated_at = <Date 2019-05-12.14:29:47.179> user = 'https://bugs.python.org/fmoreau'
bugs.python.org fields:
activity = <Date 2019-05-12.14:29:47.179> actor = 'a.badger' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = <Date 2013-12-21.16:15:20.607> creator = 'fmoreau' dependencies = [] files = [] hgrepos = [] issue_num = 20044 keywords = [] message_count = 2.0 messages = ['206762', '342258'] nosy_count = 3.0 nosy_names = ['jwilk', 'a.badger', 'fmoreau'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'open' superseder = None type = None url = 'https://bugs.python.org/issue20044' versions = ['Python 2.7']
The text was updated successfully, but these errors were encountered:
It seems that gettext.install() uses environment variables such as LANGUAGE, to find out which language it should use to find the translation file.
This means that any local settings done by setlocale() previoulsy are ignored.
I don't think it's the case with the C implementation.
Sorry, something went wrong.
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.
No branches or pull requests
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: