John,
some definitions don't have a direct translation in italian, and usually the english word has become standard name.
Anyway I still don't like the workaround
. Is horrible, and difficult to maintain (you have to remember to update the list of languages in the check code).
So I have prepared a different approach. In each translation I added a string that is the language code stringized (a neologism
). Then I modified the check in the following way:
void IsLanguageSupported(void)
{
//Check if local language is supported, and if not set english as default
char buf[16];
if (LoadStringA(g_hInst, HAVE_LANGUAGE, buf, 16)) //Load the system choosed locale string
{
WORD ResLid = strtol(buf, NULL, 16);
WORD SysLid = GetThreadLocale();
if (SysLid == ResLid) //We got our locale
return; //nothing to do.
//Do we match at least the primary language?
if (PRIMARYLANGID(SysLid) == PRIMARYLANGID(ResLid))
return; //Yes primary language matches. We will get close translation.
}
//If we are here we couldn't have load the string or we haven't find a suitable
//language. We then stick to english uk as default.
SetLanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK));
}
This simplify the maintenance because
it is one of the required strings and you can't omit it, and any new language will be automatically recognized.
Find attached the emended FindFileUni.rc and FindFileRes.h.
Have a nice evening.