1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-23 15:50:05 +02:00

Remove TranslatedInternalString, use ComponentInterfaceSymbol

This commit is contained in:
Paul Licameli 2019-12-15 10:58:19 -05:00
parent e875adaa6f
commit 54e2bbd8ff
19 changed files with 79 additions and 116 deletions

@ -78,9 +78,9 @@ public:
// Two-argument version distinguishes internal from translatable string // Two-argument version distinguishes internal from translatable string
// such as when the first squeezes spaces out // such as when the first squeezes spaces out
ComponentInterfaceSymbol( const wxString &internal, ComponentInterfaceSymbol( const Identifier &internal,
const TranslatableString &msgid ) const TranslatableString &msgid )
: mInternal{ internal } : mInternal{ internal.GET() }
// Do not permit non-empty msgid with empty internal // Do not permit non-empty msgid with empty internal
, mMsgid{ internal.empty() ? TranslatableString{} : msgid } , mMsgid{ internal.empty() ? TranslatableString{} : msgid }
{} {}
@ -88,6 +88,8 @@ public:
const wxString &Internal() const { return mInternal; } const wxString &Internal() const { return mInternal; }
const TranslatableString &Msgid() const { return mMsgid; } const TranslatableString &Msgid() const { return mMsgid; }
const wxString Translation() const { return mMsgid.Translation(); } const wxString Translation() const { return mMsgid.Translation(); }
const wxString StrippedTranslation() const
{ return TranslatableString{mMsgid}.Strip().Translation(); }
bool empty() const { return mInternal.empty(); } bool empty() const { return mInternal.empty(); }

@ -1754,9 +1754,9 @@ void AdornedRulerPanel::DrawBothOverlays()
void AdornedRulerPanel::UpdateButtonStates() void AdornedRulerPanel::UpdateButtonStates()
{ {
auto common = [this] auto common = [this](
(AButton &button, const CommandID &commandName, const wxString &label) { AButton &button, const CommandID &commandName, const TranslatableString &label) {
TranslatedInternalString command{ commandName, label }; ComponentInterfaceSymbol command{ commandName, label };
ToolBar::SetButtonToolTip( *mProject, button, &command, 1u ); ToolBar::SetButtonToolTip( *mProject, button, &command, 1u );
button.SetLabel(button.GetToolTipText()); button.SetLabel(button.GetToolTipText());
@ -1777,8 +1777,8 @@ void AdornedRulerPanel::UpdateButtonStates()
(gAudioIO->IsCapturing() ? 2 : 0) + (state ? 0 : 1)); (gAudioIO->IsCapturing() ? 2 : 0) + (state ? 0 : 1));
// Bug 1584: Toltip now shows what clicking will do. // Bug 1584: Toltip now shows what clicking will do.
const auto label = state const auto label = state
? _("Click to unpin") ? XO("Click to unpin")
: _("Click to pin"); : XO("Click to pin");
common(*pinButton, wxT("PinnedHead"), label); common(*pinButton, wxT("PinnedHead"), label);
} }
} }

