mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 17:09:26 +02:00
Remap effect type from "Audacity" to "Built-in", carefully...
... doing that only for the user-visible string, seen in the Manage>About menu of the effect dialog and in the sorted or grouped Effect/Generate/Analyze menus. But don't for the string used internally and written into pluginregistry.cfg, so that compatibility of that file is preserved. See also commits cafbff9ff82520ff7d4344570385752869c6d230 and c6bbe4c3dae8a52bb4b7a3c720af97bc3bd69769
This commit is contained in:
parent
1fe857cff1
commit
4628d6afa7
@ -1243,7 +1243,36 @@ wxString PluginDescriptor::GetUntranslatedEffectFamily() const
|
|||||||
|
|
||||||
wxString PluginDescriptor::GetTranslatedEffectFamily() const
|
wxString PluginDescriptor::GetTranslatedEffectFamily() const
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
|
||||||
return wxGetTranslation(mEffectFamily);
|
return wxGetTranslation(mEffectFamily);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// PRL: 2.2.2 hack to change the visible name without breaking
|
||||||
|
// compatibility of pluginregistry.cfg; redo this better
|
||||||
|
// Remap "Audacity" to "Built-in" (suitably translated)
|
||||||
|
|
||||||
|
// "Audacity" was the only possibility for mEffectFamily that was in the
|
||||||
|
// message catalog.
|
||||||
|
// The other possibilites are "VST", "LADSPA", "AudioUnit", "Nyquist",
|
||||||
|
// "LV2", "Vamp"
|
||||||
|
// None of these strings (yet) occur anywhere in the program in _() or XO()
|
||||||
|
// And we will leave them verbatim in other locales, as proper names
|
||||||
|
|
||||||
|
// See also EffectUIHost::OnMenu
|
||||||
|
|
||||||
|
// See also commits cafbff9ff82520ff7d4344570385752869c6d230 and
|
||||||
|
// c6bbe4c3dae8a52bb4b7a3c720af97bc3bd69769 for more about the complications
|
||||||
|
// involving this function
|
||||||
|
|
||||||
|
auto result = mEffectFamily;
|
||||||
|
if (result == wxT("Audacity"))
|
||||||
|
// Use XO so that this string does localize
|
||||||
|
result = XO("Built-in");
|
||||||
|
return wxGetTranslation( result );
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectType PluginDescriptor::GetEffectType() const
|
EffectType PluginDescriptor::GetEffectType() const
|
||||||
|
@ -220,6 +220,15 @@ wxString Effect::GetFamily()
|
|||||||
return mClient->GetFamily();
|
return mClient->GetFamily();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PRL: In 2.2.2 we wanted to change the user-visible name to
|
||||||
|
// "Built-in" but we did not do it the obvious way by just changing this
|
||||||
|
// string, because of problems with compatibility of pluginregistry.cfg
|
||||||
|
// See PluginDescriptor::GetTranslatedEffectFamily and
|
||||||
|
// EffectUIHost::OnMenu
|
||||||
|
// See PluginManager::RegisterPlugin and PluginManager::GetID, where the
|
||||||
|
// return value is also (mis?)used for internal identification purposes,
|
||||||
|
// NOT as a user-visible string!
|
||||||
|
// Thereby affecting configuration file contents!
|
||||||
return XO("Audacity");
|
return XO("Audacity");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3349,7 +3358,16 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
|
|||||||
{
|
{
|
||||||
auto sub = std::make_unique<wxMenu>();
|
auto sub = std::make_unique<wxMenu>();
|
||||||
|
|
||||||
sub->Append(kDummyID, wxString::Format(_("Type: %s"), mEffect->GetFamily()));
|
auto type = mEffect->GetFamily();
|
||||||
|
// PRL: 2.2.2 hack to change the visible name without breaking
|
||||||
|
// compatibility of pluginregistry.cfg; redo this better
|
||||||
|
// See also PluginDescriptor::GetTranslatedEffectFamily
|
||||||
|
if (type == wxT("Audacity"))
|
||||||
|
type = XO("Built-in");
|
||||||
|
// And now, also, translate this (what 2.2.1 neglected)
|
||||||
|
type = wxGetTranslation(type);
|
||||||
|
|
||||||
|
sub->Append(kDummyID, wxString::Format(_("Type: %s"), type));
|
||||||
sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetTranslatedName()));
|
sub->Append(kDummyID, wxString::Format(_("Name: %s"), mEffect->GetTranslatedName()));
|
||||||
sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
|
sub->Append(kDummyID, wxString::Format(_("Version: %s"), mEffect->GetVersion()));
|
||||||
sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor()));
|
sub->Append(kDummyID, wxString::Format(_("Vendor: %s"), mEffect->GetVendor()));
|
||||||
|
@ -88,7 +88,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
|
|||||||
// EffectIdentInterface implementation
|
// EffectIdentInterface implementation
|
||||||
|
|
||||||
EffectType GetType() override;
|
EffectType GetType() override;
|
||||||
wxString GetFamily() override;
|
wxString GetFamily() override; // returns UNTRANSLATED
|
||||||
bool IsInteractive() override;
|
bool IsInteractive() override;
|
||||||
bool IsDefault() override;
|
bool IsDefault() override;
|
||||||
bool IsLegacy() override;
|
bool IsLegacy() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user