Project

General

Profile

Bug #6133

message translations don't honor per-thread locales

Added by Robert Mustacchi over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
High
Category:
lib - userland libraries
Start date:
2015-08-17
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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.

#1

Updated by Electric Monk about 5 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>

Also available in: Atom PDF