changed internat sample so that it shows language choice dialog on startup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -84,12 +84,20 @@ IMPLEMENT_APP(MyApp)
|
|||||||
// `Main program' equivalent, creating windows and returning main app frame
|
// `Main program' equivalent, creating windows and returning main app frame
|
||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
if (argc == 2 && wxString(argv[1]) == "french")
|
wxString langs[] = {"(System default)","French","German"};
|
||||||
m_locale.Init(wxLANGUAGE_FRENCH);
|
SetExitOnFrameDelete(FALSE);
|
||||||
else if (argc == 2 && wxString(argv[1]) == "german")
|
int lng = wxGetSingleChoiceIndex("Please choose language:", "Language",
|
||||||
m_locale.Init(wxLANGUAGE_GERMAN);
|
3, langs);
|
||||||
else
|
SetExitOnFrameDelete(TRUE);
|
||||||
m_locale.Init(wxLANGUAGE_DEFAULT);
|
|
||||||
|
switch (lng)
|
||||||
|
{
|
||||||
|
case 0 : m_locale.Init(wxLANGUAGE_DEFAULT); break;
|
||||||
|
case 1 : m_locale.Init(wxLANGUAGE_FRENCH); break;
|
||||||
|
case 2 : m_locale.Init(wxLANGUAGE_GERMAN); break;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialize the catalogs we'll be using
|
// Initialize the catalogs we'll be using
|
||||||
|
Reference in New Issue
Block a user