Update:
I'm not yet familiar with the ufo code nor with language handling. But the snippit from CL_LanguageTryToSet() below looks rather strange to me:
do {
Cvar_Set("s_language", mapping->localeMapping);
#ifdef _WIN32
Com_DPrintf(DEBUG_CLIENT, "CL_LanguageTryToSet: %s\n", mapping->localeMapping);
SDL_putenv(va("LANGUAGE=%s", mapping->localeMapping));
Cvar_Set("s_language", language->localeID);
s_language->modified = qfalse;
return qtrue;
#else
if (setlocale(LC_MESSAGES, mapping->localeMapping)) {
Cvar_Set("s_language", language->localeID);
s_language->modified = qfalse;
return qtrue;
}
#endif
mapping = mapping->next;
} while (mapping);
#ifndef _WIN32
Com_DPrintf(DEBUG_CLIENT, "CL_LanguageTryToSet: Finally try: '%s'\n", localeID);
setlocale(LC_MESSAGES, localeID);
#endif
On WIN32, the do-while will always break after the first loop AND return, so
1. the #ifndef _WIN32 after the while is useless (not the enclosed code)
2. setlocale() is never executed here on WIN32
So as the function behaves *completely* different on WIN32, I would expext a big fat comment stating that.
The missing of such a comment along with the useless #ifndef lets me suspect that the code does not work as the programmer intended.
Anyone around who knows more about how setlocale should work on WIN32 ??