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:
Vadim Zeitlin
2021-08-06 00:19:03 +02:00
parent 33ae58e457
commit 93190d6263

View File

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