Interpret empty language as "default" in the internat sample
This provides a more convenient way of testing wxLANGUAGE_DEFAULT than selecting it from the dialog shown on startup. This commit is best viewed ignoring whitespace-only changes.
This commit is contained in:
@@ -215,14 +215,21 @@ bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
|||||||
if ( parser.GetParamCount() )
|
if ( parser.GetParamCount() )
|
||||||
{
|
{
|
||||||
const wxString loc = parser.GetParam();
|
const wxString loc = parser.GetParam();
|
||||||
const wxLanguageInfo * const lang = wxLocale::FindLanguageInfo(loc);
|
if ( loc.empty() )
|
||||||
if ( !lang )
|
|
||||||
{
|
{
|
||||||
wxLogError(_("Locale \"%s\" is unknown."), loc);
|
m_lang = wxLANGUAGE_DEFAULT;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const wxLanguageInfo * const lang = wxLocale::FindLanguageInfo(loc);
|
||||||
|
if ( !lang )
|
||||||
|
{
|
||||||
|
wxLogError(_("Locale \"%s\" is unknown."), loc);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_lang = static_cast<wxLanguage>(lang->Language);
|
m_lang = static_cast<wxLanguage>(lang->Language);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user