git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56765
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
m_lang = lng == -1 ? wxLANGUAGE_DEFAULT : langIds[lng];
}
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
}
// normally this wouldn't be necessary as the catalog files would be found
bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
wxPluralFormsCalculatorPtr& rPluralFormsCalculator)
{
bool wxMsgCatalogFile::Load(const wxString& szDirPrefix, const wxString& szName,
wxPluralFormsCalculatorPtr& rPluralFormsCalculator)
{
+ wxCHECK_MSG( szDirPrefix.length() >= LEN_LANG, false,
+ "invalid language specification" );
+
wxString searchPath;
#if wxUSE_FONTMAP
wxString searchPath;
#if wxUSE_FONTMAP
const wxString& msgIdCharset)
{
const wxString& msgIdCharset)
{
+ wxCHECK_MSG( IsOk(), false, "must initialize catalog first" );
+
wxMsgCatalog *pMsgCat = new wxMsgCatalog;
if ( pMsgCat->Load(m_strShort, szDomain, msgIdCharset, m_bConvertEncoding) )
wxMsgCatalog *pMsgCat = new wxMsgCatalog;
if ( pMsgCat->Load(m_strShort, szDomain, msgIdCharset, m_bConvertEncoding) )