1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-02 08:59:28 +02:00

Bug 2709 - Mac: Missing sub-menu check marks in French

This commit is contained in:
Leland Lucius 2021-04-02 03:37:23 -05:00
parent 811065cff4
commit e80ec51a32
3 changed files with 25 additions and 0 deletions

View File

@ -1548,6 +1548,21 @@ bool AudacityApp::InitPart2()
} }
#endif #endif
#if defined(__WXMAC__)
// Bug 2709: Workaround CoreSVG locale issue
Bind(wxEVT_MENU_OPEN, [=](wxMenuEvent &event)
{
wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
event.Skip();
});
Bind(wxEVT_MENU_CLOSE, [=](wxMenuEvent &event)
{
wxSetlocale(LC_NUMERIC, GUIPrefs::GetLocaleName());
event.Skip();
});
#endif
return TRUE; return TRUE;
} }

View File

@ -270,6 +270,7 @@ wxString GUIPrefs::InitLang( wxString langCode )
} }
static std::unique_ptr<wxLocale> sLocale; static std::unique_ptr<wxLocale> sLocale;
static wxString sLocaleName;
wxString GUIPrefs::SetLang( const wxString & lang ) wxString GUIPrefs::SetLang( const wxString & lang )
{ {
@ -337,9 +338,16 @@ wxString GUIPrefs::SetLang( const wxString & lang )
wxApp::s_macHelpMenuTitleName = _("&Help"); wxApp::s_macHelpMenuTitleName = _("&Help");
#endif #endif
sLocaleName = wxSetlocale(LC_ALL, NULL);
return result; return result;
} }
wxString GUIPrefs::GetLocaleName()
{
return sLocaleName;
}
wxString GUIPrefs::GetLang() wxString GUIPrefs::GetLang()
{ {
if (sLocale) if (sLocale)

View File

@ -55,6 +55,8 @@ class GUIPrefs final : public PrefsPanel
// Unlike GetLang, gives en rather than en_GB or en_US for result. // Unlike GetLang, gives en rather than en_GB or en_US for result.
static wxString GetLangShort(); static wxString GetLangShort();
static wxString GetLocaleName();
private: private:
void Populate(); void Populate();