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

TranslatableString for prompts of radio buttons

This commit is contained in:
Paul Licameli 2019-12-23 18:02:44 -05:00
parent 455d3185a8
commit c23451af9d
9 changed files with 36 additions and 35 deletions

View File

@ -536,7 +536,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
/* i18n-hint: Radio button to show all effects */ /* i18n-hint: Radio button to show all effects */
.Name(XO("Show all")) .Name(XO("Show all"))
/* i18n-hint: Radio button to show all effects */ /* i18n-hint: Radio button to show all effects */
.AddRadioButton(_("&All")); .AddRadioButton(XO("&All"));
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control // so that name can be set on a standard control
rb->SetAccessible(safenew WindowAccessible(rb)); rb->SetAccessible(safenew WindowAccessible(rb));
@ -546,7 +546,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
/* i18n-hint: Radio button to show just the currently disabled effects */ /* i18n-hint: Radio button to show just the currently disabled effects */
.Name(XO("Show disabled")) .Name(XO("Show disabled"))
/* i18n-hint: Radio button to show just the currently disabled effects */ /* i18n-hint: Radio button to show just the currently disabled effects */
.AddRadioButtonToGroup(_("D&isabled")); .AddRadioButtonToGroup(XO("D&isabled"));
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control // so that name can be set on a standard control
rb->SetAccessible(safenew WindowAccessible(rb)); rb->SetAccessible(safenew WindowAccessible(rb));
@ -556,7 +556,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
/* i18n-hint: Radio button to show just the currently enabled effects */ /* i18n-hint: Radio button to show just the currently enabled effects */
.Name(XO("Show enabled")) .Name(XO("Show enabled"))
/* i18n-hint: Radio button to show just the currently enabled effects */ /* i18n-hint: Radio button to show just the currently enabled effects */
.AddRadioButtonToGroup(_("E&nabled")); .AddRadioButtonToGroup(XO("E&nabled"));
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control // so that name can be set on a standard control
rb->SetAccessible(safenew WindowAccessible(rb)); rb->SetAccessible(safenew WindowAccessible(rb));
@ -566,7 +566,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
/* i18n-hint: Radio button to show just the newly discovered effects */ /* i18n-hint: Radio button to show just the newly discovered effects */
.Name(XO("Show new")) .Name(XO("Show new"))
/* i18n-hint: Radio button to show just the newly discovered effects */ /* i18n-hint: Radio button to show just the newly discovered effects */
.AddRadioButtonToGroup(_("Ne&w")); .AddRadioButtonToGroup(XO("Ne&w"));
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control // so that name can be set on a standard control
rb->SetAccessible(safenew WindowAccessible(rb)); rb->SetAccessible(safenew WindowAccessible(rb));

View File

@ -514,17 +514,18 @@ wxComboBox * ShuttleGuiBase::AddCombo(
wxRadioButton * ShuttleGuiBase::DoAddRadioButton( wxRadioButton * ShuttleGuiBase::DoAddRadioButton(
const wxString &Prompt, int style, int selector, int initValue) const TranslatableString &Prompt, int style, int selector, int initValue)
{ {
const auto translated = Prompt.Translation();
/// \todo This function and the next two, suitably adapted, could be /// \todo This function and the next two, suitably adapted, could be
/// used by TieRadioButton. /// used by TieRadioButton.
UseUpId(); UseUpId();
if( mShuttleMode != eIsCreating ) if( mShuttleMode != eIsCreating )
return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton); return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
wxRadioButton * pRad; wxRadioButton * pRad;
mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt, mpWind = pRad = safenew wxRadioButton(GetParent(), miId, translated,
wxDefaultPosition, wxDefaultSize, GetStyle( style ) ); wxDefaultPosition, wxDefaultSize, GetStyle( style ) );
mpWind->SetName(wxStripMenuCodes(Prompt)); mpWind->SetName(wxStripMenuCodes(translated));
if ( style ) if ( style )
pRad->SetValue( true ); pRad->SetValue( true );
UpdateSizers(); UpdateSizers();
@ -533,13 +534,13 @@ wxRadioButton * ShuttleGuiBase::DoAddRadioButton(
} }
wxRadioButton * ShuttleGuiBase::AddRadioButton( wxRadioButton * ShuttleGuiBase::AddRadioButton(
const wxString &Prompt, int selector, int initValue) const TranslatableString &Prompt, int selector, int initValue)
{ {
return DoAddRadioButton( Prompt, wxRB_GROUP, selector, initValue ); return DoAddRadioButton( Prompt, wxRB_GROUP, selector, initValue );
} }
wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup( wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup(
const wxString &Prompt, int selector, int initValue) const TranslatableString &Prompt, int selector, int initValue)
{ {
return DoAddRadioButton( Prompt, 0, selector, initValue ); return DoAddRadioButton( Prompt, 0, selector, initValue );
} }

