]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/translation.h
Remove obsolete CodeWarrior-related batch files.
[wxWidgets.git] / include / wx / translation.h
index c12ae52046d6fb7f05680400983f07faa5425a46..187caf366bb98d861675f2b2d7291667b03047c2 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Vadim Zeitlin, Vaclav Slavik,
 //              Michael N. Filippov <michael@idisys.iae.nsk.su>
 // Created:     2010-04-23
-// RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
 //              (c) 2010 Vaclav Slavik <vslavik@fastmail.fm>
 // Licence:     wxWindows licence
@@ -154,12 +153,11 @@ public:
     bool IsLoaded(const wxString& domain) const;
 
     // access to translations
-    const wxString& GetString(const wxString& origString,
-                              const wxString& domain = wxEmptyString) const;
-    const wxString& GetString(const wxString& origString,
-                              const wxString& origString2,
-                              unsigned n,
-                              const wxString& domain = wxEmptyString) const;
+    const wxString *GetTranslatedString(const wxString& origString,
+                                        const wxString& domain = wxEmptyString) const;
+    const wxString *GetTranslatedString(const wxString& origString,
+                                        unsigned n,
+                                        const wxString& domain = wxEmptyString) const;
 
     wxString GetHeaderValue(const wxString& header,
                             const wxString& domain = wxEmptyString) const;
@@ -171,7 +169,7 @@ public:
 
 private:
     // perform loading of the catalog via m_loader
-    bool LoadCatalog(const wxString& domain, const wxString& lang);
+    bool LoadCatalog(const wxString& domain, const wxString& lang, const wxString& msgIdLang);
 
     // find catalog by name in a linked list, return NULL if !found
     wxMsgCatalog *FindCatalog(const wxString& domain) const;
@@ -243,11 +241,13 @@ protected:
 
 // get the translation of the string in the current locale
 inline const wxString& wxGetTranslation(const wxString& str,
-                                        const wxString& domain = wxEmptyString)
+                                        const wxString& domain = wxString())
 {
     wxTranslations *trans = wxTranslations::Get();
-    if ( trans )
-        return trans->GetString(str, domain);
+    const wxString *transStr = trans ? trans->GetTranslatedString(str, domain)
+                                     : NULL;
+    if ( transStr )
+        return *transStr;
     else
         // NB: this function returns reference to a string, so we have to keep
         //     a copy of it somewhere
@@ -257,11 +257,13 @@ inline const wxString& wxGetTranslation(const wxString& str,
 inline const wxString& wxGetTranslation(const wxString& str1,
                                         const wxString& str2,
                                         unsigned n,
-                                        const wxString& domain = wxEmptyString)
+                                        const wxString& domain = wxString())
 {
     wxTranslations *trans = wxTranslations::Get();
-    if ( trans )
-        return trans->GetString(str1, str2, n, domain);
+    const wxString *transStr = trans ? trans->GetTranslatedString(str1, n, domain)
+                                     : NULL;
+    if ( transStr )
+        return *transStr;
     else
         // NB: this function returns reference to a string, so we have to keep
         //     a copy of it somewhere