mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 08:30:06 +02:00
TranslatableString for effect command names and descriptions
This commit is contained in:
parent
89df7a3ffc
commit
1f86a77569
@ -178,9 +178,9 @@ void EffectManager::UnregisterEffect(const PluginID & ID)
|
|||||||
|
|
||||||
if (!(flags & EffectManager::kSkipState))
|
if (!(flags & EffectManager::kSkipState))
|
||||||
{
|
{
|
||||||
wxString shortDesc = em.GetCommandName(ID);
|
auto shortDesc = em.GetCommandName(ID);
|
||||||
wxString longDesc = em.GetCommandDescription(ID);
|
auto longDesc = em.GetCommandDescription(ID);
|
||||||
ProjectHistory::Get( project ).PushState(longDesc, shortDesc);
|
ProjectHistory::Get( project ).PushState(longDesc.Translation(), shortDesc.Translation());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & EffectManager::kDontRepeatLast))
|
if (!(flags & EffectManager::kDontRepeatLast))
|
||||||
@ -188,7 +188,7 @@ void EffectManager::UnregisterEffect(const PluginID & ID)
|
|||||||
// Only remember a successful effect, don't remember insert,
|
// Only remember a successful effect, don't remember insert,
|
||||||
// or analyze effects.
|
// or analyze effects.
|
||||||
if (type == EffectTypeProcess) {
|
if (type == EffectTypeProcess) {
|
||||||
wxString shortDesc = em.GetCommandName(ID);
|
auto shortDesc = em.GetCommandName(ID);
|
||||||
MenuManager::Get(project).mLastEffect = ID;
|
MenuManager::Get(project).mLastEffect = ID;
|
||||||
/* i18n-hint: %s will be the name of the effect which will be
|
/* i18n-hint: %s will be the name of the effect which will be
|
||||||
* repeated if this menu item is chosen */
|
* repeated if this menu item is chosen */
|
||||||
@ -294,9 +294,9 @@ ComponentInterfaceSymbol EffectManager::GetCommandSymbol(const PluginID & ID)
|
|||||||
return PluginManager::Get().GetSymbol(ID);
|
return PluginManager::Get().GetSymbol(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString EffectManager::GetCommandName(const PluginID & ID)
|
TranslatableString EffectManager::GetCommandName(const PluginID & ID)
|
||||||
{
|
{
|
||||||
return GetCommandSymbol(ID).Translation();
|
return GetCommandSymbol(ID).Msgid();
|
||||||
}
|
}
|
||||||
|
|
||||||
TranslatableString EffectManager::GetEffectFamilyName(const PluginID & ID)
|
TranslatableString EffectManager::GetEffectFamilyName(const PluginID & ID)
|
||||||
@ -341,14 +341,14 @@ CommandID EffectManager::GetCommandIdentifier(const PluginID & ID)
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString EffectManager::GetCommandDescription(const PluginID & ID)
|
TranslatableString EffectManager::GetCommandDescription(const PluginID & ID)
|
||||||
{
|
{
|
||||||
if (GetEffect(ID))
|
if (GetEffect(ID))
|
||||||
return wxString::Format(_("Applied effect: %s"), GetCommandName(ID));
|
return XO("Applied effect: %s").Format( GetCommandName(ID) );
|
||||||
if (GetAudacityCommand(ID))
|
if (GetAudacityCommand(ID))
|
||||||
return wxString::Format(_("Applied command: %s"), GetCommandName(ID));
|
return XO("Applied command: %s").Format( GetCommandName(ID) );
|
||||||
|
|
||||||
return wxEmptyString;
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString EffectManager::GetCommandUrl(const PluginID & ID)
|
wxString EffectManager::GetCommandUrl(const PluginID & ID)
|
||||||
@ -398,7 +398,7 @@ void EffectManager::GetCommandDefinition(const PluginID & ID, const CommandConte
|
|||||||
// 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
|
||||||
S.AddItem( GetCommandIdentifier( ID ).GET(), "id" );
|
S.AddItem( GetCommandIdentifier( ID ).GET(), "id" );
|
||||||
S.AddItem( GetCommandName( ID ), "name" );
|
S.AddItem( GetCommandName( ID ).Translation(), "name" );
|
||||||
if( bHasParams ){
|
if( bHasParams ){
|
||||||
S.StartField( "params" );
|
S.StartField( "params" );
|
||||||
S.StartArray();
|
S.StartArray();
|
||||||
@ -700,7 +700,7 @@ Effect *EffectManager::GetEffect(const PluginID & ID)
|
|||||||
auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
|
auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
|
||||||
if( !command )
|
if( !command )
|
||||||
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'"),
|
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'"),
|
||||||
GetCommandName(ID)),
|
GetCommandName(ID).Translation()),
|
||||||
_("Effect failed to initialize"));
|
_("Effect failed to initialize"));
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -756,7 +756,7 @@ AudacityCommand *EffectManager::GetAudacityCommand(const PluginID & ID)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'"),
|
AudacityMessageBox(wxString::Format(_("Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'"),
|
||||||
GetCommandName(ID)),
|
GetCommandName(ID).Translation()),
|
||||||
_("Command failed to initialize"));
|
_("Command failed to initialize"));
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -105,9 +105,9 @@ public:
|
|||||||
|
|
||||||
// Renamed from 'Effect' to 'Command' prior to moving out of this class.
|
// Renamed from 'Effect' to 'Command' prior to moving out of this class.
|
||||||
ComponentInterfaceSymbol GetCommandSymbol(const PluginID & ID);
|
ComponentInterfaceSymbol GetCommandSymbol(const PluginID & ID);
|
||||||
wxString GetCommandName(const PluginID & ID); // translated
|
TranslatableString GetCommandName(const PluginID & ID);
|
||||||
CommandID GetCommandIdentifier(const PluginID & ID);
|
CommandID GetCommandIdentifier(const PluginID & ID);
|
||||||
wxString GetCommandDescription(const PluginID & ID);
|
TranslatableString GetCommandDescription(const PluginID & ID);
|
||||||
wxString GetCommandUrl(const PluginID & ID);
|
wxString GetCommandUrl(const PluginID & ID);
|
||||||
wxString GetCommandTip(const PluginID & ID);
|
wxString GetCommandTip(const PluginID & ID);
|
||||||
// flags control which commands are included.
|
// flags control which commands are included.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user