kernelbase: Reimplement LOCALE_*LANGNAME 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:26:34 +02:00
parent 956c88db18
commit 85a39a9773
2 changed files with 14 additions and 8 deletions

View File

@ -906,10 +906,10 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SABBREVLANGNAME:
return -1;
return locale_return_string( locale->sabbrevlangname, type, buffer, len );
case LOCALE_SNATIVELANGNAME:
return -1;
return locale_return_string( locale->snativelangname, type, buffer, len );
case LOCALE_ICOUNTRY:
return -1;
@ -1094,7 +1094,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SISO639LANGNAME:
return -1;
return locale_return_string( locale->siso639langname, type, buffer, len );
case LOCALE_SISO3166CTRYNAME:
return -1;
@ -1126,7 +1126,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SISO639LANGNAME2:
return -1;
return locale_return_string( locale->siso639langname2, type, buffer, len );
case LOCALE_SISO3166CTRYNAME2:
return -1;
@ -1150,7 +1150,8 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SLOCALIZEDLANGUAGENAME:
return -1;
/* FIXME: localization */
return locale_return_string( locale->senglanguage, type, buffer, len );
case LOCALE_IREADINGLAYOUT:
return -1;
@ -1201,7 +1202,7 @@ static int get_locale_info( const NLS_LOCALE_DATA *locale, LCID lcid, LCTYPE typ
return -1;
case LOCALE_SENGLANGUAGE:
return -1;
return locale_return_string( locale->senglanguage, type, buffer, len );
case LOCALE_SENGCOUNTRY:
return -1;

View File

@ -525,8 +525,13 @@ static BOOL update_threadlocinfo_category(LCID lcid, unsigned short cp,
if(!locinfo->lc_category[category].locale) {
int len = 0;
len += GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE
|LOCALE_NOUSEROVERRIDE, buf, 256);
if (lcid == MAKELANGID( LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK ))
{
/* locale.nls contains "Norwegian Nynorsk" instead for LOCALE_SENGLANGUAGE */
strcpy( buf, "Norwegian-Nynorsk" );
len = strlen( buf ) + 1;
}
else len += GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE|LOCALE_NOUSEROVERRIDE, buf, 256);
buf[len-1] = '_';
len += GetLocaleInfoA(lcid, LOCALE_SENGCOUNTRY
|LOCALE_NOUSEROVERRIDE, &buf[len], 256-len);