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;
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;
// 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
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