Don't try to get a translated empty string

Hashing an empty string can be crashy.  And empty strings are reserved
in gettext, so we shouldn't try.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15354
This commit is contained in:
Seth Hillbrand 2023-08-04 10:07:31 -07:00
parent 620b6b7169
commit 02335010ff
2 changed files with 6 additions and 0 deletions

View File

@ -123,6 +123,9 @@ TOOL_EVENT TOOL_ACTION::MakeEvent() const
wxString TOOL_ACTION::GetLabel() const
{
if( m_label.empty() )
return wxEmptyString;
return wxGetTranslation( m_label );
}

View File

@ -299,6 +299,9 @@ public:
*/
TOOL_EVENT MakeEvent() const;
/**
* Return the translated label for the action.
*/
wxString GetLabel() const;
wxString GetMenuItem() const;
wxString GetTooltip( bool aIncludeHotkey = true ) const;