From 544f1144597447c9b740dca2b2117516871b12d8 Mon Sep 17 00:00:00 2001 From: winesync Date: Thu, 25 Apr 2024 19:53:32 +0300 Subject: [PATCH] [WINESYNC] kernel32: Use different default sublangs for Spanish and Chinese. Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard wine commit id 7737693693ca46a88c41cfeab95d2b65423d8e51 by Andrew Eikum --- dll/win32/kernel32/winnls/string/locale.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dll/win32/kernel32/winnls/string/locale.c b/dll/win32/kernel32/winnls/string/locale.c index d42a2394609..8e32afcbd67 100644 --- a/dll/win32/kernel32/winnls/string/locale.c +++ b/dll/win32/kernel32/winnls/string/locale.c @@ -354,6 +354,7 @@ static UINT find_charset( const WCHAR *name ) if (entry) return entry->codepage; return 0; } +#endif // (WINVER >= 0x0600) static LANGID get_default_sublang( LANGID lang ) { @@ -373,6 +374,7 @@ static LANGID get_default_sublang( LANGID lang ) return lang; } +#if (WINVER >= 0x0600) /*********************************************************************** * find_locale_id_callback */ @@ -1720,7 +1722,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) /* replace SUBLANG_NEUTRAL by SUBLANG_DEFAULT */ if (SUBLANGID(lang_id) == SUBLANG_NEUTRAL) - lang_id = MAKELANGID(PRIMARYLANGID(lang_id), SUBLANG_DEFAULT); + lang_id = MAKELANGID(PRIMARYLANGID(lang_id), get_default_sublang( lang_id )); if (lctype != LOCALE_FONTSIGNATURE) { @@ -2868,7 +2870,7 @@ LCID WINAPI ConvertDefaultLocale( LCID lcid ) langid = LANGIDFROMLCID(lcid); if (SUBLANGID(langid) == SUBLANG_NEUTRAL) { - langid = MAKELANGID(PRIMARYLANGID(langid), SUBLANG_DEFAULT); + langid = MAKELANGID(PRIMARYLANGID(langid), get_default_sublang( langid )); lcid = MAKELCID(langid, SORTIDFROMLCID(lcid)); } } @@ -4407,7 +4409,7 @@ static BOOL NLS_GetLanguageGroupName(LGRPID lgrpid, LPWSTR szName, ULONG nameSiz langId = GetSystemDefaultLangID(); if (SUBLANGID(langId) == SUBLANG_NEUTRAL) - langId = MAKELANGID( PRIMARYLANGID(langId), SUBLANG_DEFAULT ); + langId = MAKELANGID(PRIMARYLANGID(langId), get_default_sublang( langId )); hResource = FindResourceExW( kernel32_handle, (LPWSTR)RT_STRING, szResourceName, langId );