]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/internat/internat.cpp
somehow an additional call moved in... removed
[wxWidgets.git] / samples / internat / internat.cpp
index 7fd5df9a29b1afaf5b8aec0839f72b9654ed3a19..c87774265e7856ad76d8c7957e31de948629bc0f 100644 (file)
@@ -130,8 +130,11 @@ bool MyApp::OnInit()
         wxLANGUAGE_BULGARIAN,
         wxLANGUAGE_CZECH,
         wxLANGUAGE_POLISH,
-#if wxUSE_UNICODE
+        wxLANGUAGE_SWEDISH,
+#if wxUSE_UNICODE || defined(__WXMOTIF__)
         wxLANGUAGE_JAPANESE,
+#endif
+#if wxUSE_UNICODE
         wxLANGUAGE_GEORGIAN,
 #endif
         wxLANGUAGE_ENGLISH,
@@ -151,8 +154,11 @@ bool MyApp::OnInit()
             _T("Bulgarian"),
             _T("Czech"),
             _T("Polish"),
-#if wxUSE_UNICODE
+            _T("Swedish"),
+#if wxUSE_UNICODE || defined(__WXMOTIF__)
             _T("Japanese"),
+#endif
+#if wxUSE_UNICODE
             _T("Georgian"),
 #endif
             _T("English"),
@@ -175,6 +181,13 @@ bool MyApp::OnInit()
     if ( lng != -1 )
         m_locale.Init(langIds[lng]);
 
+    // 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
+    // installed the catalogs are in the parent directory (because the binary
+    // is in a subdirectory of samples/internat) where we wouldn't find them by
+    // default
+    wxLocale::AddCatalogLookupPathPrefix(wxT("."));
+    wxLocale::AddCatalogLookupPathPrefix(wxT(".."));
 
     // Initialize the catalogs we'll be using
     m_locale.AddCatalog(wxT("internat"));
@@ -251,15 +264,15 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
     localeInfo.Printf(_("Language: %s\nSystem locale name:\n%s\nCanonical locale name: %s\n"),
         locale.c_str(), sysname.c_str(), canname.c_str() );
 
-    wxMessageDialog
-    (
-        this,
-        wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
-            + wxT("\n\n")
-            + localeInfo,
-        _("About Internat"),
-        wxOK | wxICON_INFORMATION
-    ).ShowModal();
+    wxMessageDialog dlg(
+                        this,
+                        wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
+                                 + wxT("\n\n")
+                                 + localeInfo,
+                                 _("About Internat"),
+                        wxOK | wxICON_INFORMATION
+                       );
+    dlg.ShowModal();
 }
 
 void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
@@ -347,7 +360,7 @@ void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
         for (int n = first; n <= last; ++n)
         {
             s << n << _T(" ") <<
-                wxGetTranslation(_T("file deleted"), _T("files deleted"), n) <<
+                wxPLURAL("file deleted", "files deleted", n) <<
                 _T("\n");
         }
         wxMessageBox(s);