]> git.saurik.com Git - wxWidgets.git/commitdiff
include the locale name in the error message when the catalog can't be loaded
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 1 Apr 2009 14:59:38 +0000 (14:59 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Wed, 1 Apr 2009 14:59:38 +0000 (14:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/internat/internat.cpp

index 6748536e519cafbb98d5ab7a2ccdec2304fab98f..1647630af4d4ba16df080c771572bc972d52cae8 100644 (file)
@@ -240,8 +240,10 @@ bool MyApp::OnInit()
     wxLocale::AddCatalogLookupPathPrefix(".");
 
     // 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."));
+        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:
@@ -330,8 +332,8 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
     wxString sysname = m_locale.GetSysName();
     wxString canname = m_locale.GetCanonicalName();
 
-    localeInfo.Printf(_("Language: %s\nSystem locale name:\n%s\nCanonical locale name: %s\n"),
-        locale.c_str(), sysname.c_str(), canname.c_str() );
+    localeInfo.Printf(_("Language: %s\nSystem locale name: %s\nCanonical locale name: %s\n"),
+                      locale.c_str(), sysname.c_str(), canname.c_str() );
 
     wxMessageDialog dlg(
                         this,