X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/611bed35118d838abdec90a23a90e492a6cc75d1..f2b6dd8c508ddc1ebfee5b7d6e68a44b4e05a50f:/interface/wx/translation.h diff --git a/interface/wx/translation.h b/interface/wx/translation.h index fc1c35a229..e0f2587940 100644 --- a/interface/wx/translation.h +++ b/interface/wx/translation.h @@ -3,7 +3,7 @@ // Purpose: wxTranslation class // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -79,6 +79,15 @@ public: */ void SetLanguage(const wxString& lang); + /** + Returns list of all translations of @a domain that were found. + + This method can be used e.g. to populate list of application's + translations offered to the user. To do this, pass the app's main + catalog as @a domain. + */ + wxArrayString GetAvailableTranslations(const wxString& domain) const; + /** Add standard wxWidgets catalogs ("wxstd" and possible port-specific catalogs). @@ -244,8 +253,8 @@ public: class wxTranslationsLoader { public: - /// Constructor - wxTranslationsLoader() {} + /// Trivial default constructor. + wxTranslationsLoader(); /** Called to load requested catalog. @@ -265,6 +274,11 @@ public: */ virtual wxMsgCatalog *LoadCatalog(const wxString& domain, const wxString& lang) = 0; + + /** + Implements wxTranslations::GetAvailableTranslations(). + */ + virtual wxArrayString GetAvailableTranslations(const wxString& domain) const = 0; }; /** @@ -452,10 +466,10 @@ public: This function calls wxTranslations::GetString(). @note This function is not suitable for literal strings in Unicode builds - since the literal strings must be enclosed into _T() or wxT() macro - which makes them unrecognised by @c xgettext, and so they are not - extracted to the message catalog. Instead, use the _() and wxPLURAL() - macro for all literal strings. + since the literal strings must be enclosed in wxT() macro which makes + them unrecognised by @c xgettext, and so they are not extracted to + the message catalog. Instead, use the _() and wxPLURAL() macro for + all literal strings. @see wxGetTranslation(const wxString&, const wxString&, unsigned, const wxString&) @@ -491,13 +505,13 @@ const wxString& wxGetTranslation(const wxString& string, const wxString& domain = wxEmptyString); /** + Macro to be used around all literal strings that should be translated. + This macro expands into a call to wxGetTranslation(), so it marks the message for the extraction by @c xgettext just as wxTRANSLATE() does, but also returns the translation of the string for the current locale during execution. - Don't confuse this with _T()! - @header{wx/intl.h} */ const wxString& _(const wxString& string);