From: Vadim Zeitlin Date: Sat, 8 Oct 2005 00:35:11 +0000 (+0000) Subject: check whether setting locale for the selected language succeeded X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/346f42313b4b540124a53091f861468cd7cc6e15 check whether setting locale for the selected language succeeded git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index c7dbc1066f..dd1fe4bbd8 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -180,7 +180,15 @@ bool MyApp::OnInit() } if ( lng != -1 ) - m_locale.Init(langIds[lng]); + { + // don't use wxLOCALE_LOAD_DEFAULT flag so that Init() doesn't return + // false just because it failed to load wxstd catalog + if ( !m_locale.Init(langIds[lng], wxLOCALE_CONV_ENCODING) ) + { + wxLogError(_T("This language is not supported by the system.")); + return false; + } + } // normally this wouldn't be necessary as the catalog files would be found // in the default locations, but under Windows then the program is not