Fall back to en_US if the system locale is not available.

Without this, msgids would be used instead of the more proper
message strings. Also, since RefreshLocale() is never called,
the menu goes missing.
pull/168/head
whitequark 2017-01-14 00:32:47 +00:00
parent cde86a0626
commit 29e43e67ea
2 changed files with 7 additions and 2 deletions

View File

@ -1375,6 +1375,9 @@ int main(int argc, const char *argv[]) {
dbp("%s", ([language UTF8String]));
if(SolveSpace::SetLocale([language UTF8String])) break;
}
if([languages count] == 0) {
SolveSpace::SetLocale("en_US");
}
connexionInit();
SolveSpace::SS.Init();

View File

@ -1517,8 +1517,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
}
#endif
// Use the user default locale.
SetLocale((uint16_t)GetUserDefaultLCID());
// Use the user default locale, then fall back to English.
if(!SetLocale((uint16_t)GetUserDefaultLCID())) {
SetLocale("en_US");
}
// Call in to the platform-independent code, and let them do their init
SS.Init();