message translations don't honor per-thread locales
While testing a prototype of a fix for 5821, I doctored up some translations for things like strerror. I discovered that when I used uselocale() to change the LC_MESSAGES setting of a given locale, that it ignored the setting of the locale and ended up giving me the message in the global locale. Looking into the implementation, the problem (which is replicated in gettxt() and __gtxt()). All of these systems try to grab out the current locale to use to look up messages based on something that looks roughly like:
284 curloc = setlocale(LC_MESSAGES, NULL);
Instead, they should get the name of the current locale that's actually in use by the thread, which can be obtained by a uselocale(NULL) call and an internal libc function.
Updated by Electric Monk about 5 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
commit b599bd937c305a895426e8c412ca920ce7824850 Author: Robert Mustacchi <firstname.lastname@example.org> Date: 2015-10-05T22:46:09.000Z 5821 need strerror_l() 6133 message translations don't honor per-thread locales 6142 extra space in newlocale synopsis 6181 symbol test shouldn't leave gcc fix-includes to chance Reviewed by: Garrett D'Amore <email@example.com> Reviewed by: Josef 'Jeff' Sipek <firstname.lastname@example.org> Approved by: Richard Lowe <email@example.com>