From 29e43e67eaea5c7f95fc0943a6728583cb9efbcf Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 14 Jan 2017 00:32:47 +0000 Subject: [PATCH] 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. --- src/platform/cocoamain.mm | 3 +++ src/platform/w32main.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platform/cocoamain.mm b/src/platform/cocoamain.mm index b8699949..e2676ff3 100644 --- a/src/platform/cocoamain.mm +++ b/src/platform/cocoamain.mm @@ -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(); diff --git a/src/platform/w32main.cpp b/src/platform/w32main.cpp index a5b9838f..63080cf3 100644 --- a/src/platform/w32main.cpp +++ b/src/platform/w32main.cpp @@ -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();