1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-07 07:12:34 +02:00

Merge pull request #264 from Paul-Licameli/translate-command-names

Translate command names
This commit is contained in:
James Crook 2018-03-14 23:34:49 +00:00 committed by GitHub
commit 6fe494df51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,15 +105,15 @@ MacroCommands::MacroCommands()
} }
} }
static const wxString MP3Conversion = wxT("MP3 Conversion"); static const wxString MP3Conversion = XO("MP3 Conversion");
static const wxString FadeEnds = wxT("Fade Ends"); static const wxString FadeEnds = XO("Fade Ends");
wxArrayString MacroCommands::GetNamesOfDefaultMacros() wxArrayString MacroCommands::GetNamesOfDefaultMacros()
{ {
wxArrayString defaults; wxArrayString defaults;
defaults.Add( MP3Conversion ); defaults.Add( GetCustomTranslation( MP3Conversion ) );
defaults.Add( FadeEnds ); defaults.Add( GetCustomTranslation( FadeEnds ) );
return defaults; return defaults;
} }
@ -122,10 +122,10 @@ void MacroCommands::RestoreMacro(const wxString & name)
// TIDY-ME: Effects change their name with localisation. // TIDY-ME: Effects change their name with localisation.
// Commands (at least currently) don't. Messy. // Commands (at least currently) don't. Messy.
ResetMacro(); ResetMacro();
if (name == MP3Conversion){ if (name == GetCustomTranslation( MP3Conversion ) ){
AddToMacro( wxT("Normalize") ); AddToMacro( wxT("Normalize") );
AddToMacro( wxT("ExportMP3") ); AddToMacro( wxT("ExportMP3") );
} else if (name == FadeEnds ){ } else if (name == GetCustomTranslation( FadeEnds ) ){
AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\"") ); AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\"") );
AddToMacro( wxT("FadeIn") ); AddToMacro( wxT("FadeIn") );
AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\" FromEnd=\"1\"") ); AddToMacro( wxT("Select"), wxT("Start=\"0\" End=\"1\" FromEnd=\"1\"") );
@ -283,7 +283,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.first /* .Translation() */, GetCustomTranslation( command.first ),
command.second, command.second,
_("Special Command") _("Special Command")
} ); } );
@ -299,7 +299,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
auto command = em.GetCommandIdentifier(plug->GetID()); auto command = em.GetCommandIdentifier(plug->GetID());
if (!command.IsEmpty()) if (!command.IsEmpty())
commands.push_back( { commands.push_back( {
plug->GetUntranslatedName(), // plug->GetTranslatedName(), plug->GetTranslatedName(),
command, command,
plug->GetPluginType() == PluginTypeEffect ? plug->GetPluginType() == PluginTypeEffect ?
_("Effect") : _("Menu Command (With Parameters)") _("Effect") : _("Menu Command (With Parameters)")
@ -324,7 +324,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
label.Replace( "&", "" ); label.Replace( "&", "" );
bool suffix; bool suffix;
if (!english) if (!english)
suffix = true; suffix = false;
else { else {
// We'll disambiguate if the squashed name is short and shorter than the internal name. // We'll disambiguate if the squashed name is short and shorter than the internal name.
// Otherwise not. // Otherwise not.