Alexandre Julliard : kernelbase: Reimplement LOCALE_*LANGNAME in GetLocaleInfoW/Ex using the locale.nls data.

Alexandre Julliard julliard at winehq.org
Mon Mar 28 15:53:40 CDT 2022


Module: wine
Branch: master
Commit: 85a39a977347e037bcd910efd388faa6f04d870a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=85a39a977347e037bcd910efd388faa6f04d870a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar 28 12:26:34 2022 +0200

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

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernelbase/locale.c | 13 +++++++------
 dlls/msvcrt/locale.c     |  9 +++++++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index 7cb16e5b387..0caf790384c 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -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;
diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
index 924671e7047..e800e7142c8 100644
--- a/dlls/msvcrt/locale.c
+++ b/dlls/msvcrt/locale.c
@@ -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);




More information about the wine-cvs mailing list