Module: wine Branch: master Commit: 730bdf6c5c0d35eabd2563cc65e3e4208e5a306f URL: https://gitlab.winehq.org/wine/wine/-/commit/730bdf6c5c0d35eabd2563cc65e3e42...
Author: Jactry Zeng jzeng@codeweavers.com Date: Tue Nov 28 09:33:15 2023 +0100
ntdll: Initialize locale from Mac language identifiers with script name.
---
dlls/ntdll/unix/env.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 6b249917cfe..1110acfd0fd 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -833,6 +833,7 @@ static void init_locale(void) { CFStringRef lang = CFDictionaryGetValue( components, kCFLocaleLanguageCode ); CFStringRef country = CFDictionaryGetValue( components, kCFLocaleCountryCode ); + CFStringRef script = CFDictionaryGetValue( components, kCFLocaleScriptCode ); CFLocaleRef mac_user_locale = NULL; CFStringRef locale_string;
@@ -841,7 +842,11 @@ static void init_locale(void) mac_user_locale = CFLocaleCopyCurrent(); country = CFLocaleGetValue( mac_user_locale, kCFLocaleCountryCode ); } - if (country) + if (country && script) + locale_string = CFStringCreateWithFormat( NULL, NULL, CFSTR("%@-%@-%@"), lang, script, country ); + else if (script) + locale_string = CFStringCreateWithFormat( NULL, NULL, CFSTR("%@-%@"), lang, script ); + else if (country) locale_string = CFStringCreateWithFormat( NULL, NULL, CFSTR("%@-%@"), lang, country ); else locale_string = CFStringCreateCopy( NULL, lang );