// 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
// forward decls
// ----------------------------------------------------------------------------
+class WXDLLIMPEXP_FWD_BASE wxArrayString;
class WXDLLIMPEXP_FWD_BASE wxTranslationsLoader;
class WXDLLIMPEXP_FWD_BASE wxLocale;
class WXDLLIMPEXP_BASE wxMsgCatalog
{
public:
+ // Ctor is protected, because CreateFromXXX functions must be used,
+ // but destruction should be unrestricted
+#if !wxUSE_UNICODE
+ ~wxMsgCatalog();
+#endif
+
// load the catalog from disk or from data; caller is responsible for
// deleting them if not NULL
static wxMsgCatalog *CreateFromFile(const wxString& filename,
, m_conv(NULL)
#endif
{}
-#if !wxUSE_UNICODE
- ~wxMsgCatalog();
-#endif
private:
// variable pointing to the next element in a linked list (or NULL)
void SetLanguage(wxLanguage lang);
void SetLanguage(const wxString& lang);
+ // get languages available for this app
+ wxArrayString GetAvailableTranslations(const wxString& domain) const;
+
+ // find best translation language for given domain
+ wxString GetBestTranslation(const wxString& domain, wxLanguage msgIdLanguage);
+ wxString GetBestTranslation(const wxString& domain,
+ const wxString& msgIdLanguage = "en");
+
// add standard wxWidgets catalog ("wxstd")
bool AddStdCatalog();
// perform loading of the catalog via m_loader
bool LoadCatalog(const wxString& domain, const wxString& lang);
- // find best translation for given domain
- wxString ChooseLanguageForDomain(const wxString& domain,
- const wxString& msgIdLang);
-
// find catalog by name in a linked list, return NULL if !found
wxMsgCatalog *FindCatalog(const wxString& domain) const;
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang) = 0;
+
+ virtual wxArrayString GetAvailableTranslations(const wxString& domain) const = 0;
};
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang);
+
+ virtual wxArrayString GetAvailableTranslations(const wxString& domain) const;
};
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang);
+ virtual wxArrayString GetAvailableTranslations(const wxString& domain) const;
+
protected:
// returns resource type to use for translations
virtual wxString GetResourceType() const { return "MOFILE"; }