diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index f1f84a58a..92a0ca3b7 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -615,7 +615,7 @@ bool MacroCommands::WriteMp3File( const wxString & Name, int bitrate ) // ======= IMPORTANT ======== // CLEANSPEECH remnant bool MacroCommands::ApplySpecialCommand( - int WXUNUSED(iCommand), const wxString &friendlyCommand, + int WXUNUSED(iCommand), const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params) { if (ReportAndSkip(friendlyCommand, params)) @@ -756,7 +756,7 @@ bool MacroCommands::DoAudacityCommand( } bool MacroCommands::ApplyEffectCommand( - const PluginID & ID, const wxString &friendlyCommand, + const PluginID & ID, const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params, const CommandContext & Context) { @@ -839,7 +839,7 @@ bool MacroCommands::HandleTextualCommand( CommandManager &commandManager, return false; } -bool MacroCommands::ApplyCommand( const wxString &friendlyCommand, +bool MacroCommands::ApplyCommand( const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params, CommandContext const * pContext) { @@ -872,7 +872,7 @@ bool MacroCommands::ApplyCommand( const wxString &friendlyCommand, manager, command, *pContext, AlwaysEnabledFlag, true ) ) return true; pContext->Status( wxString::Format( - _("Your batch command of %s was not recognized."), friendlyCommand )); + _("Your batch command of %s was not recognized."), friendlyCommand.Translation() )); return false; } else @@ -890,7 +890,8 @@ bool MacroCommands::ApplyCommand( const wxString &friendlyCommand, return false; } -bool MacroCommands::ApplyCommandInBatchMode( const wxString &friendlyCommand, +bool MacroCommands::ApplyCommandInBatchMode( + const TranslatableString &friendlyCommand, const CommandID & command, const wxString ¶ms, CommandContext const * pContext) { @@ -946,12 +947,12 @@ bool MacroCommands::ApplyMacro( for (; i < mCommandMacro.size(); i++) { const auto &command = mCommandMacro[i]; auto iter = catalog.ByCommandId(command); - auto friendly = (iter == catalog.end()) + const auto friendly = (iter == catalog.end()) ? // uh oh, using GET to expose an internal name to the user! // in default of any better friendly name - command.GET() - : iter->name.StrippedTranslation(); + Verbatim( command.GET() ) + : iter->name.Msgid().Stripped(); if (!ApplyCommandInBatchMode(friendly, command, mParamsMacro[i]) || mAbort) break; } @@ -1025,7 +1026,7 @@ void MacroCommands::ResetMacro() // ReportAndSkip() is a diagnostic function that avoids actually // applying the requested effect if in batch-debug mode. bool MacroCommands::ReportAndSkip( - const wxString & friendlyCommand, const wxString & params) + const TranslatableString & friendlyCommand, const wxString & params) { int bDebug; gPrefs->Read(wxT("/Batch/Debug"), &bDebug, false); diff --git a/src/BatchCommands.h b/src/BatchCommands.h index 66ed3e784..7d922c279 100644 --- a/src/BatchCommands.h +++ b/src/BatchCommands.h @@ -66,20 +66,20 @@ class MacroCommands final { static bool HandleTextualCommand( CommandManager &commandManager, const CommandID & Str, const CommandContext & context, CommandFlag flags, bool alwaysEnabled); - bool ApplyCommand( const wxString &friendlyCommand, + bool ApplyCommand( const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params, CommandContext const * pContext=NULL ); - bool ApplyCommandInBatchMode( const wxString &friendlyCommand, + bool ApplyCommandInBatchMode( const TranslatableString &friendlyCommand, const CommandID & command, const wxString ¶ms, CommandContext const * pContext = NULL); bool ApplySpecialCommand( - int iCommand, const wxString &friendlyCommand, + int iCommand, const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params); bool ApplyEffectCommand( - const PluginID & ID, const wxString &friendlyCommand, + const PluginID & ID, const TranslatableString &friendlyCommand, const CommandID & command, const wxString & params, const CommandContext & Context); - bool ReportAndSkip( const wxString & friendlyCommand, const wxString & params ); + bool ReportAndSkip( const TranslatableString & friendlyCommand, const wxString & params ); void AbortBatch(); // Utility functions for the special commands. diff --git a/src/commands/BatchEvalCommand.cpp b/src/commands/BatchEvalCommand.cpp index b136c84fb..e4f260f5e 100644 --- a/src/commands/BatchEvalCommand.cpp +++ b/src/commands/BatchEvalCommand.cpp @@ -59,12 +59,12 @@ bool BatchEvalCommand::Apply(const CommandContext & context) return batch.ApplyMacro(catalog); } - wxString cmdName = GetString(wxT("CommandName")); + auto cmdName = GetString(wxT("CommandName")); wxString cmdParams = GetString(wxT("ParamString")); auto iter = catalog.ByCommandId(cmdName); - const wxString &friendly = (iter == catalog.end()) - ? cmdName // Expose internal name to user, in default of a better one! - : iter->name.StrippedTranslation(); + const auto friendly = (iter == catalog.end()) + ? Verbatim( cmdName ) // Expose internal name to user, in default of a better one! + : iter->name.Msgid().Stripped(); // Create a Batch that will have just one command in it... MacroCommands Batch;