X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42c097b83e20818d1894e9cbf3995d2752a4ba16..e0dec8753abaf97e006ea1185bfb6775b28df0a8:/samples/internat/internat.cpp diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index cc00ea8e03..d285652e7c 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // NOTE: don't miss the "readme.txt" file which comes with this sample! @@ -37,8 +37,8 @@ #include "wx/log.h" #include "wx/cmdline.h" -#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) -#include "mondrian.xpm" +#ifndef wxHAS_IMAGES_IN_RESOURCES + #include "../sample.xpm" #endif // ---------------------------------------------------------------------------- @@ -229,7 +229,7 @@ bool MyApp::OnInit() // 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_lang, wxLOCALE_CONV_ENCODING) ) + if ( !m_locale.Init(m_lang, wxLOCALE_DONT_LOAD_DEFAULT) ) { wxLogWarning(_("This language is not supported by the system.")); @@ -245,12 +245,14 @@ bool MyApp::OnInit() // Initialize the catalogs we'll be using const wxLanguageInfo* pInfo = wxLocale::GetLanguageInfo(m_lang); if (!m_locale.AddCatalog("internat")) + { wxLogError(_("Couldn't find/load the 'internat' catalog for locale '%s'."), pInfo ? pInfo->GetLocaleName() : _("unknown")); + } // Now try to add wxstd.mo so that loading "NOTEXIST.ING" file will produce // a localized error message: - m_locale.AddCatalog("wxstd.mo"); + m_locale.AddCatalog("wxstd"); // NOTE: it's not an error if we couldn't find it! // this catalog is installed in standard location on Linux systems and @@ -269,7 +271,6 @@ bool MyApp::OnInit() // Show the frame frame->Show(true); - SetTopWindow(frame); return true; } @@ -285,7 +286,7 @@ MyFrame::MyFrame(wxLocale& locale) _("International wxWidgets App")), m_locale(locale) { - SetIcon(wxICON(mondrian)); + SetIcon(wxICON(sample)); // Make a menubar wxMenu *file_menu = new wxMenu; @@ -294,7 +295,7 @@ MyFrame::MyFrame(wxLocale& locale) // since wxID_ABOUT and wxID_EXIT are stock IDs they will automatically get // translated help strings; nice isn't it? - file_menu->Append(wxID_ABOUT, _("&About...")); + file_menu->Append(wxID_ABOUT, _("&About")); file_menu->AppendSeparator(); file_menu->Append(wxID_EXIT, _("E&xit")); @@ -374,9 +375,9 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) } else if ( num == 9 ) { - // this message is not translated (not in catalog) because we used _T() + // this message is not translated (not in catalog) because we used wxT() // and not _() around it - str = _T("You've found a bug in this program!"); + str = wxT("You've found a bug in this program!"); } else if ( num == 17 ) { @@ -397,7 +398,7 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) str = wxGetTranslation(wxTRANSLATE("Bad luck! try again...")); // note also that if we want 'str' to contain a localized string - // we need to use wxGetTranslation explicitely as wxTRANSLATE just + // we need to use wxGetTranslation explicitly as wxTRANSLATE just // tells xgettext to extract the string but has no effect on the // runtime of the program! } @@ -427,9 +428,13 @@ void MyFrame::OnTestLocaleAvail(wxCommandEvent& WXUNUSED(event)) } if ( wxLocale::IsAvailable(info->Language) ) + { wxLogMessage(_("Locale \"%s\" is available."), s_locale.c_str()); + } else + { wxLogWarning(_("Locale \"%s\" is not available."), s_locale.c_str()); + } } void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event))