From 24038f8ce75309c2adc1402f58bb001629a1d6f9 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Fri, 2 Dec 2016 00:07:16 +0000 Subject: [PATCH] 3rdparty:wxwidgets: Use locale name directly Upstream commit 713c3f9d1b10ac25fb3c4a1ff115e23c035851dba from the wx master branch (3.1.x). Fixes the crash when the current language is Korean and the Change Language dialog is accessed. --- 3rdparty/wxwidgets3.0/src/common/intl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/3rdparty/wxwidgets3.0/src/common/intl.cpp b/3rdparty/wxwidgets3.0/src/common/intl.cpp index 8a77c3d522..5e6fae536a 100644 --- a/3rdparty/wxwidgets3.0/src/common/intl.cpp +++ b/3rdparty/wxwidgets3.0/src/common/intl.cpp @@ -57,6 +57,10 @@ #ifdef __WIN32__ #include "wx/dynlib.h" #include "wx/msw/private.h" + + #ifndef LOCALE_SNAME + #define LOCALE_SNAME 0x5c + #endif #endif #include "wx/file.h" @@ -155,6 +159,19 @@ wxString wxLanguageInfo::GetLocaleName() const wxChar buffer[256]; buffer[0] = wxT('\0'); + if ( wxGetWinVersion() >= wxWinVersion_Vista ) + { + if ( ::GetLocaleInfo(lcid, LOCALE_SNAME, buffer, WXSIZEOF(buffer)) ) + { + locale << buffer; + } + else + { + wxLogLastError(wxT("GetLocaleInfo(LOCALE_SNAME)")); + } + return locale; + } + if ( !::GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, WXSIZEOF(buffer)) ) { wxLogLastError(wxT("GetLocaleInfo(LOCALE_SENGLANGUAGE)"));