assert in AddCatalog() if Init() hadn't been called and also check that we have a valid language spec in wxMsgCatalogFile::Load() to ensure we don't form invalid paths there; call Init() before AddCatalog() in the sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -218,16 +218,13 @@ bool MyApp::OnInit()
|
||||
m_lang = lng == -1 ? wxLANGUAGE_DEFAULT : langIds[lng];
|
||||
}
|
||||
|
||||
if ( m_lang != wxLANGUAGE_DEFAULT )
|
||||
// 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(m_lang, wxLOCALE_CONV_ENCODING) )
|
||||
{
|
||||
// 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(m_lang, wxLOCALE_CONV_ENCODING) )
|
||||
{
|
||||
wxLogWarning(_("This language is not supported by the system."));
|
||||
wxLogWarning(_("This language is not supported by the system."));
|
||||
|
||||
// continue nevertheless
|
||||
}
|
||||
// continue nevertheless
|
||||
}
|
||||
|
||||
// normally this wouldn't be necessary as the catalog files would be found
|
||||
|
Reference in New Issue
Block a user