We can fail to find language information if we're called with
wxLANGUAGE_DEFAULT and we don't support the current system language.
Closes #14039.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70688
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxLocale::IsAvailable(int lang)
{
const wxLanguageInfo *info = wxLocale::GetLanguageInfo(lang);
- wxCHECK_MSG( info, false, wxS("invalid language") );
+ if ( !info )
+ {
+ // The language is unknown (this normally only happens when we're
+ // passed wxLANGUAGE_DEFAULT), so we can't support it.
+ wxASSERT_MSG( lang == wxLANGUAGE_DEFAULT,
+ wxS("No info for a valid language?") );
+ return false;
+ }
#if defined(__WIN32__)
if ( !info->WinLang )