1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

More consistent naming conventions for choice control items...

... This commit leaves at least a comment for all choice controls of all
built-in effects and commands.

Use CamelCase with no spaces for the internal identifiers, given in
wxT("...")

Use more idiomatic English with spaces in the user-visible names, given in
XO("..."); these strings go to the message catalog for internationalization

Do not use underscores

In case these strings are the same, give it just once in XO("..."), but if in
a future version it is decided to change the name in XO("..."), then the
original should be kept also in a distinct wxT("...") string, so that
saved configuration or plugin settings or macro files don't become gratuitously
incompatible just because of that user-visible name change.

Left TruncateSilence alone for now -- I think that choice demands a rewrite
as a slider instead.
This commit is contained in:
Paul Licameli 2018-03-27 14:17:23 -04:00
parent 6f52df545e
commit e1b60916b7
12 changed files with 63 additions and 46 deletions

View File

@ -41,9 +41,9 @@ enum kCoordTypes
static const IdentInterfaceSymbol kCoordTypeStrings[nCoordTypes] = static const IdentInterfaceSymbol kCoordTypeStrings[nCoordTypes] =
{ {
{ XO("Panel") }, { XO("Panel") },
{ XO("App") }, { wxT("App"), XO("Application") },
{ XO("Track0") }, { wxT("Track0"), XO("Track 0") },
{ XO("Track1") }, { wxT("Track1"), XO("Track 1") },
}; };

View File

