Commit 7ae92654 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Fixed GetLocaleInfo32A for other languages than en_uk.

Made it recognise LOCALE_SYSTEM_DEFAULT, LOCALE_SYSTEM_DEFAULT and last but not least the first argument lcid where is all about...
parent f4f1719c
...@@ -414,11 +414,18 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len) ...@@ -414,11 +414,18 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len)
{ {
char *retString; char *retString;
int found,i; int found,i;
int lang; int lang=0;
TRACE(ole,"(0x%lx,0x%lx,%p,%x)\n", TRACE(ole,"(lcid=0x%lx,lctype=0x%lx,%p,%x)\n",
lcid,LCType,buf,len); lcid,LCType,buf,len);
if (lcid == LOCALE_SYSTEM_DEFAULT || (LCType & LOCALE_NOUSEROVERRIDE) )
{ lcid = GetSystemDefaultLCID();
}
else if (lcid == LOCALE_USER_DEFAULT)
{ lcid = GetUserDefaultLCID();
}
LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP); LCType &= ~(LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);
/* As an option, we could obtain the value from win.ini. /* As an option, we could obtain the value from win.ini.
...@@ -441,100 +448,71 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len) ...@@ -441,100 +448,71 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len)
} }
#define LOCVAL(type,value) case type:retString=value;found=1;break; #define LOCVAL(type,value) case type:retString=value;found=1;break;
#define LANG_BEGIN(l,s) case MAKELANGID(l,s): switch (LCType) {
#define LANG_END default: found=0; break; } break;
/* Now, the language specific definitions. They don't have to be /* Now, the language specific definitions. They don't have to be
complete */ complete */
found=0; i=0;
do { found=0; i=0; lang=lcid;
if (i==0) lang=Languages[Options.language].langid;
if (i==1) lang=MAKELANGID( PRIMARYLANGID(lang), SUBLANG_DEFAULT); if (lang ==0x400) /*LANG_NEUTRAL ==> US English*/
i++; { lang = 0x409;
WARN(ole,"no language set, assume LANG_ENGLISH_US \n");
}
do
{ switch(lang)
{
switch(lang) { LANG_BEGIN (LANG_GERMAN, SUBLANG_GERMAN) /*0x407*/
case LANG_De:
switch (LCType) {
#include "nls/deu.nls" #include "nls/deu.nls"
default: found=0; break; LANG_END
}
break; /* LANG(De) */
case LANG_Da: LANG_BEGIN (LANG_DANISH, SUBLANG_DEFAULT) /*0x406*/
switch (LCType) {
#include "nls/dan.nls" #include "nls/dan.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Da) */
case LANG_En: LANG_BEGIN (LANG_ENGLISH, SUBLANG_ENGLISH_US) /*0x409*/
switch (LCType) {
#include "nls/enu.nls" #include "nls/enu.nls"
default: found=0;break; LANG_END
}
break; /* LANG(En) */
case LANG_Eo: LANG_BEGIN (LANG_ESPERANTO, SUBLANG_DEFAULT) /*0x48f*/
switch (LCType) {
#include "nls/esperanto.nls" #include "nls/esperanto.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Eo) */
case LANG_Fi: LANG_BEGIN (LANG_FINNISH, SUBLANG_DEFAULT) /*0x040B*/
switch (LCType) {
#include "nls/fin.nls" #include "nls/fin.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Fi) */
case LANG_It: LANG_BEGIN (LANG_ITALIAN, SUBLANG_ITALIAN) /*0x410*/
switch (LCType) {
#include "nls/ita.nls" #include "nls/ita.nls"
default: found=0;break; LANG_END
}
break; /* LANG(It) */
case 0x0809: LANG_BEGIN (LANG_ENGLISH, SUBLANG_ENGLISH_UK) /*0x809*/
switch (LCType) {
#include "nls/eng.nls" #include "nls/eng.nls"
default: found=0;break; LANG_END
}
break; /* LANG(0x0809) (U.K. English) */
case LANG_Ko: /* string using codepage 949 */ LANG_BEGIN (LANG_KOREAN, SUBLANG_KOREAN) /*0x412*/
switch (LCType) {
#include "nls/kor.nls" #include "nls/kor.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Ko) */
case LANG_Hu: LANG_BEGIN (LANG_HUNGARIAN, SUBLANG_DEFAULT) /*0x40e*/
switch (LCType) {
#include "nls/hun.nls" #include "nls/hun.nls"
default: found=0;break; LANG_END
}
break; /* LANG(En) */
case LANG_Pl: LANG_BEGIN (LANG_POLISH, SUBLANG_DEFAULT) /*0x415*/
switch (LCType) {
#include "nls/plk.nls" #include "nls/plk.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Pl) */
case LANG_Pt: LANG_BEGIN (LANG_PORTUGUESE ,SUBLANG_PORTUGUESE_BRAZILIAN) /*0x416*/
switch (LCType) {
#include "nls/ptb.nls" #include "nls/ptb.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Pt) */
case LANG_Sv: LANG_BEGIN (LANG_SWEDISH, SUBLANG_DEFAULT) /*0x41d*/
switch (LCType) {
#include "nls/sve.nls" #include "nls/sve.nls"
default: found=0;break; LANG_END
}
break; /* LANG(Sv) */
/*Insert other languages here*/ /*Insert other languages here*/
...@@ -542,13 +520,16 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len) ...@@ -542,13 +520,16 @@ INT32 WINAPI GetLocaleInfo32A(LCID lcid,LCTYPE LCType,LPSTR buf,INT32 len)
found=0; found=0;
break; break;
} /* switch */ } /* switch */
/* language not found, try without a sublanguage*/
lang=MAKELANGID( PRIMARYLANGID(lang), SUBLANG_DEFAULT);
i++;
} while (!found && i<2); } while (!found && i<2);
if(!found) { if(!found) {
ERR(ole,"'%s' not supported for your language.\n", ERR(ole,"'%s' not supported for your language.\n",
retString); retString);
retString = "<WINE-NLS-unknown>"; retString = "<WINE-NLS-unknown>";
/*return 0;*/
} }
if (buf) if (buf)
lstrcpyn32A(buf,retString,len); lstrcpyn32A(buf,retString,len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment