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 */
.Name(XO("Show all"))
/* i18n-hint: Radio button to show all effects */
.AddRadioButton(_("&All"));
.AddRadioButton(XO("&All"));
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
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 */
.Name(XO("Show disabled"))
/* i18n-hint: Radio button to show just the currently disabled effects */
.AddRadioButtonToGroup(_("D&isabled"));
.AddRadioButtonToGroup(XO("D&isabled"));
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
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 */
.Name(XO("Show enabled"))
/* i18n-hint: Radio button to show just the currently enabled effects */
.AddRadioButtonToGroup(_("E&nabled"));
.AddRadioButtonToGroup(XO("E&nabled"));
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
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 */
.Name(XO("Show new"))
/* i18n-hint: Radio button to show just the newly discovered effects */
.AddRadioButtonToGroup(_("Ne&w"));
.AddRadioButtonToGroup(XO("Ne&w"));
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
rb->SetAccessible(safenew WindowAccessible(rb));

View File

@ -514,17 +514,18 @@ wxComboBox * ShuttleGuiBase::AddCombo(
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
/// used by TieRadioButton.
UseUpId();
if( mShuttleMode != eIsCreating )
return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxRadioButton);
wxRadioButton * pRad;
mpWind = pRad = safenew wxRadioButton(GetParent(), miId, Prompt,
mpWind = pRad = safenew wxRadioButton(GetParent(), miId, translated,
wxDefaultPosition, wxDefaultSize, GetStyle( style ) );
mpWind->SetName(wxStripMenuCodes(Prompt));
mpWind->SetName(wxStripMenuCodes(translated));
if ( style )
pRad->SetValue( true );
UpdateSizers();
@ -533,13 +534,13 @@ wxRadioButton * ShuttleGuiBase::DoAddRadioButton(
}
wxRadioButton * ShuttleGuiBase::AddRadioButton(
const wxString &Prompt, int selector, int initValue)
const TranslatableString &Prompt, int selector, int initValue)
{
return DoAddRadioButton( Prompt, wxRB_GROUP, selector, initValue );
}
wxRadioButton * ShuttleGuiBase::AddRadioButtonToGroup(
const wxString &Prompt, int selector, int initValue)
const TranslatableString &Prompt, int selector, int 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
// (after stripping menu codes):
wxRadioButton * AddRadioButton(
const wxString & Prompt, int selector = 0, int initValue = 0 );
const TranslatableString & Prompt, int selector = 0, int initValue = 0 );
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
// 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.
wxString mRadioValueString; /// Unwrapped string value.
wxRadioButton * DoAddRadioButton(
const wxString &Prompt, int style, int selector, int initValue);
const TranslatableString &Prompt, int style, int selector, int initValue);
protected:
DialogDefinition::Item mItem;

View File

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

View File

@ -1742,14 +1742,14 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S)
{
S.AddPrompt(_("Noise:"));
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
mKeepNoise = S.Id(ID_RADIOBUTTON_KEEPNOISE)
.AddRadioButtonToGroup(_("&Isolate"));
.AddRadioButtonToGroup(XO("&Isolate"));
#endif
#ifdef RESIDUE_CHOICE
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
}
S.EndMultiColumn();

View File

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

View File

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

View File

@ -355,10 +355,10 @@ static wxString AskCopyOrEdit()
S.SetBorder(0);
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(
_("Read the files &directly from the original (faster)") );
XO("Read the files &directly from the original (faster)") );
dontAskNextTimeBox = S.AddCheckBox(
_("Don't &warn again and always use my choice above"),

View File

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