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,6 +215,12 @@ bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
|||||||
if ( parser.GetParamCount() )
|
if ( parser.GetParamCount() )
|
||||||
{
|
{
|
||||||
const wxString loc = parser.GetParam();
|
const wxString loc = parser.GetParam();
|
||||||
|
if ( loc.empty() )
|
||||||
|
{
|
||||||
|
m_lang = wxLANGUAGE_DEFAULT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
const wxLanguageInfo * const lang = wxLocale::FindLanguageInfo(loc);
|
const wxLanguageInfo * const lang = wxLocale::FindLanguageInfo(loc);
|
||||||
if ( !lang )
|
if ( !lang )
|
||||||
{
|
{
|
||||||
@@ -224,6 +230,7 @@ bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
|||||||
|
|
||||||
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