@ -58,7 +58,7 @@ enum {
static const IdentInterfaceSymbol kTypes[nTypes] = static const IdentInterfaceSymbol kTypes[nTypes] =
{ {
{ XO("Commands") }, { XO("Commands") },
{ XO("Commands+") }, { wxT("CommandsPlus"), XO("Commands Plus") },
{ XO("Menus") }, { XO("Menus") },
{ XO("Preferences") }, { XO("Preferences") },
{ XO("Tracks") }, { XO("Tracks") },
@ -77,7 +77,11 @@ enum {
static const IdentInterfaceSymbol kFormats[nFormats] = static const IdentInterfaceSymbol kFormats[nFormats] =
{ {
// These are acceptable dual purpose internal/visible names
/* i18n-hint JavaScript Object Notation */
{ XO("JSON") }, { XO("JSON") },
/* i18n-hint name of a computer programming language */
{ XO("LISP") }, { XO("LISP") },
{ XO("Brief") } { XO("Brief") }
}; };

View File

@ -50,21 +50,21 @@ static const IdentInterfaceSymbol
kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] = kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
{ {
{ XO("Window") }, { XO("Window") },
{ XO("Full_Window") }, { wxT("FullWindow"), XO("Full Window") },
{ XO("Window_Plus") }, { wxT("WindowPlus"), XO("Window Plus") },
{ XO("Fullscreen") }, { XO("Fullscreen") },
{ XO("Toolbars") }, { XO("Toolbars") },
{ XO("Effects") }, { XO("Effects") },
{ XO("Scriptables") }, { XO("Scriptables") },
{ XO("Preferences") }, { XO("Preferences") },
{ XO("Selectionbar") }, { XO("Selectionbar") },
{ XO("Spectral_Selection") }, { wxT("SpectralSelection"), XO("Spectral Selection") },
{ XO("Tools") }, { XO("Tools") },
{ XO("Transport") }, { XO("Transport") },
{ XO("Mixer") }, { XO("Mixer") },
{ XO("Meter") }, { XO("Meter") },
{ XO("Play_Meter") }, { wxT("PlayMeter"), XO("Play Meter") },
{ XO("Record_Meter") }, { wxT("RecordMeter"), XO("Record Meter") },
{ XO("Edit") }, { XO("Edit") },
{ XO("Device") }, { XO("Device") },
{ XO("Scrub") }, { XO("Scrub") },
@ -72,21 +72,22 @@ kCaptureWhatStrings[ ScreenshotCommand::nCaptureWhats ] =
{ XO("Trackpanel") }, { XO("Trackpanel") },
{ XO("Ruler") }, { XO("Ruler") },
{ XO("Tracks") }, { XO("Tracks") },
{ XO("First_Track") }, { wxT("FirstTrack"), XO("First Track") },
{ XO("First_Two_Tracks") }, { wxT("FirstTwoTracks"), XO("First Two Tracks") },
{ XO("First_Three_Tracks") }, { wxT("FirstThreeTracks"), XO("First Three Tracks") },
{ XO("First_Four_Tracks") }, { wxT("FirstFourTracks"), XO("First Four Tracks") },
{ XO("Second_Track") }, { wxT("SecondTrack"), XO("Second Track") },
{ XO("Tracks_Plus") }, { wxT("TracksPlus"), XO("Tracks Plus") },
{ XO("First_Track_Plus") }, { wxT("FirstTrackPlus"), XO("First Track Plus") },
{ XO("All_Tracks") }, { wxT("AllTracks"), XO("All Tracks") },
{ XO("All_Tracks_Plus") }, { wxT("AllTracksPlus"), XO("All Tracks Plus") },
}; };
static const IdentInterfaceSymbol static const IdentInterfaceSymbol
kBackgroundStrings[ ScreenshotCommand::nBackgrounds ] = kBackgroundStrings[ ScreenshotCommand::nBackgrounds ] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("Blue") }, { XO("Blue") },
{ XO("White") }, { XO("White") },
{ XO("None") }, { XO("None") },

View File

@ -46,12 +46,12 @@ explicitly code all three.
const int nRelativeTos =6; const int nRelativeTos =6;
static const IdentInterfaceSymbol kRelativeTo[nRelativeTos] = static const IdentInterfaceSymbol kRelativeTo[nRelativeTos] =
{ {
{ XO("Project Start") }, { wxT("ProjectStart"), XO("Project Start") },
{ XO("Project") }, { XO("Project") },
{ XO("Project End") }, { wxT("ProjectEnd"), XO("Project End") },
{ XO("Selection Start") }, { wxT("SelectionStart"), XO("Selection Start") },
{ XO("Selection") }, { XO("Selection") },
{ XO("Selection End") } { wxT("SelectionEnd"), XO("Selection End") }
}; };
bool SelectTimeCommand::DefineParams( ShuttleParams & S ){ bool SelectTimeCommand::DefineParams( ShuttleParams & S ){
@ -169,6 +169,8 @@ bool SelectFrequenciesCommand::Apply(const CommandContext & context){
const int nModes =3; const int nModes =3;
static const IdentInterfaceSymbol kModes[nModes] = static const IdentInterfaceSymbol kModes[nModes] =
{ {
// These are acceptable dual purpose internal/visible names
/* i18n-hint verb, imperative */ /* i18n-hint verb, imperative */
{ XO("Set") }, { XO("Set") },
{ XO("Add") }, { XO("Add") },

View File

@ -40,10 +40,10 @@ enum kColours
static const IdentInterfaceSymbol kColourStrings[nColours] = static const IdentInterfaceSymbol kColourStrings[nColours] =
{ {
{ XO("Color0") }, { wxT("Color0"), XO("Color 0") },
{ XO("Color1") }, { wxT("Color1"), XO("Color 1") },
{ XO("Color2") }, { wxT("Color2"), XO("Color 2") },
{ XO("Color3") }, { wxT("Color3"), XO("Color 3") },
}; };

View File

@ -238,10 +238,10 @@ enum kColours
static const IdentInterfaceSymbol kColourStrings[nColours] = static const IdentInterfaceSymbol kColourStrings[nColours] =
{ {
{ XO("Color0") }, { wxT("Color0"), XO("Color 0") },
{ XO("Color1") }, { wxT("Color1"), XO("Color 1") },
{ XO("Color2") }, { wxT("Color2"), XO("Color 2") },
{ XO("Color3") }, { wxT("Color3"), XO("Color 3") },
}; };
@ -254,6 +254,7 @@ enum kDisplayTypes
static const IdentInterfaceSymbol kDisplayTypeStrings[nDisplayTypes] = static const IdentInterfaceSymbol kDisplayTypeStrings[nDisplayTypes] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("Waveform") }, { XO("Waveform") },
{ XO("Spectrogram") }, { XO("Spectrogram") },
}; };
@ -267,7 +268,9 @@ enum kScaleTypes
static const IdentInterfaceSymbol kScaleTypeStrings[nScaleTypes] = static const IdentInterfaceSymbol kScaleTypeStrings[nScaleTypes] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("Linear") }, { XO("Linear") },
/* i18n-hint: abbreviates decibels */
{ XO("dB") }, { XO("dB") },
}; };
@ -282,7 +285,7 @@ enum kZoomTypes
static const IdentInterfaceSymbol kZoomTypeStrings[nZoomTypes] = static const IdentInterfaceSymbol kZoomTypeStrings[nZoomTypes] =
{ {
{ XO("Reset") }, { XO("Reset") },
{ XO("Times2") }, { wxT("Times2"), XO("Times 2") },
{ XO("HalfWave") }, { XO("HalfWave") },
}; };

View File

@ -59,17 +59,17 @@ enum kTableType
static const IdentInterfaceSymbol kTableTypeStrings[nTableTypes] = static const IdentInterfaceSymbol kTableTypeStrings[nTableTypes] =
{ {
{ XO("Hard Clipping") }, { wxT("HardClipping"), XO("Hard Clipping") },
{ XO("Soft Clipping") }, { wxT("SoftClipping"), XO("Soft Clipping") },
{ XO("Soft Overdrive") }, { wxT("SoftOverdrive"), XO("Soft Overdrive") },
{ XO("Medium Overdrive") }, { wxT("MediumOverdrive"), XO("Medium Overdrive") },
{ XO("Hard Overdrive") }, { wxT("HardOverdrive"), XO("Hard Overdrive") },
{ XO("Cubic Curve (odd harmonics)") }, { wxT("CubicCurveOddHarmonics"), XO("Cubic Curve (odd harmonics)") },
{ XO("Even Harmonics") }, { wxT("EvenHarmonics"), XO("Even Harmonics") },
{ XO("Expand and Compress") }, { wxT("ExpandCompress"), XO("Expand and Compress") },
{ XO("Leveller") }, { XO("Leveller") },
{ XO("Rectifier Distortion") }, { wxT("RectifierDistortion"), XO("Rectifier Distortion") },
{ XO("Hard Limiter 1413") } { wxT("HardLimiter1413"), XO("Hard Limiter 1413") }
}; };
// Define keys, defaults, minimums, and maximums for the effect parameters // Define keys, defaults, minimums, and maximums for the effect parameters

View File

@ -146,6 +146,8 @@ enum kInterpolations
static const IdentInterfaceSymbol kInterpStrings[nInterpolations] = static const IdentInterfaceSymbol kInterpStrings[nInterpolations] =
{ {
// These are acceptable dual purpose internal/visible names
/* i18n-hint: Technical term for a kind of curve.*/ /* i18n-hint: Technical term for a kind of curve.*/
{ XO("B-spline") }, { XO("B-spline") },
{ XO("Cosine") }, { XO("Cosine") },

View File

@ -37,6 +37,7 @@ enum kTypes
static const IdentInterfaceSymbol kTypeStrings[nTypes] = static const IdentInterfaceSymbol kTypeStrings[nTypes] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("White") }, { XO("White") },
{ XO("Pink") }, { XO("Pink") },
{ XO("Brownian") } { XO("Brownian") }

View File

@ -91,9 +91,9 @@ static const IdentInterfaceSymbol kTypeStrings[nTypes] =
/*i18n-hint: Butterworth is the name of the person after whom the filter type is named.*/ /*i18n-hint: Butterworth is the name of the person after whom the filter type is named.*/
{ XO("Butterworth") }, { XO("Butterworth") },
/*i18n-hint: Chebyshev is the name of the person after whom the filter type is named.*/ /*i18n-hint: Chebyshev is the name of the person after whom the filter type is named.*/
{ XO("Chebyshev Type I") }, { wxT("ChebyshevTypeI"), XO("Chebyshev Type I") },
/*i18n-hint: Chebyshev is the name of the person after whom the filter type is named.*/ /*i18n-hint: Chebyshev is the name of the person after whom the filter type is named.*/
{ XO("Chebyshev Type II") } { wxT("ChebyshevTypeII"), XO("Chebyshev Type II") }
}; };
enum kSubTypes enum kSubTypes
@ -105,6 +105,7 @@ enum kSubTypes
static const IdentInterfaceSymbol kSubTypeStrings[nSubTypes] = static const IdentInterfaceSymbol kSubTypeStrings[nSubTypes] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("Lowpass") }, { XO("Lowpass") },
{ XO("Highpass") } { XO("Highpass") }
}; };

