[Bug 33447] Wine GUI on Mac display Traditional Chinese instead when host language is Simplify Chinese
wine-bugs at winehq.org
wine-bugs at winehq.org
Wed Apr 24 14:33:49 CDT 2013
http://bugs.winehq.org/show_bug.cgi?id=33447
--- Comment #14 from Ken Thomases <ken at 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/localename.c
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.
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the wine-bugs
mailing list