From 3a8ad95230a3eace683c1cc07807d1e0d1e4a296 Mon Sep 17 00:00:00 2001 From: Vaclav Slavik Date: Wed, 10 Jun 2015 18:32:49 +0200 Subject: [PATCH] Call SetThreadUILanguage() on Windows Starting with Vista, SetThreadLocale() does basically nothing and does not affect UI language. We need to call SetThreadUILanguage() as well from wxLocale::Init() to have the locale reflected in e.g. standard dialogs. --- src/common/intl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/intl.cpp b/src/common/intl.cpp index c81c516806..7f2c08e373 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -472,6 +472,13 @@ bool wxLocale::Init(int language, int flags) // change locale used by Windows functions ::SetThreadLocale(lcid); + + // SetThreadUILanguage() is available on XP, but with unclear + // behavior, so avoid calling it there. + if ( wxGetWinVersion() >= wxWinVersion_Vista ) + { + SetThreadUILanguage(LANGIDFROMLCID(lcid)); + } #endif // and also call setlocale() to change locale used by the CRT