I recently upgraded to wxWidgets 3.1.2. and some code that worked before does not anymore. I did not change that code for a long time:
Code: Select all
bool wxTranslationHelperCustom::applyNewDocuLanguage(wxLanguage selLang)
{
if (GetDocuLocale() && (wxLanguage)GetDocuLocale()->GetLanguage() == selLang)
return false;
wxString oldLang = GetDocuLocale() ? GetDocuLocale()->GetCanonicalName() : wxT("nix");
if (GetDocuLocale())
delete GetDocuLocale();
documentationLocale = new wxLocale;
bool ok = GetDocuLocale()->Init(selLang);
GetDocuLocale()->AddCatalogLookupPathPrefix(m_LangDirPath);
bool success = GetDocuLocale()->AddCatalog(appName, selLang, selLang != wxLANGUAGE_ENGLISH ? wxT("iso-8859-1") : wxT("UTF-8"));
OutputDebugString(wxString::Format(wxT("new language selected: %s -> %s (Success: %s)\n"), oldLang, GetDocuLocale()->GetCanonicalName(), success ? wxT("yes") : wxT("no")));
return true;
}
What could keep the Catalog from being loaded?// No use loading languages that are less preferred than the
// msgid language, as by definition it contains all the strings
// in the msgid language.