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

TranslatableString for title prefix in PrefsDialog...

... and the title strings do not include a trailing space
This commit is contained in:
Paul Licameli 2019-12-19 22:09:20 -05:00
parent 91ebadef81
commit a70524446e
4 changed files with 15 additions and 13 deletions

View File

@ -417,14 +417,14 @@ class wxTreebookExt final : public wxTreebook
{
public:
wxTreebookExt( wxWindow *parent,
wxWindowID id, const wxString &titlePrefix)
wxWindowID id, const TranslatableString &titlePrefix)
: wxTreebook( parent, id )
, mTitlePrefix(titlePrefix)
{;};
~wxTreebookExt(){;};
int ChangeSelection(size_t n) override;
int SetSelection(size_t n) override;
const wxString mTitlePrefix;
const TranslatableString mTitlePrefix;
};
@ -439,7 +439,7 @@ int wxTreebookExt::ChangeSelection(size_t n) {
int wxTreebookExt::SetSelection(size_t n)
{
int i = wxTreebook::SetSelection(n);
wxString Temp = wxString(mTitlePrefix) + GetPageText( n );
auto Temp = mTitlePrefix.Translation() + wxT(" ") + GetPageText( n );
static_cast<wxDialog*>(GetParent())->SetTitle( Temp );
static_cast<wxDialog*>(GetParent())->SetName( Temp );
@ -532,8 +532,9 @@ PrefsDialog::Factories
}
PrefsDialog::PrefsDialog
(wxWindow * parent, const wxString &titlePrefix, Factories &factories)
PrefsDialog::PrefsDialog(
wxWindow * parent,
const TranslatableString &titlePrefix, Factories &factories)
: wxDialogWrapper(parent, wxID_ANY, XO("Audacity Preferences"),
wxDefaultPosition,
wxDefaultSize,
@ -694,7 +695,8 @@ int PrefsDialog::ShowModal()
mCategories->SetSelection(selected);
}
else {
auto Temp = TranslatableString{ mTitlePrefix + mUniquePage->GetLabel() };
auto Temp = mTitlePrefix;
Temp.Join( TranslatableString{ mUniquePage->GetLabel() }, wxT(" ") );
SetTitle(Temp);
SetName(Temp);
}
@ -887,7 +889,7 @@ int PrefsDialog::GetSelectedPage() const
}
GlobalPrefsDialog::GlobalPrefsDialog(wxWindow * parent, Factories &factories)
: PrefsDialog(parent, _("Preferences: "), factories)
: PrefsDialog(parent, XO("Preferences:"), factories)
{
}

View File

@ -48,7 +48,7 @@ class PrefsDialog /* not final */ : public wxDialogWrapper
static Factories &DefaultFactories();
PrefsDialog(wxWindow * parent,
const wxString &titlePrefix = _("Preferences: "),
const TranslatableString &titlePrefix = XO("Preferences:"),
Factories &factories = DefaultFactories());
virtual ~PrefsDialog();
@ -82,7 +82,7 @@ private:
wxTreebook *mCategories{};
PrefsPanel *mUniquePage{};
Factories &mFactories;
const wxString mTitlePrefix;
const TranslatableString mTitlePrefix;
DECLARE_EVENT_TABLE()
};

View File

@ -779,8 +779,8 @@ void WaveTrackMenuTable::OnSpectrogramSettings(wxCommandEvent &)
class ViewSettingsDialog final : public PrefsDialog
{
public:
ViewSettingsDialog
(wxWindow *parent, const wxString &title, PrefsDialog::Factories &factories,
ViewSettingsDialog(wxWindow *parent,
const TranslatableString &title, PrefsDialog::Factories &factories,
int page)
: PrefsDialog(parent, title, factories)
, mPage(page)
@ -817,8 +817,7 @@ void WaveTrackMenuTable::OnSpectrogramSettings(wxCommandEvent &)
// (pTrack->GetDisplay() == WaveTrack::Spectrum) ? 1 :
0;
/* i18n-hint: An item name followed by a value, with appropriate separating punctuation */
auto title = wxString::Format(_("%s: %s"), pTrack->GetName(), wxT(""));
auto title = XO("%s:").Format( pTrack->GetName() );
ViewSettingsDialog dialog(mpData->pParent, title, factories, page);
if (0 != dialog.ShowModal()) {

View File

@ -982,6 +982,7 @@ wxString LWSlider::GetTip(float value) const
#endif
}
/* i18n-hint: An item name followed by a value, with appropriate separating punctuation */
label = XO("%s: %s").Format( mName, val ).Translation();
}
else