@ -143,7 +143,7 @@ void MacroCommandDialog::PopulateCommandList()
long ii = 0; long ii = 0;
for ( const auto &entry : mCatalog ) for ( const auto &entry : mCatalog )
// insert the user-facing string // insert the user-facing string
mChoices->InsertItem( ii++, entry.name.Translated() ); mChoices->InsertItem( ii++, entry.name.StrippedTranslation() );
} }
void MacroCommandDialog::ValidateChoices() void MacroCommandDialog::ValidateChoices()
@ -188,11 +188,12 @@ void MacroCommandDialog::OnItemSelected(wxListEvent &event)
mEditParams->Enable(!ID.empty()); mEditParams->Enable(!ID.empty());
mUsePreset->Enable(em.HasPresets(ID)); mUsePreset->Enable(em.HasPresets(ID));
if ( command.name.Translated() == mCommand->GetValue() ) auto value = command.name.StrippedTranslation();
if ( value == mCommand->GetValue() )
// This uses the assumption of uniqueness of translated names! // This uses the assumption of uniqueness of translated names!
return; return;
mCommand->SetValue(command.name.Translated()); mCommand->SetValue(value);
mInternalCommandName = command.name.Internal(); mInternalCommandName = command.name.Internal();
wxString params = MacroCommands::GetCurrentParamsFor(mInternalCommandName); wxString params = MacroCommands::GetCurrentParamsFor(mInternalCommandName);
@ -244,11 +245,11 @@ void MacroCommandDialog::SetCommandAndParams(const CommandID &Command, const wxS
// in default of any better friendly name // in default of any better friendly name
mCommand->SetValue( Command.GET() ); mCommand->SetValue( Command.GET() );
else { else {
mCommand->SetValue( iter->name.Translated() ); mCommand->SetValue( iter->name.StrippedTranslation() );
// using GET to expose a CommandID to the user! // using GET to expose a CommandID to the user!
// Macro command details are one place that we do expose Identifier // Macro command details are one place that we do expose Identifier
// to (more sophisticated) users // to (more sophisticated) users
mDetails->SetValue( iter->name.Internal().GET() + "\r\n" + iter->category ); mDetails->SetValue( iter->name.Internal() + "\r\n" + iter->category );
mChoices->SetItemState(iter - mCatalog.begin(), mChoices->SetItemState(iter - mCatalog.begin(),
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);

@ -294,7 +294,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
Entries commands; Entries commands;
for( const auto &command : SpecialCommands ) for( const auto &command : SpecialCommands )
commands.push_back( { commands.push_back( {
{ command.second, command.first.Translation() }, { command.second, command.first },
_("Special Command") _("Special Command")
} ); } );
@ -309,7 +309,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
auto command = em.GetCommandIdentifier(plug->GetID()); auto command = em.GetCommandIdentifier(plug->GetID());
if (!command.empty()) if (!command.empty())
commands.push_back( { commands.push_back( {
{ command, plug->GetSymbol().Translation() }, { command, plug->GetSymbol().Msgid() },
plug->GetPluginType() == PluginTypeEffect ? plug->GetPluginType() == PluginTypeEffect ?
_("Effect") : _("Menu Command (With Parameters)") _("Effect") : _("Menu Command (With Parameters)")
} ); } );
@ -365,7 +365,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
{ {
{ {
mNames[i], // Internal name. mNames[i], // Internal name.
label.Translation() // User readable name label // User readable name
}, },
_("Menu Command (No Parameters)") _("Menu Command (No Parameters)")
} }
@ -379,23 +379,26 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
// keeping specials before effects and menu items, and lastly commands. // keeping specials before effects and menu items, and lastly commands.
auto less = auto less =
[](const Entry &a, const Entry &b) [](const Entry &a, const Entry &b)
{ return a.name.Translated() < b.name.Translated(); }; { return a.name.StrippedTranslation() <
b.name.StrippedTranslation(); };
std::stable_sort(commands.begin(), commands.end(), less); std::stable_sort(commands.begin(), commands.end(), less);
// Now uniquify by friendly name // Now uniquify by friendly name
auto equal = auto equal =
[](const Entry &a, const Entry &b) [](const Entry &a, const Entry &b)
{ return a.name.Translated() == b.name.Translated(); }; { return a.name.StrippedTranslation() ==
b.name.StrippedTranslation(); };
std::unique_copy( std::unique_copy(
commands.begin(), commands.end(), std::back_inserter(mCommands), equal); commands.begin(), commands.end(), std::back_inserter(mCommands), equal);
} }
// binary search // binary search
auto MacroCommandsCatalog::ByFriendlyName( const wxString &friendlyName ) const auto MacroCommandsCatalog::ByFriendlyName( const TranslatableString &friendlyName ) const
-> Entries::const_iterator -> Entries::const_iterator
{ {
const auto less = [](const Entry &entryA, const Entry &entryB) const auto less = [](const Entry &entryA, const Entry &entryB)
{ return entryA.name.Translated() < entryB.name.Translated(); }; { return entryA.name.StrippedTranslation() <
entryB.name.StrippedTranslation(); };
auto range = std::equal_range( auto range = std::equal_range(
begin(), end(), Entry{ { {}, friendlyName }, {} }, less begin(), end(), Entry{ { {}, friendlyName }, {} }, less
); );
@ -943,7 +946,7 @@ bool MacroCommands::ApplyMacro(
// uh oh, using GET to expose an internal name to the user! // uh oh, using GET to expose an internal name to the user!
// in default of any better friendly name // in default of any better friendly name
command.GET() command.GET()
: iter->name.Translated(); : iter->name.StrippedTranslation();
if (!ApplyCommandInBatchMode(friendly, command, mParamsMacro[i]) || mAbort) if (!ApplyCommandInBatchMode(friendly, command, mParamsMacro[i]) || mAbort)
break; break;
} }

@ -16,6 +16,7 @@
#include "export/Export.h" #include "export/Export.h"
#include "commands/CommandFlag.h" #include "commands/CommandFlag.h"
#include "audacity/ComponentInterface.h" // for ComponentInterfaceSymbol
class wxArrayString; class wxArrayString;
class Effect; class Effect;
@ -28,7 +29,7 @@ class MacroCommandsCatalog {
public: public:
// A triple of user-visible name, internal string identifier and type/help string. // A triple of user-visible name, internal string identifier and type/help string.
struct Entry { struct Entry {
TranslatedInternalString name; ComponentInterfaceSymbol name;
wxString category; wxString category;
}; };
using Entries = std::vector<Entry>; using Entries = std::vector<Entry>;
@ -36,7 +37,7 @@ public:
MacroCommandsCatalog( const AudacityProject *project ); MacroCommandsCatalog( const AudacityProject *project );
// binary search // binary search
Entries::const_iterator ByFriendlyName( const wxString &friendlyName ) const; Entries::const_iterator ByFriendlyName( const TranslatableString &friendlyName ) const;
// linear search // linear search
Entries::const_iterator ByCommandId( const CommandID &commandId ) const; Entries::const_iterator ByCommandId( const CommandID &commandId ) const;

@ -745,7 +745,7 @@ void MacrosWindow::AddItem(const CommandID &Action, const wxString &Params)
{ {
auto entry = mCatalog.ByCommandId(Action); auto entry = mCatalog.ByCommandId(Action);
auto friendlyName = entry != mCatalog.end() auto friendlyName = entry != mCatalog.end()
? entry->name.Translated() ? entry->name.StrippedTranslation()
: :
// uh oh, using GET to expose an internal name to the user! // uh oh, using GET to expose an internal name to the user!
// in default of any better friendly name // in default of any better friendly name

@ -163,43 +163,4 @@ class ComponentInterfaceSymbol;
wxArrayStringEx LocalizedStrings( wxArrayStringEx LocalizedStrings(
const EnumValueSymbol strings[], size_t nStrings); const EnumValueSymbol strings[], size_t nStrings);
// This object pairs an internal string, maybe empty, with a translated string.
// Any internal string may be written to configuration or other files and,
// for compatibility, should not vary between Audacity versions.
// The translated string may be shown to users and may vary with locale, and
// Audacity version if it is decided to use a different user-visible message.
// Sometimes the translated string is derived from a msgid identical
// to the internal string. The translated string is not meant to persist.
class TranslatedInternalString
{
public:
using ID = CommandID;
TranslatedInternalString() = default;
// One-argument constructor from a msgid
explicit TranslatedInternalString( const wxString &internal )
: mInternal{ internal }, mTranslated{ GetCustomTranslation( internal ) }
{}
// Two-argument version, when translated does not derive from internal
TranslatedInternalString( const ID &internal,
const wxString &translated )
: mInternal{ internal }, mTranslated{ translated }
{}
const ID &Internal() const { return mInternal; }
const wxString Translated() const
{
wxString Temp = mTranslated;
Temp.Replace( "&","" );
return Temp;
}
private:
ID mInternal;
wxString mTranslated;
};
#endif #endif

@ -64,7 +64,7 @@ bool BatchEvalCommand::Apply(const CommandContext & context)
auto iter = catalog.ByCommandId(cmdName); auto iter = catalog.ByCommandId(cmdName);
const wxString &friendly = (iter == catalog.end()) const wxString &friendly = (iter == catalog.end())
? cmdName // Expose internal name to user, in default of a better one! ? cmdName // Expose internal name to user, in default of a better one!
: iter->name.Translated(); : iter->name.StrippedTranslation();
// Create a Batch that will have just one command in it... // Create a Batch that will have just one command in it...
MacroCommands Batch; MacroCommands Batch;

@ -963,8 +963,8 @@ void CommandManager::SetKeyFromIndex(int i, const NormalizedKeyString &key)
entry->key = key; entry->key = key;
} }
wxString CommandManager::DescribeCommandsAndShortcuts TranslatableString CommandManager::DescribeCommandsAndShortcuts(
(const TranslatedInternalString commands[], size_t nCommands) const const ComponentInterfaceSymbol commands[], size_t nCommands) const
{ {
wxString mark; wxString mark;
// This depends on the language setting and may change in-session after // This depends on the language setting and may change in-session after
@ -974,7 +974,7 @@ wxString CommandManager::DescribeCommandsAndShortcuts
mark = wxT("\u200f"); mark = wxT("\u200f");
static const wxString &separatorFormat = wxT("%s / %s"); static const wxString &separatorFormat = wxT("%s / %s");
wxString result; TranslatableString result;
for (size_t ii = 0; ii < nCommands; ++ii) { for (size_t ii = 0; ii < nCommands; ++ii) {
const auto &pair = commands[ii]; const auto &pair = commands[ii];
// If RTL, then the control character forces right-to-left sequencing of // If RTL, then the control character forces right-to-left sequencing of
@ -982,7 +982,11 @@ wxString CommandManager::DescribeCommandsAndShortcuts
// left, consistently with accelerators in menus (assuming matching // left, consistently with accelerators in menus (assuming matching
// operating system prefernces for language), even if the command name // operating system prefernces for language), even if the command name
// was missing from the translation file and defaulted to the English. // was missing from the translation file and defaulted to the English.
auto piece = wxString::Format(wxT("%s%s"), mark, pair.Translated());
// Note: not putting this and other short format strings in the
// translation catalogs
auto piece = TranslatableString{wxT("%s%s")}
.Format( mark, TranslatableString{pair.Msgid()}.Strip() );
auto name = pair.Internal(); auto name = pair.Internal();
if (!name.empty()) { if (!name.empty()) {
@ -1000,14 +1004,14 @@ wxString CommandManager::DescribeCommandsAndShortcuts
#endif #endif
// The mark makes correctly placed parentheses for RTL, even // The mark makes correctly placed parentheses for RTL, even
// in the case that the piece is untranslated. // in the case that the piece is untranslated.
piece = wxString::Format(format, piece, mark, keyString); piece = TranslatableString{format}.Format( piece, mark, keyString );
} }
} }
if (result.empty()) if (result.empty())
result = piece; result = piece;
else else
result = wxString::Format(separatorFormat, result, piece); result = TranslatableString{ separatorFormat }.Format( result, piece );
} }
return result; return result;
} }

@ -34,7 +34,6 @@ class wxMenuBar;
class wxArrayString; class wxArrayString;
class wxMenu; class wxMenu;
class wxMenuBar; class wxMenuBar;
class TranslatedInternalString;
using CommandParameter = CommandID; using CommandParameter = CommandID;
struct MenuBarListEntry struct MenuBarListEntry
@ -288,11 +287,11 @@ class AUDACITY_DLL_API CommandManager final
/// ///
/// Formatting summaries that include shortcut keys /// Formatting summaries that include shortcut keys
/// ///
wxString DescribeCommandsAndShortcuts TranslatableString DescribeCommandsAndShortcuts
( (
// If a shortcut key is defined for the command, then it is appended, // If a shortcut key is defined for the command, then it is appended,
// parenthesized, after the translated name. // parenthesized, after the translated name.
const TranslatedInternalString commands[], size_t nCommands) const; const ComponentInterfaceSymbol commands[], size_t nCommands) const;
// Sorted list of the shortcut keys to be exluded from the standard defaults // Sorted list of the shortcut keys to be exluded from the standard defaults
static const std::vector<NormalizedKeyString> &ExcludedList(); static const std::vector<NormalizedKeyString> &ExcludedList();

@ -268,15 +268,15 @@ void ControlToolBar::RegenerateTooltips()
name = wxT("CursProjectStart"); name = wxT("CursProjectStart");
break; break;
} }
std::vector<TranslatedInternalString> commands( std::vector<ComponentInterfaceSymbol> commands(
1u, { name, pCtrl->GetLabel() } ); 1u, { name, TranslatableString{ pCtrl->GetLabel() } } );
// Some have a second // Some have a second
switch (iWinID) switch (iWinID)
{ {
case ID_PLAY_BUTTON: case ID_PLAY_BUTTON:
// With shift // With shift
commands.push_back( { wxT("PlayLooped"), _("Loop Play") } ); commands.push_back( { wxT("PlayLooped"), XO("Loop Play") } );
break; break;
case ID_RECORD_BUTTON: case ID_RECORD_BUTTON:
// With shift // With shift
@ -286,8 +286,8 @@ void ControlToolBar::RegenerateTooltips()
commands.push_back( { commands.push_back( {
wxT("Record2ndChoice"), wxT("Record2ndChoice"),
!bPreferNewTrack !bPreferNewTrack
? _("Record New Track") ? XO("Record New Track")
: _("Append Record") : XO("Append Record")
} ); } );
} }
break; break;
@ -298,12 +298,12 @@ void ControlToolBar::RegenerateTooltips()
case ID_FF_BUTTON: case ID_FF_BUTTON:
// With shift // With shift
commands.push_back( { commands.push_back( {
wxT("SelEnd"), _("Select to End") } ); wxT("SelEnd"), XO("Select to End") } );
break; break;
case ID_REW_BUTTON: case ID_REW_BUTTON:
// With shift // With shift
commands.push_back( { commands.push_back( {
wxT("SelStart"), _("Select to Start") } ); wxT("SelStart"), XO("Select to Start") } );
break; break;
} }
ToolBar::SetButtonToolTip( ToolBar::SetButtonToolTip(

@ -277,8 +277,8 @@ void EditToolBar::ForAllButtons(int Action)
for (const auto &entry : EditToolbarButtonList) { for (const auto &entry : EditToolbarButtonList) {
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
if( Action & ETBActTooltips ){ if( Action & ETBActTooltips ){
TranslatedInternalString command{ ComponentInterfaceSymbol command{
entry.commandName, entry.untranslatedLabel.Translation() }; entry.commandName, entry.untranslatedLabel };
ToolBar::SetButtonToolTip( mProject, ToolBar::SetButtonToolTip( mProject,
*mButtons[entry.tool], &command, 1u ); *mButtons[entry.tool], &command, 1u );
} }

@ -149,10 +149,10 @@ void ScrubbingToolBar::RegenerateTooltips()
void ScrubbingToolBar::DoRegenerateTooltips( bool force ) void ScrubbingToolBar::DoRegenerateTooltips( bool force )
{ {
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
auto fn = [&] auto fn = [&](
(AButton &button, const wxString &label, const CommandID &cmd) AButton &button, const TranslatableString &label, const CommandID &cmd)
{ {
TranslatedInternalString command{ cmd, label }; ComponentInterfaceSymbol command{ cmd, label };
ToolBar::SetButtonToolTip( mProject, button, &command, 1u ); ToolBar::SetButtonToolTip( mProject, button, &command, 1u );
}; };
@ -163,7 +163,7 @@ void ScrubbingToolBar::DoRegenerateTooltips( bool force )
const auto scrubButton = mButtons[STBScrubID]; const auto scrubButton = mButtons[STBScrubID];
const auto seekButton = mButtons[STBSeekID]; const auto seekButton = mButtons[STBSeekID];
wxString label; TranslatableString label;
bool scrubs = scrubber.Scrubs(); bool scrubs = scrubber.Scrubs();
if (force || mLastScrub != scrubs) { if (force || mLastScrub != scrubs) {
label = ( label = (
@ -172,8 +172,8 @@ void ScrubbingToolBar::DoRegenerateTooltips( bool force )
"Scrubbing" is variable-speed playback, ... "Scrubbing" is variable-speed playback, ...
"Seeking" is normal speed playback but with skips "Seeking" is normal speed playback but with skips
*/ */
? _("Stop Scrubbing") ? XO("Stop Scrubbing")
: _("Start Scrubbing") : XO("Start Scrubbing")
); );
fn(*scrubButton, label, wxT("Scrub")); fn(*scrubButton, label, wxT("Scrub"));
} }
@ -187,8 +187,8 @@ void ScrubbingToolBar::DoRegenerateTooltips( bool force )
"Scrubbing" is variable-speed playback, ... "Scrubbing" is variable-speed playback, ...
"Seeking" is normal speed playback but with skips "Seeking" is normal speed playback but with skips
*/ */
? _("Stop Seeking") ? XO("Stop Seeking")
: _("Start Seeking") : XO("Start Seeking")
); );
fn(*seekButton, label, wxT("Seek")); fn(*seekButton, label, wxT("Seek"));
} }
@ -198,8 +198,8 @@ void ScrubbingToolBar::DoRegenerateTooltips( bool force )
if (force || mLastRuler != showingRuler) { if (force || mLastRuler != showingRuler) {
label = ( label = (
showingRuler showingRuler
? _("Hide Scrub Ruler") ? XO("Hide Scrub Ruler")
: _("Show Scrub Ruler") : XO("Show Scrub Ruler")
); );
fn(*mButtons[STBRulerID], label, wxT("ToggleScrubRuler")); fn(*mButtons[STBRulerID], label, wxT("ToggleScrubRuler"));
} }

@ -860,16 +860,16 @@ void ToolBar::MakeAlternateImages(AButton &button, int idx,
void ToolBar::SetButtonToolTip void ToolBar::SetButtonToolTip
(AudacityProject &theProject, (AudacityProject &theProject,
AButton &button, const TranslatedInternalString commands[], size_t nCommands) AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
{ {
wxString result; TranslatableString result;
const auto project = &theProject; const auto project = &theProject;
const auto commandManager = const auto commandManager =
project ? &CommandManager::Get( *project ) : nullptr; project ? &CommandManager::Get( *project ) : nullptr;
if (commandManager) if (commandManager)
result = result =
commandManager->DescribeCommandsAndShortcuts(commands, nCommands); commandManager->DescribeCommandsAndShortcuts(commands, nCommands);
button.SetToolTip( TranslatableString{ result } ); button.SetToolTip( result );
} }
// //

@ -172,7 +172,7 @@ public:
(AudacityProject &project, AButton &button, (AudacityProject &project, AButton &button,
// If a shortcut key is defined for the command, then it is appended, // If a shortcut key is defined for the command, then it is appended,
// parenthesized, after the translated name. // parenthesized, after the translated name.
const TranslatedInternalString commands[], size_t nCommands); const ComponentInterfaceSymbol commands[], size_t nCommands);
static void MakeButtonBackgroundsSmall(); static void MakeButtonBackgroundsSmall();
static void MakeButtonBackgroundsLarge(); static void MakeButtonBackgroundsLarge();

@ -153,8 +153,8 @@ void ToolsToolBar::RegenerateTooltips()
}; };
for (const auto &entry : table) { for (const auto &entry : table) {
TranslatedInternalString command{ ComponentInterfaceSymbol command{
entry.commandName, entry.untranslatedLabel.Translation() }; entry.commandName, entry.untranslatedLabel };
ToolBar::SetButtonToolTip( mProject, ToolBar::SetButtonToolTip( mProject,
*mTool[entry.tool], &command, 1u ); *mTool[entry.tool], &command, 1u );
} }

@ -346,9 +346,9 @@ void TranscriptionToolBar::RegenerateTooltips()
}; };
for (const auto &entry : table) { for (const auto &entry : table) {
TranslatedInternalString commands[] = { ComponentInterfaceSymbol commands[] = {
{ entry.commandName, entry.untranslatedLabel.Translation() }, { entry.commandName, entry.untranslatedLabel },
{ entry.commandName2, entry.untranslatedLabel2.Translation() }, { entry.commandName2, entry.untranslatedLabel2 },
}; };
ToolBar::SetButtonToolTip( mProject, ToolBar::SetButtonToolTip( mProject,
*mButtons[entry.tool], commands, 2u ); *mButtons[entry.tool], commands, 2u );

@ -51,10 +51,8 @@ TranslatableString MuteButtonHandle::Tip(const wxMouseState &) const
return name; return name;
auto &commandManager = CommandManager::Get( *project ); auto &commandManager = CommandManager::Get( *project );
TranslatedInternalString command{ wxT("TrackMute"), name.Translation() }; ComponentInterfaceSymbol command{ wxT("TrackMute"), name };
return TranslatableString{ return commandManager.DescribeCommandsAndShortcuts(&command, 1u);
commandManager.DescribeCommandsAndShortcuts(&command, 1u)
};
} }
UIHandlePtr MuteButtonHandle::HitTest UIHandlePtr MuteButtonHandle::HitTest
@ -109,10 +107,8 @@ TranslatableString SoloButtonHandle::Tip(const wxMouseState &) const
return name; return name;
auto &commandManager = CommandManager::Get( *project ); auto &commandManager = CommandManager::Get( *project );
TranslatedInternalString command{ wxT("TrackSolo"), name.Translation() }; ComponentInterfaceSymbol command{ wxT("TrackSolo"), name };
return TranslatableString{ return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
commandManager.DescribeCommandsAndShortcuts( &command, 1u )
};
} }
UIHandlePtr SoloButtonHandle::HitTest UIHandlePtr SoloButtonHandle::HitTest

@ -180,10 +180,8 @@ TranslatableString CloseButtonHandle::Tip(const wxMouseState &) const
return name; return name;
auto &commandManager = CommandManager::Get( *project ); auto &commandManager = CommandManager::Get( *project );
TranslatedInternalString command{ wxT("TrackClose"), name.Translation() }; ComponentInterfaceSymbol command{ wxT("TrackClose"), name };
return TranslatableString{ return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
commandManager.DescribeCommandsAndShortcuts( &command, 1u )
};
} }
UIHandlePtr CloseButtonHandle::HitTest UIHandlePtr CloseButtonHandle::HitTest
@ -242,10 +240,8 @@ TranslatableString MenuButtonHandle::Tip(const wxMouseState &) const
return name; return name;
auto &commandManager = CommandManager::Get( *project ); auto &commandManager = CommandManager::Get( *project );
TranslatedInternalString command{ wxT("TrackMenu"), name.Translation() }; ComponentInterfaceSymbol command{ wxT("TrackMenu"), name };
return TranslatableString{ return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
commandManager.DescribeCommandsAndShortcuts( &command, 1u )
};
} }
UIHandlePtr MenuButtonHandle::HitTest UIHandlePtr MenuButtonHandle::HitTest