View File

@ -283,9 +283,9 @@ public:
// Spoken name of the button defaults to the same as the prompt // Spoken name of the button defaults to the same as the prompt
// (after stripping menu codes): // (after stripping menu codes):
wxRadioButton * AddRadioButton( wxRadioButton * AddRadioButton(
const wxString & Prompt, int selector = 0, int initValue = 0 ); const TranslatableString & Prompt, int selector = 0, int initValue = 0 );
wxRadioButton * AddRadioButtonToGroup( wxRadioButton * AddRadioButtonToGroup(
const wxString & Prompt, int selector = 1, int initValue = 0 ); const TranslatableString & Prompt, int selector = 1, int initValue = 0 );
// Only the last button specified as default (if more than one) will be // Only the last button specified as default (if more than one) will be
// Always ORs the flags with wxALL (which affects borders): // Always ORs the flags with wxALL (which affects borders):
@ -578,7 +578,7 @@ private:
int mRadioCount; /// The index of this radio item. -1 for none. int mRadioCount; /// The index of this radio item. -1 for none.
wxString mRadioValueString; /// Unwrapped string value. wxString mRadioValueString; /// Unwrapped string value.
wxRadioButton * DoAddRadioButton( wxRadioButton * DoAddRadioButton(
const wxString &Prompt, int style, int selector, int initValue); const TranslatableString &Prompt, int style, int selector, int initValue);
protected: protected:
DialogDefinition::Item mItem; DialogDefinition::Item mItem;

View File

@ -924,11 +924,11 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
{ {
mDraw = S.Id(ID_Draw) mDraw = S.Id(ID_Draw)
.Name(XO("Draw Curves")) .Name(XO("Draw Curves"))
.AddRadioButton(_("&Draw")); .AddRadioButton(XO("&Draw"));
mGraphic = S.Id(ID_Graphic) mGraphic = S.Id(ID_Graphic)
.Name(XO("Graphic EQ")) .Name(XO("Graphic EQ"))
.AddRadioButtonToGroup(_("&Graphic")); .AddRadioButtonToGroup(XO("&Graphic"));
} }
S.EndHorizontalLay(); S.EndHorizontalLay();
} }
@ -1081,25 +1081,25 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
: 0; : 0;
mMathProcessingType[0] = S.Id(ID_DefaultMath) mMathProcessingType[0] = S.Id(ID_DefaultMath)
.AddRadioButton(_("D&efault"), .AddRadioButton(XO("D&efault"),
0, value); 0, value);
mMathProcessingType[1] = S.Id(ID_SSE) mMathProcessingType[1] = S.Id(ID_SSE)
.Disable(!EffectEqualization48x::GetMathCaps()->SSE) .Disable(!EffectEqualization48x::GetMathCaps()->SSE)
.AddRadioButtonToGroup(_("&SSE"), .AddRadioButtonToGroup(XO("&SSE"),
1, value); 1, value);
mMathProcessingType[2] = S.Id(ID_SSEThreaded) mMathProcessingType[2] = S.Id(ID_SSEThreaded)
.Disable(!EffectEqualization48x::GetMathCaps()->SSE) .Disable(!EffectEqualization48x::GetMathCaps()->SSE)
.AddRadioButtonToGroup(_("SSE &Threaded"), .AddRadioButtonToGroup(XO("SSE &Threaded"),
2, value); 2, value);
mMathProcessingType[3] = S.Id(ID_AVX) mMathProcessingType[3] = S.Id(ID_AVX)
// not implemented // not implemented
.Disable(true /* !EffectEqualization48x::GetMathCaps()->AVX */) .Disable(true /* !EffectEqualization48x::GetMathCaps()->AVX */)
.AddRadioButtonToGroup(_("A&VX"), .AddRadioButtonToGroup(XO("A&VX"),
3, value); 3, value);
mMathProcessingType[4] = S.Id(ID_AVXThreaded) mMathProcessingType[4] = S.Id(ID_AVXThreaded)
// not implemented // not implemented
.Disable(true /* !EffectEqualization48x::GetMathCaps()->AVX */) .Disable(true /* !EffectEqualization48x::GetMathCaps()->AVX */)
.AddRadioButtonToGroup(_("AV&X Threaded"), .AddRadioButtonToGroup(XO("AV&X Threaded"),
4, value); 4, value);
S.Id(ID_Bench).AddButton(XO("&Bench")); S.Id(ID_Bench).AddButton(XO("&Bench"));
} }

View File

