"Vincent BĂ©ron" vberon@mecano.gme.usherb.ca wrote:
W2k here, so this is valid only for it. LANGIDFROMLCID(GetLocaleThread()) returns 0x0c0c (FRENCH/FRENCH_CANADIAN) if I don't modify it via SetThreadLocale(), so I guess that's the default value for that system (equivalent to LC_ALL=fr_CA).
The results I got (for LoadString and FindResource) are different from yours though (still W2k). Here's for test.exe 0x0c0c:
- LANG_NEUTRAL/SUBLANG_NEUTRAL
- LANG_FRENCH/SUBLANG_FRENCH (==SUBLANG_DEFAULT)
- LANG_FRENCH/SUBLANG_NEUTRAL
- LANG_FRENCH/SUBLANG_FRENCH_CANADIAN
- LANG_ENGLISH/SUBLANG_DEFAULT
- LANG_ARABIC/SUBLANG_NEUTRAL
So our #2, #3 and #5 are different. Are they dependant on the system default language? I believe it's more logical to look for the same language as the current locale before a harcoded English, else as soon as there's an English resource (DEFAULT or NEUTRAL) nothing else will be displayed.
Here are the results for test.exe 0x0419 (RUSSIAN/DEFAULT) on the same system:
- NEUTRAL/NEUTRAL
- RUSSIAN/DEFAULT
- FRENCH/DEFAULT
- FRENCH/NEUTRAL
- FRENCH/FRENCH_CANADIAN
- ENGLISH/DEFAULT
- ARABIC/NEUTRAL
So we see it goes for current language id/default before system default/default, and current language id/neutral is not looked for at all.
Dmitry, on which language have you tested your program under Windows?
I'm running English version of win2k pro with regional settings set to Russia.
Here are the results for 0x0c0c and 0x0419 on my system.
test.exe 0x0c0c 1. LANG_NEUTRAL/SUBLANG_NEUTRAL 2. LANG_FRENCH/SUBLANG_FRENCH_CANADIAN 3. LANG_ENGLISH/SUBLANG_DEFAULT 4. LANG_ENGLISH/SUBLANG_NEUTRAL 5. LANG_RUSSIAN/SUBLANG_DEFAULT 6. LANG_RUSSIAN/SUBLANG_NEUTRAL 7. LANG_ARABIC/SUBLANG_NEUTRAL
test.exe 0x0419 1. LANG_NEUTRAL/SUBLANG_NEUTRAL 2. LANG_ENGLISH/SUBLANG_DEFAULT 3. LANG_ENGLISH/SUBLANG_NEUTRAL 4. LANG_RUSSIAN/SUBLANG_DEFAULT 5. LANG_RUSSIAN/SUBLANG_NEUTRAL 6. LANG_ARABIC/SUBLANG_NEUTRAL
It seems that we have correct order of defaults in dlls/ntdll/resource.c and my patch adding LANG_ENGLISH/SUBLANG_NEUTRAL is wrong. It would be correct to add current thread locale language with neutral sublanguage after #4 though.
-- Dmitry.