From d1637c22c0dfd8dfc80c9db6305f5b3e680fa221 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 22 Dec 2019 15:40:29 -0500 Subject: [PATCH] TranslatableString for explicit prompts and units in ShuttleGui --- src/BatchCommandDialog.cpp | 2 +- src/BatchProcessDialog.cpp | 2 +- src/FreqWindow.cpp | 4 +-- src/HistoryWindow.cpp | 2 +- src/PluginManager.cpp | 4 +-- src/ShuttleGui.cpp | 33 ++++++++++--------- src/ShuttleGui.h | 4 +-- src/Tags.cpp | 2 +- src/TimerRecordDialog.cpp | 4 +-- src/effects/AutoDuck.cpp | 14 ++++---- src/effects/ChangePitch.cpp | 2 +- src/effects/ChangeSpeed.cpp | 6 ++-- src/effects/DtmfGen.cpp | 2 +- src/effects/Effect.cpp | 4 +-- src/effects/Equalization.cpp | 8 ++--- src/effects/Noise.cpp | 2 +- src/effects/NoiseReduction.cpp | 2 +- src/effects/NoiseRemoval.cpp | 2 +- src/effects/ScienFilter.cpp | 2 +- src/effects/Silence.cpp | 2 +- src/effects/ToneGen.cpp | 6 ++-- src/effects/TruncSilence.cpp | 8 ++--- src/effects/nyquist/Nyquist.cpp | 4 +-- src/effects/vamp/VampEffect.cpp | 8 ++--- src/export/ExportMP3.cpp | 4 +-- src/export/ExportMultiple.cpp | 2 +- src/import/ImportPCM.cpp | 10 +++--- src/import/ImportRaw.cpp | 6 ++-- src/prefs/DevicePrefs.cpp | 6 ++-- src/prefs/MidiIOPrefs.cpp | 2 +- src/prefs/PlaybackPrefs.cpp | 10 +++--- src/prefs/QualityPrefs.cpp | 2 +- src/prefs/RecordingPrefs.cpp | 10 +++--- .../labeltrack/ui/LabelTrackControls.cpp | 4 +-- 34 files changed, 93 insertions(+), 92 deletions(-) diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index bd7165efa..8a571d649 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -104,7 +104,7 @@ void MacroCommandDialog::PopulateOrExchange(ShuttleGui &S) mParameters = S.AddTextBox(XO("&Parameters"), wxT(""), 0); mParameters->SetEditable(false); auto prompt = XO("&Details"); - S.Prop(0).AddPrompt(prompt.Translation()); + S.Prop(0).AddPrompt(prompt); mDetails = S .Name( prompt ) .AddTextWindow( wxT("")); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index 9f843f5b0..ae8444c32 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -145,7 +145,7 @@ void ApplyMacroDialog::PopulateOrExchange(ShuttleGui &S) S.StartHorizontalLay(wxEXPAND, 0); { - S.AddPrompt( _("Apply Macro to:") ); + S.AddPrompt( XO("Apply Macro to:") ); wxButton* btn = S.Id(ApplyToProjectID) .Name(XO("Apply macro to project")) .AddButton(XO("&Project")); diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index 483bc4475..06b7bd524 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -419,12 +419,12 @@ FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id, S.SetStretchyCol(1); S.SetStretchyCol(3); { - S.AddPrompt(_("Cursor:")); + S.AddPrompt(XO("Cursor:")); mCursorText = S.Style(wxTE_READONLY) .AddTextBox( {}, wxT(""), 10); - S.AddPrompt(_("Peak:")); + S.AddPrompt(XO("Peak:")); mPeakText = S.Style(wxTE_READONLY) .AddTextBox( {}, wxT(""), 10); diff --git a/src/HistoryWindow.cpp b/src/HistoryWindow.cpp index 7770b987f..3b0801233 100644 --- a/src/HistoryWindow.cpp +++ b/src/HistoryWindow.cpp @@ -107,7 +107,7 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager): .AddTextBox(XO("&Undo levels available"), wxT("0"), 10); S.AddVariableText( {} )->Hide(); - S.AddPrompt(_("&Levels to discard")); + S.AddPrompt(XO("&Levels to discard")); mLevels = safenew wxSpinCtrl(S.GetParent(), ID_LEVELS, wxT("1"), diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index a75644e6f..0d949e3b9 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -516,7 +516,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) { S.StartHorizontalLay(wxALIGN_LEFT, 0); { - S.AddPrompt(_("Select effects, click the Enable or Disable button, then click OK.")); + S.AddPrompt(XO("Select effects, click the Enable or Disable button, then click OK.")); } S.EndHorizontalLay(); @@ -531,7 +531,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) wxRadioButton *rb; /* i18n-hint: This is before radio buttons selecting which effects to show */ - S.AddPrompt(_("Show:")); + S.AddPrompt(XO("Show:")); rb = S.Id(ID_ShowAll) /* i18n-hint: Radio button to show all effects */ .Name(XO("Show all")) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index f4b43d502..4c60e4a97 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -225,7 +225,7 @@ void ShuttleGuiBase::HandleOptionality(const TranslatableString &Prompt) } /// Right aligned text string. -void ShuttleGuiBase::AddPrompt(const wxString &Prompt, int wrapWidth) +void ShuttleGuiBase::AddPrompt(const TranslatableString &Prompt, int wrapWidth) { if( mShuttleMode != eIsCreating ) return; @@ -239,29 +239,31 @@ void ShuttleGuiBase::AddPrompt(const wxString &Prompt, int wrapWidth) if( Prompt.empty() ) return; miProp=1; - auto text = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, + const auto translated = Prompt.Translation(); + auto text = safenew wxStaticText(GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize, GetStyle( wxALIGN_RIGHT )); mpWind = text; if (wrapWidth > 0) text->Wrap(wrapWidth); - mpWind->SetName(wxStripMenuCodes(Prompt)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) + mpWind->SetName(wxStripMenuCodes(translated)); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL, true ); } /// Left aligned text string. -void ShuttleGuiBase::AddUnits(const wxString &Prompt, int wrapWidth) +void ShuttleGuiBase::AddUnits(const TranslatableString &Prompt, int wrapWidth) { if( Prompt.empty() ) return; if( mShuttleMode != eIsCreating ) return; miProp = 1; - auto text = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, + const auto translated = Prompt.Translation(); + auto text = safenew wxStaticText(GetParent(), -1, translated, wxDefaultPosition, wxDefaultSize, GetStyle( wxALIGN_LEFT )); mpWind = text; if (wrapWidth > 0) text->Wrap(wrapWidth); - mpWind->SetName(Prompt); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) + mpWind->SetName(translated); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) UpdateSizersCore( false, wxALL | wxALIGN_CENTRE_VERTICAL ); } @@ -300,7 +302,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const TranslatableString &Prompt, bool auto realPrompt = Prompt.Translation(); if( mpbOptionalFlag ) { - AddPrompt( ""); + AddPrompt( {} ); //realPrompt = wxT(""); } @@ -331,7 +333,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const TranslatableString &Prompt, bool wxCheckBox * ShuttleGuiBase::AddCheckBoxOnRight( const TranslatableString &Prompt, bool Selected) { HandleOptionality( Prompt ); - AddPrompt( Prompt.Translation() ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxCheckBox); @@ -387,7 +389,7 @@ wxChoice * ShuttleGuiBase::AddChoice( const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected ) { HandleOptionality( Prompt ); - AddPrompt( Prompt.Translation() ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxChoice); @@ -487,7 +489,7 @@ wxComboBox * ShuttleGuiBase::AddCombo( { const auto translated = Prompt.Translation(); HandleOptionality( Prompt ); - AddPrompt( translated ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxComboBox); @@ -557,7 +559,7 @@ wxSlider * ShuttleGuiBase::AddSlider( const TranslatableString &Prompt, int pos, int Max, int Min) { HandleOptionality( Prompt ); - AddPrompt( Prompt.Translation() ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSlider); @@ -582,7 +584,7 @@ wxSpinCtrl * ShuttleGuiBase::AddSpinCtrl( { const auto translated = Prompt.Translation(); HandleOptionality( Prompt ); - AddPrompt( translated ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxSpinCtrl); @@ -604,7 +606,7 @@ wxTextCtrl * ShuttleGuiBase::AddTextBox( { const auto translated = Caption.Translation(); HandleOptionality( Caption ); - AddPrompt( translated ); + AddPrompt( Caption ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl); @@ -638,7 +640,7 @@ wxTextCtrl * ShuttleGuiBase::AddNumericTextBox( { const auto translated = Caption.Translation(); HandleOptionality( Caption ); - AddPrompt( translated ); + AddPrompt( Caption ); UseUpId(); if( mShuttleMode != eIsCreating ) return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxTextCtrl); @@ -695,9 +697,8 @@ wxTextCtrl * ShuttleGuiBase::AddTextWindow(const wxString &Value) void ShuttleGuiBase::AddConstTextBox( const TranslatableString &Prompt, const TranslatableString &Value) { - const auto translated = Prompt.Translation(); HandleOptionality( Prompt ); - AddPrompt( translated ); + AddPrompt( Prompt ); UseUpId(); if( mShuttleMode != eIsCreating ) return; diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index c105df8d7..e17d9a0a6 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -266,8 +266,8 @@ public: //-- Add functions. These only add a widget or 2. void HandleOptionality(const TranslatableString &Prompt); - void AddPrompt(const wxString &Prompt, int wrapWidth = 0); - void AddUnits(const wxString &Prompt, int wrapWidth = 0); + void AddPrompt(const TranslatableString &Prompt, int wrapWidth = 0); + void AddUnits(const TranslatableString &Prompt, int wrapWidth = 0); void AddTitle(const TranslatableString &Prompt, int wrapWidth = 0); wxWindow * AddWindow(wxWindow * pWindow); wxSlider * AddSlider( diff --git a/src/Tags.cpp b/src/Tags.cpp index 05c6d6382..46392a875 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -876,7 +876,7 @@ void TagsEditorDialog::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxALIGN_LEFT, 0); { - S.AddUnits(_("Use arrow keys (or ENTER key after editing) to navigate fields.")); + S.AddUnits(XO("Use arrow keys (or ENTER key after editing) to navigate fields.")); } S.EndHorizontalLay(); diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 7f67c9606..2eccc95b7 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -937,7 +937,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) m_fnAutoSaveFile.Assign(sSaveValue); sInitialValue = _("Current Project"); } - S.AddPrompt(_("Save Project As:")); + S.AddPrompt(XO("Save Project As:")); m_pTimerSavePathTextCtrl = NewPathControl( S.GetParent(), ID_AUTOSAVEPATH_TEXT, _("Save Project As:"), sInitialValue); m_pTimerSavePathTextCtrl->SetEditable(false); @@ -953,7 +953,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(XO("Enable Automatic &Export?"), bAutoExport); S.StartMultiColumn(3, wxEXPAND); { - S.AddPrompt(_("Export Project As:")); + S.AddPrompt(XO("Export Project As:")); m_pTimerExportPathTextCtrl = NewPathControl( S.GetParent(), ID_AUTOEXPORTPATH_TEXT, _("Export Project As:"), wxT("")); m_pTimerExportPathTextCtrl->SetEditable(false); diff --git a/src/effects/AutoDuck.cpp b/src/effects/AutoDuck.cpp index 41ba2924a..857427f66 100644 --- a/src/effects/AutoDuck.cpp +++ b/src/effects/AutoDuck.cpp @@ -436,42 +436,42 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S) MIN_DuckAmountDb, MAX_DuckAmountDb ) .AddTextBox(XO("Duck amount:"), wxT(""), 10); - S.AddUnits(_("dB")); + S.AddUnits(XO("dB")); mMaximumPauseBox = S.Validator>( 2, &mMaximumPause, NumValidatorStyle::NO_TRAILING_ZEROES, MIN_MaximumPause, MAX_MaximumPause ) .AddTextBox(XO("Maximum pause:"), wxT(""), 10); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); mOuterFadeDownLenBox = S.Validator>( 2, &mOuterFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES, MIN_OuterFadeDownLen, MAX_OuterFadeDownLen ) .AddTextBox(XO("Outer fade down length:"), wxT(""), 10); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); mOuterFadeUpLenBox = S.Validator>( 2, &mOuterFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES, MIN_OuterFadeUpLen, MAX_OuterFadeUpLen ) .AddTextBox(XO("Outer fade up length:"), wxT(""), 10); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); mInnerFadeDownLenBox = S.Validator>( 2, &mInnerFadeDownLen, NumValidatorStyle::NO_TRAILING_ZEROES, MIN_InnerFadeDownLen, MAX_InnerFadeDownLen ) .AddTextBox(XO("Inner fade down length:"), wxT(""), 10); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); mInnerFadeUpLenBox = S.Validator>( 2, &mInnerFadeUpLen, NumValidatorStyle::NO_TRAILING_ZEROES, MIN_InnerFadeUpLen, MAX_InnerFadeUpLen ) .AddTextBox(XO("Inner fade up length:"), wxT(""), 10); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } S.EndMultiColumn(); @@ -482,7 +482,7 @@ void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S) MIN_ThresholdDb, MAX_ThresholdDb ) .AddTextBox(XO("Threshold:"), wxT(""), 10); - S.AddUnits(_("dB")); + S.AddUnits(XO("dB")); } S.EndMultiColumn(); diff --git a/src/effects/ChangePitch.cpp b/src/effects/ChangePitch.cpp index 93fce1019..c533d5d9c 100644 --- a/src/effects/ChangePitch.cpp +++ b/src/effects/ChangePitch.cpp @@ -335,7 +335,7 @@ void EffectChangePitch::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox(XO("to"), wxT(""), 12); - S.AddUnits(_("Hz")); + S.AddUnits(XO("Hz")); } S.EndMultiColumn(); diff --git a/src/effects/ChangeSpeed.cpp b/src/effects/ChangeSpeed.cpp index b510c8755..7c51c3791 100644 --- a/src/effects/ChangeSpeed.cpp +++ b/src/effects/ChangeSpeed.cpp @@ -337,7 +337,7 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(5, wxCENTER); { /* i18n-hint: "rpm" is an English abbreviation meaning "revolutions per minute". */ - S.AddUnits(_("Standard Vinyl rpm:")); + S.AddUnits(XO("Standard Vinyl rpm:")); mpChoice_FromVinyl = S.Id(ID_FromVinyl) .Name(XO("From rpm")) @@ -358,7 +358,7 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(2, wxALIGN_LEFT); { - S.AddPrompt(_("Current Length:")); + S.AddPrompt(XO("Current Length:")); mpFromLengthCtrl = safenew NumericTextCtrl(S.GetParent(), wxID_ANY, @@ -376,7 +376,7 @@ void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S) .Position(wxALIGN_LEFT) .AddWindow(mpFromLengthCtrl); - S.AddPrompt(_("New Length:")); + S.AddPrompt(XO("New Length:")); mpToLengthCtrl = safenew NumericTextCtrl(S.GetParent(), ID_ToLength, diff --git a/src/effects/DtmfGen.cpp b/src/effects/DtmfGen.cpp index f8c7c4ff8..903905053 100644 --- a/src/effects/DtmfGen.cpp +++ b/src/effects/DtmfGen.cpp @@ -340,7 +340,7 @@ void EffectDtmf::PopulateOrExchange(ShuttleGui & S) MIN_Amplitude, MAX_Amplitude) .AddTextBox(XO("Amplitude (0-1):"), wxT(""), 10); - S.AddPrompt(_("Duration:")); + S.AddPrompt(XO("Duration:")); mDtmfDurationT = safenew NumericTextCtrl(S.GetParent(), ID_Duration, NumericConverter::TIME, diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 6f7a54f0d..ffb03a9dd 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -3746,10 +3746,10 @@ EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect) S.StartTwoColumn(); S.SetStretchyCol(1); { - S.AddPrompt(_("Type:")); + S.AddPrompt(XO("Type:")); mType = S.Id(ID_Type).AddChoice( {}, {}, 0 ); - S.AddPrompt(_("&Preset:")); + S.AddPrompt(XO("&Preset:")); mPresets = S .Style( wxLB_SINGLE | wxLB_NEEDED_SB ) .AddListBox( {} ); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index e2ce2c4e2..2ee496ccb 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -914,7 +914,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); { - S.AddPrompt(_("&EQ Type:")); + S.AddPrompt(XO("&EQ Type:")); } S.EndHorizontalLay(); @@ -975,7 +975,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, 0); { - S.AddPrompt(_("Length of &Filter:")); + S.AddPrompt(XO("Length of &Filter:")); } S.EndHorizontalLay(); @@ -1010,7 +1010,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.AddSpace(5, 5); S.StartHorizontalLay(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); { - S.AddPrompt(_("&Select Curve:")); + S.AddPrompt(XO("&Select Curve:")); } S.EndHorizontalLay(); @@ -1065,7 +1065,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) S.StartHorizontalLay(); { - S.AddUnits(_("&Processing: ")); + S.AddUnits(XO("&Processing: ")); // update the control state int mathPath = EffectEqualization48x::GetMathPath(); diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp index 97eb7f65d..73fe207ad 100644 --- a/src/effects/Noise.cpp +++ b/src/effects/Noise.cpp @@ -233,7 +233,7 @@ void EffectNoise::PopulateOrExchange(ShuttleGui & S) ) .AddTextBox(XO("Amplitude (0-1):"), wxT(""), 12); - S.AddPrompt(_("Duration:")); + S.AddPrompt(XO("Duration:")); mNoiseDurationT = safenew NumericTextCtrl(S.GetParent(), wxID_ANY, NumericConverter::TIME, diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index 3aca7a441..76ba7af55 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1740,7 +1740,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) , wxALIGN_CENTER_HORIZONTAL); { - S.AddPrompt(_("Noise:")); + S.AddPrompt(XO("Noise:")); mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL) .AddRadioButton(XO("Re&duce")); /* i18n-hint: Translate differently from "Residue" ! */ #ifdef ISOLATE_CHOICE diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index e9e81f340..9a2afda69 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -756,7 +756,7 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) .MinSize( { 150, -1 } ) .AddSlider( {}, 0, TIME_MAX, TIME_MIN); - S.AddPrompt(_("Noise:")); + S.AddPrompt(XO("Noise:")); mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL) .AddRadioButton(XO("Re&move")); mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE) diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp index a9edc0132..8f62a8163 100644 --- a/src/effects/ScienFilter.cpp +++ b/src/effects/ScienFilter.cpp @@ -507,7 +507,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) 1, &mCutoff, NumValidatorStyle::DEFAULT, MIN_Cutoff, mNyquist - 1) .AddTextBox(XO("C&utoff:"), wxT(""), 10); - S.AddUnits(_("Hz")); + S.AddUnits(XO("Hz")); mStopbandRippleCtlP = S.AddVariableText(XO("Minimum S&topband Attenuation:"), diff --git a/src/effects/Silence.cpp b/src/effects/Silence.cpp index e00bebe42..3e4b41bdb 100644 --- a/src/effects/Silence.cpp +++ b/src/effects/Silence.cpp @@ -64,7 +64,7 @@ void EffectSilence::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(); { - S.AddPrompt(_("Duration:")); + S.AddPrompt(XO("Duration:")); mDurationT = safenew NumericTextCtrl(S.GetParent(), wxID_ANY, NumericConverter::TIME, diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index 496dca354..94b2e393a 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -363,7 +363,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) } S.EndHorizontalLay(); - S.AddPrompt(_("Frequency (Hz):")); + S.AddPrompt(XO("Frequency (Hz):")); S.StartHorizontalLay(wxEXPAND); { S.StartHorizontalLay(wxLEFT, 50); @@ -394,7 +394,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) } S.EndHorizontalLay(); - S.AddPrompt(_("Amplitude (0-1):")); + S.AddPrompt(XO("Amplitude (0-1):")); S.StartHorizontalLay(wxEXPAND); { S.StartHorizontalLay(wxLEFT, 50); @@ -441,7 +441,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S) .AddTextBox(XO("Amplitude (0-1):"), wxT(""), 12); } - S.AddPrompt(_("Duration:")); + S.AddPrompt(XO("Duration:")); mToneDurationT = safenew NumericTextCtrl(S.GetParent(), wxID_ANY, NumericConverter::TIME, diff --git a/src/effects/TruncSilence.cpp b/src/effects/TruncSilence.cpp index 162d21b3d..1d4f8ac2f 100644 --- a/src/effects/TruncSilence.cpp +++ b/src/effects/TruncSilence.cpp @@ -762,7 +762,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) MIN_Threshold, MAX_Threshold ) .AddTextBox(XO("Threshold:"), wxT(""), 0); - S.AddUnits(_("dB")); + S.AddUnits(XO("dB")); // Ignored silence mInitialAllowedSilenceT = S.Validator>( @@ -770,7 +770,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) NumValidatorStyle::NO_TRAILING_ZEROES, MIN_Minimum, MAX_Minimum) .AddTextBox(XO("Duration:"), wxT(""), 12); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } S.EndMultiColumn(); } @@ -798,7 +798,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) MIN_Truncate, MAX_Truncate ) .AddTextBox(XO("Truncate to:"), wxT(""), 12); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); mSilenceCompressPercentT = S.Validator>( 3, &mSilenceCompressPercent, @@ -806,7 +806,7 @@ void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) MIN_Compress, MAX_Compress ) .AddTextBox(XO("Compress to:"), wxT(""), 12); - S.AddUnits(_("%")); + S.AddUnits(XO("%")); } S.EndMultiColumn(); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 2da6a9de1..35d8cef29 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2659,7 +2659,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) else { auto prompt = XO("%s:").Format( ctrl.name ); - S.AddPrompt( prompt.Translation() ); + S.AddPrompt( prompt ); if (ctrl.type == NYQ_CTRL_STRING) { @@ -2782,7 +2782,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) } else { - S.AddUnits(ctrl.label); + S.AddUnits( Verbatim( ctrl.label ) ); } } } diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index a2704a95d..119840ac6 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -562,7 +562,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) if (!programs.empty()) { - S.AddPrompt(_("Program")); + S.AddPrompt(XO("Program")); S.Id(ID_Program); mProgram = S.Name(XO("Program")) @@ -604,7 +604,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) } /* i18n-hint: An item name introducing a value, which is not part of the string but appears in a following text box window; translate with appropriate punctuation */ - S.AddPrompt(wxString::Format(_("%s:"), labelText)); + S.AddPrompt(XO("%s:").Format( labelText )); if (mParameters[p].isQuantized && mParameters[p].quantizeStep == 1.0 && @@ -672,7 +672,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) .AddTextBox( {}, wxT(""), 12); wxString str = Internat::ToDisplayString(mParameters[p].minValue); - S.AddPrompt(str); + S.AddPrompt( Verbatim( str ) ); S.Id(ID_Sliders + p); mSliders[p] = S.ToolTip( Verbatim( tip ) ) @@ -682,7 +682,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) .AddSlider( {}, 0, 1000, 0); str = Internat::ToDisplayString(mParameters[p].maxValue); - S.AddUnits(str); + S.AddUnits( Verbatim( str ) ); } } } diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index 883799d15..cea04b3b6 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -372,7 +372,7 @@ void ExportMP3Options::PopulateOrExchange(ShuttleGui & S) S.SetStretchyCol(1); S.StartTwoColumn(); { - S.AddPrompt(_("Bit Rate Mode:")); + S.AddPrompt(XO("Bit Rate Mode:")); S.StartHorizontalLay(); { S.StartRadioButtonGroup(MP3RateModeSetting); @@ -399,7 +399,7 @@ void ExportMP3Options::PopulateOrExchange(ShuttleGui & S) { wxT("/FileFormats/MP3VarMode"), ROUTINE_FAST }, varModeNames ); - S.AddPrompt(_("Channel Mode:")); + S.AddPrompt(XO("Channel Mode:")); S.StartMultiColumn(3, wxEXPAND); { S.StartRadioButtonGroup(MP3ChannelModeSetting); diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index cf47b1c38..3b14ce9e9 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -297,7 +297,7 @@ void ExportMultipleDialog::PopulateOrExchange(ShuttleGui& S) S.AddVariableText( {}, false); S.AddVariableText( {}, false); - S.AddPrompt(_("Options:")); + S.AddPrompt(XO("Options:")); mBook = S.Id(OptionsID) .Style(wxBORDER_STATIC) diff --git a/src/import/ImportPCM.cpp b/src/import/ImportPCM.cpp index e870674d3..1738d4e8f 100644 --- a/src/import/ImportPCM.cpp +++ b/src/import/ImportPCM.cpp @@ -321,17 +321,17 @@ static wxString AskCopyOrEdit() wxDialogWrapper dialog( nullptr, -1, XO("Warning") ); dialog.SetName(); - wxString clause1 = _( + auto clause1 = XO( "When importing uncompressed audio files you can either copy them into the project," " or read them directly from their current location (without copying).\n\n" ); - wxString clause2 = oldCopyPref == wxT("copy") - ? _("Your current preference is set to copy in.\n\n") - : _("Your current preference is set to read directly.\n\n") + auto clause2 = (oldCopyPref == wxT("copy")) + ? XO("Your current preference is set to copy in.\n\n") + : XO("Your current preference is set to read directly.\n\n") ; - wxString clause3 = _( + wxString clause3 = XO( "Reading the files directly allows you to play or edit them almost immediately. " "This is less safe than copying in, because you must retain the files with their " "original names in their original locations.\n" diff --git a/src/import/ImportRaw.cpp b/src/import/ImportRaw.cpp index c73f69d5f..74a839f73 100644 --- a/src/import/ImportRaw.cpp +++ b/src/import/ImportRaw.cpp @@ -411,13 +411,13 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent, mOffsetText = S.AddTextBox(XO("Start offset:"), wxString::Format(wxT("%d"), mOffset), 12); - S.AddUnits(_("bytes")); + S.AddUnits(XO("bytes")); // Percent text mPercentText = S.AddTextBox(XO("Amount to import:"), wxT("100"), 12); - S.AddUnits(_("%")); + S.AddUnits(XO("%")); // Rate text /* i18n-hint: (noun)*/ @@ -426,7 +426,7 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent, 12); /* i18n-hint: This is the abbreviation for "Hertz", or cycles per second. */ - S.AddUnits(_("Hz")); + S.AddUnits(XO("Hz")); } S.EndMultiColumn(); diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 72b3e7f5e..8a6aa3564 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -141,7 +141,7 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) } ); - S.AddPrompt(_("Using:")); + S.AddPrompt(XO("Using:")); S.AddFixedText( Verbatim(wxSafeConvertMB2WX(Pa_GetVersionText() ) ) ); } S.EndMultiColumn(); @@ -192,7 +192,7 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/LatencyDuration"), DEFAULT_LATENCY_DURATION}, 9); - S.AddUnits(_("milliseconds")); + S.AddUnits(XO("milliseconds")); w = S .NameSuffix(XO("milliseconds")) @@ -200,7 +200,7 @@ void DevicePrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/LatencyCorrection"), DEFAULT_LATENCY_CORRECTION}, 9); - S.AddUnits(_("milliseconds")); + S.AddUnits(XO("milliseconds")); } S.EndThreeColumn(); } diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 81c81c986..6e56cbdc0 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -146,7 +146,7 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) { } ); - S.AddPrompt(_("Using: PortMidi")); + S.AddPrompt(XO("Using: PortMidi")); } S.EndMultiColumn(); } diff --git a/src/prefs/PlaybackPrefs.cpp b/src/prefs/PlaybackPrefs.cpp index b88e9fbef..06154b3cb 100644 --- a/src/prefs/PlaybackPrefs.cpp +++ b/src/prefs/PlaybackPrefs.cpp @@ -91,7 +91,7 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/EffectsPreviewLen"), 6.0}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } S.EndThreeColumn(); } @@ -107,14 +107,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/CutPreviewBeforeLen"), 2.0}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); S.NameSuffix(suffix) .TieNumericTextBox(XO("&After cut region:"), {wxT("/AudioIO/CutPreviewAfterLen"), 1.0}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } S.EndThreeColumn(); } @@ -129,14 +129,14 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/SeekShortPeriod"), 1.0}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); S.NameSuffix(suffix) .TieNumericTextBox(XO("Lo&ng period:"), {wxT("/AudioIO/SeekLongPeriod"), 15.0}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } S.EndThreeColumn(); } diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index 25fdf0676..9b3a6cd3a 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -142,7 +142,7 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(2); { - S.AddPrompt(_("Default Sample &Rate:")); + S.AddPrompt(XO("Default Sample &Rate:")); S.StartMultiColumn(2); { diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index d0f50c919..94cf37bd4 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -107,7 +107,7 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/SWPlaythrough"), false}); #if !defined(__WXMAC__) - //S.AddUnits(wxString(wxT(" ")) + _("(uncheck when recording computer playback)")); + //S.AddUnits(XO(" (uncheck when recording computer playback)")); #endif S.TieCheckBox(XO("Record on a new track"), @@ -223,13 +223,13 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) {wxT("/AudioIO/AnalysisTime"), AILA_DEF_ANALYSIS_TIME}, 9); - S.AddUnits(_("milliseconds (time of one analysis)")); + S.AddUnits(XO("milliseconds (time of one analysis)")); S.TieIntegerTextBox(XO("Number of consecutive analysis:"), {wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS}, 2); - S.AddUnits(_("0 means endless")); + S.AddUnits(XO("0 means endless")); } S.EndThreeColumn(); } @@ -247,7 +247,7 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) {AUDIO_PRE_ROLL_KEY, DEFAULT_PRE_ROLL_SECONDS}, 9); - S.AddUnits(_("seconds")); + S.AddUnits(XO("seconds")); } { auto w = S @@ -256,7 +256,7 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) {AUDIO_ROLL_CROSSFADE_KEY, DEFAULT_ROLL_CROSSFADE_MS}, 9); - S.AddUnits(_("milliseconds")); + S.AddUnits(XO("milliseconds")); } S.EndThreeColumn(); } diff --git a/src/tracks/labeltrack/ui/LabelTrackControls.cpp b/src/tracks/labeltrack/ui/LabelTrackControls.cpp index 5b70b66a2..a99c39851 100644 --- a/src/tracks/labeltrack/ui/LabelTrackControls.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackControls.cpp @@ -124,7 +124,7 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) S.SetStretchyCol(1); /* i18n-hint: (noun) The name of the typeface*/ - S.AddPrompt(_("Face name")); + S.AddPrompt(XO("Face name")); lb = safenew wxListBox(S.GetParent(), wxID_ANY, wxDefaultPosition, wxDefaultSize, @@ -138,7 +138,7 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) .AddWindow(lb); /* i18n-hint: (noun) The size of the typeface*/ - S.AddPrompt(_("Face size")); + S.AddPrompt(XO("Face size")); sc = safenew wxSpinCtrl(S.GetParent(), wxID_ANY, wxString::Format(wxT("%ld"), fontsize), wxDefaultPosition,