View File

@ -41,6 +41,7 @@ enum kInterpolations
static const IdentInterfaceSymbol kInterStrings[nInterpolations] = static const IdentInterfaceSymbol kInterStrings[nInterpolations] =
{ {
// These are acceptable dual purpose internal/visible names
{ XO("Linear") }, { XO("Linear") },
{ XO("Logarithmic") } { XO("Logarithmic") }
}; };
@ -59,7 +60,7 @@ static const IdentInterfaceSymbol kWaveStrings[nWaveforms] =
{ XO("Sine") }, { XO("Sine") },
{ XO("Square") }, { XO("Square") },
{ XO("Sawtooth") }, { XO("Sawtooth") },
{ XO("Square, no alias") } { wxT("SquareNoAlias"), XO("Square, no alias") }
}; };
// Define keys, defaults, minimums, and maximums for the effect parameters // Define keys, defaults, minimums, and maximums for the effect parameters

View File

@ -42,6 +42,8 @@ public:
}; };
const IdentInterfaceSymbol Enums::DbChoices[] = { const IdentInterfaceSymbol Enums::DbChoices[] = {
// Yuck, why is this a choice control and not a slider? I'm leaving this
// table of names alone for now -- PRL
{ wxT("-20 dB") }, { wxT("-20 dB") },
{ wxT("-25 dB") }, { wxT("-25 dB") },
{ wxT("-30 dB") }, { wxT("-30 dB") },
@ -79,8 +81,8 @@ enum kActions
static const IdentInterfaceSymbol kActionStrings[nActions] = static const IdentInterfaceSymbol kActionStrings[nActions] =
{ {
{ XO("Truncate Detected Silence") }, { wxT("Truncate"), XO("Truncate Detected Silence") },
{ XO("Compress Excess Silence") } { wxT("Compress"), XO("Compress Excess Silence") }
}; };
static CommandParameters::ObsoleteMap kObsoleteActions[] = { static CommandParameters::ObsoleteMap kObsoleteActions[] = {