From ca70cc940f1911f25cc811ce790e516fcefa1754 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 4 Dec 2019 15:56:48 -0500 Subject: [PATCH] Don't concatenate ":" onto user-visible strings... ... include it in the msgid intead, to get appropriate translations. For instance some locales use the same character but prefer to insert a space before it. --- src/effects/NoiseReduction.cpp | 8 ++++---- src/effects/Reverb.cpp | 13 +++++-------- src/effects/ladspa/LadspaEffect.cpp | 4 ++-- src/effects/lv2/LV2Effect.cpp | 2 +- src/effects/nyquist/Nyquist.cpp | 2 +- src/effects/vamp/VampEffect.cpp | 4 +++- src/menus/PluginMenus.cpp | 11 +++++------ src/prefs/SpectrumPrefs.cpp | 6 +++--- src/prefs/WaveformPrefs.cpp | 4 ++-- .../wavetrack/ui/WaveTrackControls.cpp | 3 ++- 10 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index fcc4a6d15..d666d8ca5 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1752,7 +1752,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn(2); { - S.TieChoice(_("&Window types") + wxString(wxT(":")), + S.TieChoice(_("&Window types:"), mTempSettings.mWindowTypes, []{ wxArrayStringEx windowTypeChoices; @@ -1762,7 +1762,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) }() ); - S.TieChoice(_("Window si&ze") + wxString(wxT(":")), + S.TieChoice(_("Window si&ze:")), mTempSettings.mWindowSizeChoice, { _("8") , @@ -1780,7 +1780,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) } ); - S.TieChoice(_("S&teps per window") + wxString(wxT(":")), + S.TieChoice(_("S&teps per window:"), mTempSettings.mStepsPerWindowChoice, { _("2") , @@ -1793,7 +1793,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) ); S.Id(ID_CHOICE_METHOD) - .TieChoice(_("Discrimination &method") + wxString(wxT(":")), + .TieChoice(_("Discrimination &method:"), mTempSettings.mMethod, []{ wxArrayStringEx methodChoices; diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index c992466ea..313e3b4ec 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -543,12 +543,9 @@ SpinSliderHandlers(StereoWidth) void EffectReverb::SetTitle(const wxString & name) { - wxString title(_("Reverb")); - - if (!name.empty()) - { - title += wxT(": ") + name; - } - - mUIDialog->SetTitle(title); + mUIDialog->SetTitle( + name.empty() + ? _("Reverb") + : wxString::Format( _("Reverb: %s"), name ) + ); } diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 0cc1a4177..d217464d8 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -1266,7 +1266,7 @@ bool LadspaEffect::PopulateUI(wxWindow *parent) } wxString labelText = LAT1CTOWX(mData->PortNames[p]); - item = safenew wxStaticText(w, 0, labelText + wxT(":")); + item = safenew wxStaticText(w, 0, wxString::Format(_("%s:"), labelText)); gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5); wxString fieldText; @@ -1442,7 +1442,7 @@ bool LadspaEffect::PopulateUI(wxWindow *parent) } wxString labelText = LAT1CTOWX(mData->PortNames[p]); - item = safenew wxStaticText(w, 0, labelText + wxT(":")); + item = safenew wxStaticText(w, 0, wxString::Format(_("%s:"), labelText)); gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5); //LADSPA_PortRangeHint hint = mData->PortRangeHints[p]; diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index decce5839..023498d49 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -1632,7 +1632,7 @@ bool LV2Effect::BuildPlain() continue; } - wxWindow *item = safenew wxStaticText(w, wxID_ANY, labelText + wxT(":"), + wxWindow *item = safenew wxStaticText(w, wxID_ANY, wxString::Format(_("%s:"), labelText), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index f13cdf263..8003746db 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2627,7 +2627,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) } else { - wxString prompt = ctrl.name + wxT(":"); + auto prompt = wxString::Format(_("%s:"), ctrl.name); S.AddPrompt(prompt); if (ctrl.type == NYQ_CTRL_STRING) diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index c1cb7f3e3..08bcf3eaf 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -597,7 +597,9 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) { labelText += wxT(" (") + unit + wxT(")"); } - S.AddPrompt(labelText + wxT(":")); + /* 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)); if (mParameters[p].isQuantized && mParameters[p].quantizeStep == 1.0 && diff --git a/src/menus/PluginMenus.cpp b/src/menus/PluginMenus.cpp index 9b1c791d9..6c99b4ecc 100644 --- a/src/menus/PluginMenus.cpp +++ b/src/menus/PluginMenus.cpp @@ -334,12 +334,11 @@ void AddEffectMenuItems( group = wxEmptyString; } - if (!group.empty()) - { - group += wxT(": "); - } - - groupNames.push_back(group + name); + groupNames.push_back( + group.empty() + ? name + : wxString::Format(_("%s: %s"), group, name) + ); vHasDialog.push_back(hasDialog); groupPlugs.push_back(plug->GetID()); groupFlags.push_back( diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 51dae7154..e75aa144f 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -188,7 +188,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetStretchyCol( 0 ); S.SetStretchyCol( 1 ); - S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), + S.Id(ID_SCALE).TieChoice(_("S&cale:"), mTempSettings.scaleType, SpectrogramSettings::GetScaleNames()); mMinFreq = @@ -238,7 +238,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(2); { mAlgorithmChoice = - S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm") + wxString(wxT(":")), + S.Id(ID_ALGORITHM).TieChoice(_("A&lgorithm:"), mTempSettings.algorithm, SpectrogramSettings::GetAlgorithmNames()); @@ -267,7 +267,7 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS mZeroPaddingChoiceCtrl = - S.Id(ID_PADDING_SIZE).TieChoice(_("&Zero padding factor") + wxString(wxT(":")), + S.Id(ID_PADDING_SIZE).TieChoice(_("&Zero padding factor:"), mTempSettings.zeroPaddingFactor, mZeroPaddingChoices); #endif diff --git a/src/prefs/WaveformPrefs.cpp b/src/prefs/WaveformPrefs.cpp index e70df6c19..0f7811c99 100644 --- a/src/prefs/WaveformPrefs.cpp +++ b/src/prefs/WaveformPrefs.cpp @@ -108,12 +108,12 @@ void WaveformPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { mScaleChoice = - S.Id(ID_SCALE).TieChoice(_("S&cale") + wxString(wxT(":")), + S.Id(ID_SCALE).TieChoice(_("S&cale:"), mTempSettings.scaleType, WaveformSettings::GetScaleNames()); mRangeChoice = - S.Id(ID_RANGE).TieChoice(_("Waveform dB &range") + wxString(wxT(":")), + S.Id(ID_RANGE).TieChoice(_("Waveform dB &range:"), mTempSettings.dBRange, mRangeChoices); } diff --git a/src/tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp b/src/tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp index ebd597d6d..733742122 100644 --- a/src/tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp +++ b/src/tracks/playabletrack/wavetrack/ui/WaveTrackControls.cpp @@ -819,7 +819,8 @@ void WaveTrackMenuTable::OnSpectrogramSettings(wxCommandEvent &) // (pTrack->GetDisplay() == WaveTrack::Spectrum) ? 1 : 0; - wxString title(pTrack->GetName() + wxT(": ")); + /* i18n-hint: An item name followed by a value, with appropriate separating punctuation */ + auto title = wxString::Format(_("%s: %s"), pTrack->GetName(), wxT("")); ViewSettingsDialog dialog(mpData->pParent, title, factories, page); if (0 != dialog.ShowModal()) {