Code: Select all
wxLocale *documentationLocale
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;
}