]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/internat/internat.cpp
Watcom does not accept #warning but supports more than MSW port.
[wxWidgets.git] / samples / internat / internat.cpp
index c7dbc1066f1d0a6b4bb31ec2ed17bac516dadca3..dd1fe4bbd815df7d1b37ab51a56ba9899b4fca1f 100644 (file)
@@ -180,7 +180,15 @@ bool MyApp::OnInit()
     }
 
     if ( lng != -1 )
-        m_locale.Init(langIds[lng]);
+    {
+        // 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(langIds[lng], wxLOCALE_CONV_ENCODING) )
+        {
+            wxLogError(_T("This language is not supported by the system."));
+            return false;
+        }
+    }
 
     // normally this wouldn't be necessary as the catalog files would be found
     // in the default locations, but under Windows then the program is not