http://bugs.winehq.org/show_bug.cgi?id=33447
--- Comment #14 from Ken Thomases ken@codeweavers.com 2013-04-24 14:33:49 CDT --- The Mac has language settings and region (locale) settings. In dlls/kernel32/locale.c:LOCALE_Init(), Wine uses the CFLocale API to access the latter. It gets separate language and country codes and then combines them into the form of a POSIX locale identifier. In your log that looks like:
trace:nls:LOCALE_Init setting locale to 'zh_CN.UTF-8'
So, that's correct.
Later, it tries to figure out the system language setting. It only does this if neither LC_ALL or LC_MESSAGES are set in the environment. They aren't in your case. Your language setting is "zh-Hans", which is an IETF / BCP 47 language tag. The Mac API seems to have attempted to canonicalize that from into a locale identifier and got "zh_Hans". (My Mac OS X 10.6.x system doesn't do that and leaves it as "zh-Hans", although the results aren't any better.)
trace:nls:LOCALE_Init setting lcid_LC_MESSAGES to 'zh_Hans'
We need a way to convert the language tag (combines a language subtag and a script subtag) to a locale identifier (combines a language subtag and a country code). There's nothing in the Mac APIs that does this, as far as I'm aware. I found some code in gettext that deals with this problem with hard-coded lookup tables (although technically, it's still working with locale identifiers). http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/local...
As an aside, the LOCALE_Init() code for determining the preferred language from the Mac system settings could be simplified. We can use the CFLocaleCopyPreferredLanguages() function rather than using CFBundle stuff.