Bug #6133
closedmessage translations don't honor per-thread locales
100%
Description
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 over 6 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
git commit b599bd937c305a895426e8c412ca920ce7824850
commit b599bd937c305a895426e8c412ca920ce7824850 Author: Robert Mustacchi <rm@joyent.com> 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 <garrett@damore.org> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>