diff --git a/src/edapp.cpp b/src/edapp.cpp index fbf322d989..24a1926cf6 100644 --- a/src/edapp.cpp +++ b/src/edapp.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -618,6 +619,15 @@ 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"); diff --git a/src/gexecute.cpp b/src/gexecute.cpp index 6292ba74fd..e7cefc6151 100644 --- a/src/gexecute.cpp +++ b/src/gexecute.cpp @@ -128,6 +128,8 @@ std::pair DoExecuteGettextImpl(const wxString& cmdline_) env.env["OUTPUT_CHARSET"] = "UTF-8"; wxString lang = wxTranslations::Get()->GetBestTranslation("gettext-tools"); + if ( lang.starts_with("en@") ) + lang = "en"; // don't want things like en@blockquot if ( !lang.empty() ) env.env["LANG"] = lang; #endif // __WXOSX__ || __WXMSW__