@ -1742,14 +1742,14 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S)
{ {
S.AddPrompt(_("Noise:")); S.AddPrompt(_("Noise:"));
mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL) mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL)
.AddRadioButton(_("Re&duce")); /* i18n-hint: Translate differently from "Residue" ! */ .AddRadioButton(XO("Re&duce")); /* i18n-hint: Translate differently from "Residue" ! */
#ifdef ISOLATE_CHOICE #ifdef ISOLATE_CHOICE
mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE) mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE)
.AddRadioButtonToGroup(_("&Isolate")); .AddRadioButtonToGroup(XO("&Isolate"));
#endif #endif
#ifdef RESIDUE_CHOICE #ifdef RESIDUE_CHOICE
mResidue = S.Id(ID_RADIOBUTTON_RESIDUE) mResidue = S.Id(ID_RADIOBUTTON_RESIDUE)
.AddRadioButtonToGroup(_("Resid&ue")); /* i18n-hint: Means the difference between effect and original sound. Translate differently from "Reduce" ! */ .AddRadioButtonToGroup(XO("Resid&ue")); /* i18n-hint: Means the difference between effect and original sound. Translate differently from "Reduce" ! */
#endif #endif
} }
S.EndMultiColumn(); S.EndMultiColumn();

View File

@ -758,9 +758,9 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S)
S.AddPrompt(_("Noise:")); S.AddPrompt(_("Noise:"));
mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL) mKeepSignal = S.Id(ID_RADIOBUTTON_KEEPSIGNAL)
.AddRadioButton(_("Re&move")); .AddRadioButton(XO("Re&move"));
mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE) mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE)
.AddRadioButtonToGroup(_("&Isolate")); .AddRadioButtonToGroup(XO("&Isolate"));
} }
S.EndMultiColumn(); S.EndMultiColumn();
} }

View File

@ -334,12 +334,12 @@ void ExportMultipleDialog::PopulateOrExchange(ShuttleGui& S)
// Row 1 // Row 1
S.SetBorder(1); S.SetBorder(1);
mTrack = S.Id(TrackID) mTrack = S.Id(TrackID)
.AddRadioButton(_("Tracks")); .AddRadioButton(XO("Tracks"));
// Row 2 // Row 2
S.SetBorder(1); S.SetBorder(1);
mLabel = S.Id(LabelID) mLabel = S.Id(LabelID)
.AddRadioButtonToGroup(_("Labels")); .AddRadioButtonToGroup(XO("Labels"));
S.SetBorder(3); S.SetBorder(3);
S.StartMultiColumn(2, wxEXPAND); S.StartMultiColumn(2, wxEXPAND);

View File

@ -355,10 +355,10 @@ static wxString AskCopyOrEdit()
S.SetBorder(0); S.SetBorder(0);
copyRadio = S.AddRadioButton( copyRadio = S.AddRadioButton(
_("Make a &copy of the files before editing (safer)") ); XO("Make a &copy of the files before editing (safer)") );
aliasRadio = S.AddRadioButtonToGroup( aliasRadio = S.AddRadioButtonToGroup(
_("Read the files &directly from the original (faster)") ); XO("Read the files &directly from the original (faster)") );
dontAskNextTimeBox = S.AddCheckBox( dontAskNextTimeBox = S.AddCheckBox(
_("Don't &warn again and always use my choice above"), _("Don't &warn again and always use my choice above"),

View File

@ -2024,8 +2024,8 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
{ {
S.StartVerticalLay(); S.StartVerticalLay();
{ {
gradient = S.AddRadioButton(_("Gradient"), true, mGradient); gradient = S.AddRadioButton(XO("Gradient"), true, mGradient);
rms = S.AddRadioButtonToGroup(_("RMS"), false, mGradient); rms = S.AddRadioButtonToGroup(XO("RMS"), false, mGradient);
} }
S.EndVerticalLay(); S.EndVerticalLay();
} }
@ -2035,8 +2035,8 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
{ {
S.StartVerticalLay(); S.StartVerticalLay();
{ {
db = S.AddRadioButton(_("dB"), true, mDB); db = S.AddRadioButton(XO("dB"), true, mDB);
linear = S.AddRadioButtonToGroup(_("Linear"), false, mDB); linear = S.AddRadioButtonToGroup(XO("Linear"), false, mDB);
} }
S.EndVerticalLay(); S.EndVerticalLay();
} }
@ -2047,11 +2047,11 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
S.StartVerticalLay(); S.StartVerticalLay();
{ {
automatic = S.AddRadioButton( automatic = S.AddRadioButton(
_("Automatic"), AutomaticStereo, mDesiredStyle); XO("Automatic"), AutomaticStereo, mDesiredStyle);
horizontal = S.AddRadioButtonToGroup( horizontal = S.AddRadioButtonToGroup(
_("Horizontal"), HorizontalStereo, mDesiredStyle); XO("Horizontal"), HorizontalStereo, mDesiredStyle);
vertical = S.AddRadioButtonToGroup( vertical = S.AddRadioButtonToGroup(
_("Vertical"), VerticalStereo, mDesiredStyle); XO("Vertical"), VerticalStereo, mDesiredStyle);
} }
S.EndVerticalLay(); S.EndVerticalLay();
} }