[PATCH] kernel32: Respect the LANG environment variable on Mac OS.
ken at codeweavers.com
Mon Nov 30 22:12:49 CST 2009
On Nov 30, 2009, at 9:34 PM, James McKenzie wrote:
>>> This algorithm is used in all programs that rely on GNU gettext and works
>>> perfectly fine:
>>> - By default, no LANG or LC_* environment variable is set, hence the
>>> programs obey the user settings.
>>> - For users of Terminal.app, who set these environment variables, the
>>> programs obey the environment variables.
>> It is Terminal.app itself which is setting LANG for all shells it creates, by default. The user is most likely oblivious to this fact.
> The idea behind most of the MacIntosh 'magic' is that the user is
> deliberately oblivous to this.
I agree that Wine (well, anything) should meet the user's expectations without the user having to even be aware of their expectations. Unfortunately, "respecting" LANG does not lead to this...
> I just ran the set command in a
> terminal.app session, of which I have several running right now, and it
> was set to en_US.utf8, which is what I expect because the 'American'
> flag is displayed in the top information bar (also called the 'Apple'
> bar.) Gert may want to run the set command in a terminal session and
> given what was said, the LANG setting should be en_ZA.utf8, which is
> what I expect for South African English.
First, the language and formats have nothing to do with the keyboard layout (the U.S. flag in the input menu).
But, more importantly for this discussion, the fact that LANG will be appropriate for you and probably Gert does not mean it will be appropriate "often enough" for Wine to rely on. As I have said, there are many ways in which users configure their language and formats settings that will not be properly reflected in LANG (and, indeed, cannot be).
> The Wine project could use this as a default with the Mac, which is not
> POSIX compliant.
You are suggesting using a proxy for the real thing rather than the real thing. If we want to maintain the "magic", Wine should just use the settings from System Preferences directly (via CFLocale, CFNumberFormatter, and CFDateFormatter), with an optional way to override them for those rare users who want Wine's behavior to deviate from the system's.
LANG doesn't help maintain the magic. It's a hindrance.
More information about the wine-devel