diff --git a/src/edapp.cpp b/src/edapp.cpp index 24a1926cf6..97ea69a403 100644 --- a/src/edapp.cpp +++ b/src/edapp.cpp @@ -587,6 +587,19 @@ void PoeditApp::SetupLanguage() wxTranslations *trans = new wxTranslations(); wxTranslations::Set(trans); + // workaround wx bug, see https://github.com/wxWidgets/wxWidgets/pull/24297 + class PoeditTranslationsLoader : public wxFileTranslationsLoader + { + public: + wxArrayString GetAvailableTranslations(const wxString& domain) const override + { + auto all = wxFileTranslationsLoader::GetAvailableTranslations(domain); + all.push_back("en"); + return all; + } + }; + trans->SetLoader(new PoeditTranslationsLoader); + int language = wxLANGUAGE_DEFAULT; #if NEED_CHOOSELANG_UI @@ -619,15 +632,6 @@ void PoeditApp::SetupLanguage() #endif } - // workaround wx bug, see https://github.com/wxWidgets/wxWidgets/pull/24297 - if (language == wxLANGUAGE_DEFAULT && trans->GetBestTranslation("poedit") == "en_GB") - { - // only use en_GB if it is actually appropriate - auto pref = wxUILocale::GetPreferredUILanguages(); - if (std::find(pref.begin(), pref.end(), "en-GB") == pref.end()) // not really requested - trans->SetLanguage("en"); - } - trans->AddStdCatalog(); trans->AddCatalog("poedit");