Call m_locale->Init() with option wxLOCALE_DONT_LOAD_DEFAULT to avoid any warning message.

We do not use or install the wxWidgets dictionaries, so do not use the default
option (wxLOCALE_LOAD_DEFAULT) when initializing wxLocale.
This commit is contained in:
jean-pierre charras 2021-11-18 11:01:29 +01:00
parent cf334b1ebb
commit e954531ca8
1 changed files with 5 additions and 3 deletions

View File

@ -418,7 +418,9 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time )
delete m_locale;
m_locale = new wxLocale;
if( !m_locale->Init( m_language_id ) )
// 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_language_id, wxLOCALE_DONT_LOAD_DEFAULT ) )
{
wxLogTrace( traceLocale, "This language is not supported by the system." );
@ -426,7 +428,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time )
delete m_locale;
m_locale = new wxLocale;
m_locale->Init();
m_locale->Init( wxLANGUAGE_DEFAULT, wxLOCALE_DONT_LOAD_DEFAULT);
aErrMsg = _( "This language is not supported by the operating system." );
return false;
@ -477,7 +479,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time )
delete m_locale;
m_locale = new wxLocale;
m_locale->Init();
m_locale->Init( wxLANGUAGE_DEFAULT, wxLOCALE_DONT_LOAD_DEFAULT);
aErrMsg = _( "The KiCad language file for this language is not installed." );
return false;