kernelbase: Reimplement LOCALE_*CTRYNAME in GetLocaleInfoW/Ex using the locale.nls data.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2022-03-28 12:27:45 +02:00
parent 85a39a9773
commit 2c70ed249a
2 changed files with 7 additions and 9 deletions

View File

@ -915,13 +915,14 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SLOCALIZEDCOUNTRYNAME:
return -1;
/* FIXME: localization */
return locale_return_string( locale->sengcountry, type, buffer, len );
case LOCALE_SABBREVCTRYNAME:
return -1;
return locale_return_string( locale->sabbrevctryname, type, buffer, len );
case LOCALE_SNATIVECTRYNAME:
return -1;
return locale_return_string( locale->snativectryname, type, buffer, len );
case LOCALE_IDEFAULTLANGUAGE:
return locale_return_number( locale->idefaultlanguage, type, buffer, len );
@ -1097,7 +1098,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return locale_return_string( locale->siso639langname, type, buffer, len );
case LOCALE_SISO3166CTRYNAME:
return -1;
return locale_return_string( locale->siso3166ctryname, type, buffer, len );
case LOCALE_IGEOID:
return -1;
@ -1129,7 +1130,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return locale_return_string( locale->siso639langname2, type, buffer, len );
case LOCALE_SISO3166CTRYNAME2:
return -1;
return locale_return_string( locale->siso3166ctryname2, type, buffer, len );
case LOCALE_SNAN:
return -1;
@ -1205,7 +1206,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return locale_return_string( locale->senglanguage, type, buffer, len );
case LOCALE_SENGCOUNTRY:
return -1;
return locale_return_string( locale->sengcountry, type, buffer, len );
case LOCALE_STIMEFORMAT:
return -1;

View File

@ -363,9 +363,6 @@ LCID locale_to_LCID(const char *locale, unsigned short *codepage, BOOL *sname)
search.allow_sname = TRUE;
}
if(!_stricmp(search.search_country, "China"))
strcpy(search.search_country, "People's Republic of China");
EnumResourceLanguagesA(GetModuleHandleA("KERNEL32"), (LPSTR)RT_STRING,
(LPCSTR)LOCALE_ILANGUAGE,find_best_locale_proc,
(LONG_PTR)&search);