diff --git a/include/wx/translation.h b/include/wx/translation.h index a5c0c9f75a..187caf366b 100644 --- a/include/wx/translation.h +++ b/include/wx/translation.h @@ -169,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; diff --git a/src/common/translation.cpp b/src/common/translation.cpp index e6f5373683..455fb315d0 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -1506,17 +1506,11 @@ bool wxTranslations::AddCatalog(const wxString& domain, wxS("adding '%s' translation for domain '%s' (msgid language '%s')"), domain_lang, domain, msgIdLang); - // It is OK to not load catalog if the msgid language and m_language match, - // in which case we can directly display the texts embedded in program's - // source code: - if ( msgIdLang == domain_lang ) - return true; - - return LoadCatalog(domain, domain_lang); + return LoadCatalog(domain, domain_lang, msgIdLang); } -bool wxTranslations::LoadCatalog(const wxString& domain, const wxString& lang) +bool wxTranslations::LoadCatalog(const wxString& domain, const wxString& lang, const wxString& msgIdLang) { wxCHECK_MSG( m_loader, false, "loader can't be NULL" ); @@ -1553,6 +1547,15 @@ bool wxTranslations::LoadCatalog(const wxString& domain, const wxString& lang) cat = m_loader->LoadCatalog(domain, baselang); } + if ( !cat ) + { + // It is OK to not load catalog if the msgid language and m_language match, + // in which case we can directly display the texts embedded in program's + // source code: + if ( msgIdLang == lang ) + return true; + } + if ( cat ) { // add it to the head of the list so that in GetString it will