TranslatableString for titles, names, labels of wxDialogWrappers...

... Found one missed translation in CommandTargets.cpp
This commit is contained in:
Paul Licameli 2019-12-08 00:25:47 -05:00
parent fbebef2911
commit 53ee9c9800
90 changed files with 275 additions and 254 deletions

View File

@ -272,14 +272,14 @@ AboutDialog *AboutDialog::ActiveIntance()
}
AboutDialog::AboutDialog(wxWindow * parent)
: wxDialogWrapper(parent, -1, _("About Audacity"),
: wxDialogWrapper(parent, -1, XO("About Audacity"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxASSERT(!sActiveInstance);
sActiveInstance = this;
SetName(GetTitle());
SetName();
this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground ));
//this->SetBackgroundColour(theTheme.Colour( clrMedium ));
icon = NULL;

View File

@ -1064,7 +1064,7 @@ locations of the missing files."), missingFileName);
if ( auto dialog = MissingAliasFilesDialog::Find( *offendingProject ) )
dialog->Raise();
else {
MissingAliasFilesDialog::Show(offendingProject.get(), _("Files Missing"),
MissingAliasFilesDialog::Show(offendingProject.get(), XO("Files Missing"),
errorMessage, wxT(""), true);
}
}

View File

@ -1431,7 +1431,7 @@ void AudioIO::StartMonitoring( const AudioIOStartStreamOptions &options )
if (!success) {
wxString msg = wxString::Format(_("Error opening recording device.\nError code: %s"), Get()->LastPaErrorString());
ShowErrorDialog( FindProjectFrame( mOwningProject ),
_("Error"), msg, wxT("Error_opening_sound_device"));
XO("Error"), msg, wxT("Error_opening_sound_device"));
return;
}

View File

@ -48,11 +48,11 @@ public:
};
AutoRecoveryDialog::AutoRecoveryDialog(wxWindow *parent) :
wxDialogWrapper(parent, -1, _("Automatic Crash Recovery"),
wxDialogWrapper(parent, -1, XO("Automatic Crash Recovery"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE & (~wxCLOSE_BOX)) // no close box
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
PopulateOrExchange(S);
}

View File

@ -62,13 +62,13 @@ BEGIN_EVENT_TABLE(MacroCommandDialog, wxDialogWrapper)
END_EVENT_TABLE();
MacroCommandDialog::MacroCommandDialog(wxWindow * parent, wxWindowID id):
wxDialogWrapper(parent, id, _("Select Command"),
wxDialogWrapper(parent, id, XO("Select Command"),
wxDefaultPosition, wxDefaultSize,
wxCAPTION | wxRESIZE_BORDER)
, mCatalog( GetActiveProject() )
{
SetLabel(_("Select Command")); // Provide visual label
SetName(_("Select Command")); // Provide audible label
SetLabel(XO("Select Command")); // Provide visual label
SetName(XO("Select Command")); // Provide audible label
Populate();
}

View File

@ -81,7 +81,7 @@ BEGIN_EVENT_TABLE(ApplyMacroDialog, wxDialogWrapper)
END_EVENT_TABLE()
ApplyMacroDialog::ApplyMacroDialog(wxWindow * parent, bool bInherited):
wxDialogWrapper(parent, wxID_ANY, _("Macros Palette"),
wxDialogWrapper(parent, wxID_ANY, XO("Macros Palette"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, mCatalog( GetActiveProject() )
@ -91,8 +91,8 @@ ApplyMacroDialog::ApplyMacroDialog(wxWindow * parent, bool bInherited):
mbExpanded = false;
if( bInherited )
return;
SetLabel(_("Macros Palette")); // Provide visual label
SetName(_("Macros Palette")); // Provide audible label
SetLabel(XO("Macros Palette")); // Provide visual label
SetName(XO("Macros Palette")); // Provide audible label
Populate();
}
@ -260,7 +260,7 @@ void ApplyMacroDialog::ApplyMacroToProject( int iMacro, bool bHasGui )
#ifdef OPTIONAL_ACTIVITY_WINDOW
wxDialogWrapper activityWin( this, wxID_ANY, GetTitle());
activityWin.SetName(activityWin.GetTitle());
activityWin.SetName();
ShuttleGui S(&activityWin, eIsCreating);
S.StartHorizontalLay(wxCENTER, false);
@ -397,8 +397,8 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
files.Sort();
wxDialogWrapper activityWin(this, wxID_ANY, GetTitle());
activityWin.SetName(activityWin.GetTitle());
wxDialogWrapper activityWin(this, wxID_ANY, TranslatableString{ GetTitle() });
activityWin.SetName();
ShuttleGui S(&activityWin, eIsCreating);
wxListCtrl * fileList = NULL;
@ -558,7 +558,7 @@ MacrosWindow::MacrosWindow(wxWindow * parent, bool bExpanded):
ApplyMacroDialog(parent, true)
{
mbExpanded = bExpanded;
wxString Title = mbExpanded ? _("Manage Macros") : _("Macros Palette");
auto Title = mbExpanded ? XO("Manage Macros") : XO("Macros Palette");
SetLabel( Title ); // Provide visual label
SetName( Title ); // Provide audible label
SetTitle( Title );
@ -794,7 +794,7 @@ void MacrosWindow::UpdateDisplay( bool bExpanded )
SetPosition( p );
mResize->SetFocus();
wxString Title = mbExpanded ? _("Manage Macros") : _("Macros Palette");
auto Title = mbExpanded ? XO("Manage Macros") : XO("Macros Palette");
SetLabel( Title ); // Provide visual label
SetName( Title ); // Provide audible label
SetTitle( Title );

View File

@ -130,12 +130,12 @@ END_EVENT_TABLE()
BenchmarkDialog::BenchmarkDialog(wxWindow *parent):
/* i18n-hint: Benchmark means a software speed test */
wxDialogWrapper( parent, 0, _("Benchmark"),
wxDialogWrapper( parent, 0, XO("Benchmark"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE |
wxRESIZE_BORDER)
{
SetName(GetTitle());
SetName();
mBlockSizeStr = wxT("64");
mNumEditsStr = wxT("100");

View File

@ -311,7 +311,7 @@ DependencyDialog::DependencyDialog(wxWindow *parent,
AudacityProject *project,
AliasedFileArray &aliasedFiles,
bool isSaving)
: wxDialogWrapper(parent, id, _("Project Depends on Other Audio Files"),
: wxDialogWrapper(parent, id, XO("Project Depends on Other Audio Files"),
wxDefaultPosition, wxDefaultSize,
(isSaving ?
(wxDEFAULT_DIALOG_STYLE & ~wxCLOSE_BOX) : // no close box when saving
@ -328,7 +328,7 @@ DependencyDialog::DependencyDialog(wxWindow *parent,
mCopyAllFilesButton(NULL),
mFutureActionChoice(NULL)
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
PopulateOrExchange(S);
}

View File

@ -449,9 +449,9 @@ class FindFFmpegDialog final : public wxDialogWrapper
public:
FindFFmpegDialog(wxWindow *parent, const wxString &path, const wxString &name, const wxString &type)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Locate FFmpeg")))
: wxDialogWrapper(parent, wxID_ANY, XO("Locate FFmpeg"))
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
mPath = path;
@ -563,9 +563,9 @@ END_EVENT_TABLE()
//----------------------------------------------------------------------------
FFmpegNotFoundDialog::FFmpegNotFoundDialog(wxWindow *parent)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("FFmpeg not found")))
: wxDialogWrapper(parent, wxID_ANY, XO("FFmpeg not found"))
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
PopulateOrExchange(S);
}

View File

@ -197,13 +197,13 @@ SpectrumAnalyst::~SpectrumAnalyst()
}
FrequencyPlotDialog::FrequencyPlotDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
const wxPoint & pos)
: wxDialogWrapper(parent, id, title, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX),
mAnalyst(std::make_unique<SpectrumAnalyst>())
{
SetName(GetTitle());
SetName();
mMouseX = 0;
mMouseY = 0;

View File

@ -117,7 +117,7 @@ class FrequencyPlotDialog final : public wxDialogWrapper
{
public:
FrequencyPlotDialog(wxWindow *parent, wxWindowID id,
const wxString & title, const wxPoint & pos);
const TranslatableString & title, const wxPoint & pos);
virtual ~ FrequencyPlotDialog();
bool Show( bool show = true ) override;

View File

@ -138,68 +138,69 @@ static wxString LinkExpand( const wxString & Text )
return Temp;
}
wxString TitleText( const wxString & Key )
TranslatableString TitleText( const wxString & Key )
{
if(Key==wxT("welcome"))
{
return _("Welcome!");
return XO("Welcome!");
}
if(Key ==wxT("play") )
{
/* i18n-hint: Title for a topic.*/
return _("Playing Audio");
return XO("Playing Audio");
}
if((Key ==wxT("record") ) || (Key ==wxT("norecord") ))
{
/* i18n-hint: Title for a topic.*/
return _("Recording Audio");
return XO("Recording Audio");
}
if(Key ==wxT("inputdevice") )
{
/* i18n-hint: Title for a topic.*/
return _("Recording - Choosing the Recording Device");
return XO("Recording - Choosing the Recording Device");
}
if(Key ==wxT("inputsource") )
{
/* i18n-hint: Title for a topic.*/
return _("Recording - Choosing the Recording Source");
return XO("Recording - Choosing the Recording Source");
}
if(Key ==wxT("inputlevel") )
{
/* i18n-hint: Title for a topic.*/
return _("Recording - Setting the Recording Level");
return XO("Recording - Setting the Recording Level");
}
if((Key ==wxT("edit") ) || (Key==wxT("grey")))
{
/* i18n-hint: Title for a topic.*/
return _("Editing and greyed out Menus");
return XO("Editing and greyed out Menus");
}
if(Key ==wxT("export") )
{
/* i18n-hint: Title for a topic.*/
return _("Exporting an Audio File");
return XO("Exporting an Audio File");
}
if(Key ==wxT("save") )
{
/* i18n-hint: Title for a topic.*/
return _("Saving an Audacity Project");
return XO("Saving an Audacity Project");
}
if(Key ==wxT("wma-proprietary") )
{
/* i18n-hint: Title for a topic.*/
return _("Support for Other Formats");
return XO("Support for Other Formats");
}
if(Key ==wxT("burncd") )
{
/* i18n-hint: Title for a topic.*/
return _("Burn to CD" );
return XO("Burn to CD" );
}
if(Key == wxT("remotehelp") )
{
return _("No Local Help");
return XO("No Local Help");
}
return Key;
// Uh oh, no translation...
return TranslatableString{ Key };
}
static wxString HelpTextBuiltIn( const wxString & Key )

View File

@ -11,10 +11,11 @@
#ifndef __AUDACITY_HELP_TEXT__
#define __AUDACITY_HELP_TEXT__
class TranslatableString;
class wxString;
wxString HelpText( const wxString & Key );
wxString TitleText( const wxString & Key );
TranslatableString TitleText( const wxString & Key );
extern const wxString VerCheckArgs();
extern const wxString VerCheckUrl();

View File

@ -59,11 +59,11 @@ BEGIN_EVENT_TABLE(HistoryDialog, wxDialogWrapper)
END_EVENT_TABLE()
HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
wxDialogWrapper(FindProjectFrame( parent ), wxID_ANY, wxString(_("History")),
wxDialogWrapper(FindProjectFrame( parent ), wxID_ANY, XO("History"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
SetName(GetTitle());
SetName();
mManager = manager;
mProject = parent;

View File

@ -105,7 +105,7 @@ LabelDialog::LabelDialog(wxWindow *parent,
const NumericFormatSymbol &freqFormat)
: wxDialogWrapper(parent,
wxID_ANY,
_("Edit Labels"),
XO("Edit Labels"),
wxDefaultPosition,
wxSize(800, 600),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
@ -118,7 +118,7 @@ LabelDialog::LabelDialog(wxWindow *parent,
mFormat(format)
, mFreqFormat(freqFormat)
{
SetName(GetTitle());
SetName();
Populate();
}

View File

@ -34,7 +34,7 @@ class LangChoiceDialog final : public wxDialogWrapper {
public:
LangChoiceDialog(wxWindow * parent,
wxWindowID id,
const wxString & title);
const TranslatableString & title);
wxString GetLang() { return mLang; }
@ -57,7 +57,7 @@ wxString ChooseLanguage(wxWindow *parent)
/* i18n-hint: Title on a dialog indicating that this is the first
* time Audacity has been run. */
LangChoiceDialog dlog(parent, -1, _("Audacity First Run"));
LangChoiceDialog dlog(parent, -1, XO("Audacity First Run"));
dlog.CentreOnParent();
dlog.ShowModal();
returnVal = dlog.GetLang();
@ -71,10 +71,10 @@ END_EVENT_TABLE()
LangChoiceDialog::LangChoiceDialog(wxWindow * parent,
wxWindowID id,
const wxString & title):
const TranslatableString & title):
wxDialogWrapper(parent, id, title)
{
SetName(GetTitle());
SetName();
GetLanguages(mLangCodes, mLangNames);
int lang =
make_iterator_range( mLangCodes ).index( GetSystemLanguageCode() );

View File

@ -733,13 +733,10 @@ void MenuManager::TellUserWhyDisallowed(
)
return;
// Message is already translated but title is not yet
auto title = untranslatedTitle.Translation();
// Does not have the warning icon...
ShowErrorDialog(
NULL,
title,
untranslatedTitle,
reason.Translation(),
helpPage);
}

View File

@ -25,7 +25,7 @@ class MissingAliasFileDialog final : public ErrorDialog
{
public:
MissingAliasFileDialog(wxWindow *parent,
const wxString & dlogTitle,
const TranslatableString & dlogTitle,
const wxString & message,
const wxString & helpURL,
const bool Close = true, const bool modal = true);
@ -34,7 +34,7 @@ class MissingAliasFileDialog final : public ErrorDialog
MissingAliasFileDialog::MissingAliasFileDialog(wxWindow *parent,
const wxString & dlogTitle,
const TranslatableString & dlogTitle,
const wxString & message,
const wxString & helpURL,
const bool Close, const bool modal)
@ -65,7 +65,7 @@ namespace MissingAliasFilesDialog {
using Lock = std::unique_lock< std::mutex >;
void Show(AudacityProject *project,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
const bool Close)

View File

@ -3,6 +3,7 @@
class AliasBlockFile;
class AudacityProject;
class TranslatableString;
class wxDialog;
#include <memory>
@ -32,7 +33,7 @@ bool ShouldShow();
/// Displays a custom modeless error dialog for aliased file errors
void Show(AudacityProject *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
const bool Close = true);

View File

@ -73,7 +73,7 @@ END_EVENT_TABLE()
MixerTrackSlider::MixerTrackSlider(wxWindow * parent,
wxWindowID id,
const wxString &name,
const TranslatableString &name,
const wxPoint & pos,
const wxSize & size,
const ASlider::Options &options)
@ -208,7 +208,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
safenew MixerTrackSlider(
this, ID_SLIDER_GAIN,
/* i18n-hint: title of the Gain slider, used to adjust the volume */
_("Gain"),
XO("Gain"),
ctrlPos, ctrlSize,
ASlider::Options{}
.Style( DB_SLIDER )
@ -220,7 +220,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
safenew MixerTrackSlider(
this, ID_SLIDER_VELOCITY,
/* i18n-hint: title of the MIDI Velocity slider */
_("Velocity"),
XO("Velocity"),
ctrlPos, ctrlSize,
ASlider::Options{}
.Style( VEL_SLIDER )
@ -256,7 +256,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
safenew MixerTrackSlider(
this, ID_SLIDER_PAN,
/* i18n-hint: Title of the Pan slider, used to move the sound left or right */
_("Pan"),
XO("Pan"),
ctrlPos, ctrlSize,
ASlider::Options{}.Style( PAN_SLIDER ));
mSlider_Pan->SetName(_("Pan"));

View File

@ -40,7 +40,7 @@ class MixerTrackSlider final : public ASlider
public:
MixerTrackSlider(wxWindow * parent,
wxWindowID id,
const wxString &name,
const TranslatableString &name,
const wxPoint & pos,
const wxSize & size,
const ASlider::Options &options = ASlider::Options{});

View File

@ -268,7 +268,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
msg += _("\n\nOnly use modules from trusted sources");
const wxChar *buttons[] = {_("Yes"), _("No"), NULL}; // could add a button here for 'yes and remember that', and put it into the cfg file. Needs more thought.
int action;
action = ShowMultiDialog(msg, _("Audacity Module Loader"), buttons, _("Try and load this module?"), false);
action = ShowMultiDialog(msg, XO("Audacity Module Loader"), buttons, _("Try and load this module?"), false);
#ifdef EXPERIMENTAL_MODULE_PREFS
// If we're not prompting always, accept the answer permanantly
if( iModuleStatus == kModuleNew ){

View File

@ -475,13 +475,13 @@ END_EVENT_TABLE()
PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType type)
: wxDialogWrapper(parent,
wxID_ANY,
_("Manage Plug-ins"),
XO("Manage Plug-ins"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
mType = type;
mEffects = NULL;
SetName(GetTitle());
SetName();
mStates.resize(STATE_COUNT);
mStates[STATE_Enabled] = _("Enabled");

View File

@ -258,7 +258,7 @@ int ProjectAudioManager::PlayPlayRegion(const SelectedRegion &selectedRegion,
auto &window = GetProjectFrame( mProject );
window.CallAfter( [&]{
// Show error message if stream could not be opened
ShowErrorDialog(&window, _("Error"),
ShowErrorDialog(&window, XO("Error"),
_("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
wxT("Error_opening_sound_device"));
});
@ -713,7 +713,7 @@ bool ProjectAudioManager::DoRecord(AudacityProject &project,
// Show error message if stream could not be opened
wxString msg = wxString::Format(_("Error opening recording device.\nError code: %s"), gAudioIO->LastPaErrorString());
ShowErrorDialog(&GetProjectFrame( mProject ),
_("Error"), msg, wxT("Error_opening_sound_device"));
XO("Error"), msg, wxT("Error_opening_sound_device"));
}
}

View File

@ -61,7 +61,7 @@ int ProjectFSCK(
_("Continue with repairs noted in log, and check for more errors. This will save the project in its current state, unless you \"Close project immediately\" on further error alerts."),
NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Problems Reading Sequence Tags"), buttons);
action = ShowMultiDialog(msg, XO("Warning - Problems Reading Sequence Tags"), buttons);
if (action == 0)
nResult = FSCKstatus_CLOSE_REQ;
else
@ -116,7 +116,7 @@ _("Project check of \"%s\" folder \
_("Replace missing audio with silence (permanent immediately)."),
NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Missing Aliased File(s)"), buttons);
action = ShowMultiDialog(msg, XO("Warning - Missing Aliased File(s)"), buttons);
}
if (action == 0)
@ -193,7 +193,7 @@ _("Project check of \"%s\" folder \
_("Close project immediately with no further changes"),
NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Missing Alias Summary File(s)"), buttons);
action = ShowMultiDialog(msg, XO("Warning - Missing Alias Summary File(s)"), buttons);
}
if (action == 2)
@ -266,7 +266,7 @@ _("Project check of \"%s\" folder \
_("Replace missing audio with silence (permanent immediately)"),
NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Missing Audio Data Block File(s)"), buttons);
action = ShowMultiDialog(msg, XO("Warning - Missing Audio Data Block File(s)"), buttons);
}
if (action == 0)
@ -339,7 +339,7 @@ other projects. \
_("Delete orphan files (permanent immediately)"),
NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Orphan Block File(s)"), buttons);
action = ShowMultiDialog(msg, XO("Warning - Orphan Block File(s)"), buttons);
}
if (action == 1)

View File

@ -1540,7 +1540,7 @@ void ProjectFileManager::OpenFile(const FilePath &fileNameArg, bool addtohistory
ShowErrorDialog(
&window,
_("Error Opening Project"),
XO("Error Opening Project"),
errorStr,
url);
}
@ -1682,7 +1682,7 @@ bool ProjectFileManager::Import(
if (!errorMessage.empty()) {
// Error message derived from Importer::Import
// Additional help via a Help button links to the manual.
ShowErrorDialog(&GetProjectFrame( project ), _("Error Importing"),
ShowErrorDialog(&GetProjectFrame( project ), XO("Error Importing"),
errorMessage.Translation(), wxT("Importing_Audio"));
}
if (!success)

View File

@ -30,11 +30,11 @@ BEGIN_EVENT_TABLE(SoundActivatedRecordDialog, wxDialogWrapper)
END_EVENT_TABLE()
SoundActivatedRecordDialog::SoundActivatedRecordDialog(wxWindow* parent)
: wxDialogWrapper(parent, -1, _("Sound Activated Record"), wxDefaultPosition,
: wxDialogWrapper(parent, -1, XO("Sound Activated Record"), wxDefaultPosition,
wxDefaultSize, wxCAPTION )
// wxDefaultSize, wxCAPTION | wxTHICK_FRAME)
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreatingFromPrefs);
PopulateOrExchange(S);
Fit();

View File

@ -72,11 +72,11 @@ void SplashDialog::DoHelpWelcome( AudacityProject &project )
}
SplashDialog::SplashDialog(wxWindow * parent)
: wxDialogWrapper(parent, -1, _("Welcome to Audacity!"),
: wxDialogWrapper(parent, -1, XO("Welcome to Audacity!"),
wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen.
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
SetName(GetTitle());
SetName();
m_pLogo = NULL; //v
ShuttleGui S( this, eIsCreating );
Populate( S );

View File

@ -608,7 +608,7 @@ void Tags::WriteXML(XMLWriter &xmlFile) const
xmlFile.EndTag(wxT("tags"));
}
bool Tags::ShowEditDialog(wxWindow *parent, const wxString &title, bool force)
bool Tags::ShowEditDialog(wxWindow *parent, const TranslatableString &title, bool force)
{
if (force) {
TagsEditorDialog dlg(parent, title, this, mEditTitle, mEditTrackNumber);
@ -811,7 +811,7 @@ BEGIN_EVENT_TABLE(TagsEditorDialog, wxDialogWrapper)
END_EVENT_TABLE()
TagsEditorDialog::TagsEditorDialog(wxWindow * parent,
const wxString &title,
const TranslatableString &title,
Tags * tags,
bool editTitle,
bool editTrack)
@ -821,7 +821,7 @@ TagsEditorDialog::TagsEditorDialog(wxWindow * parent,
mEditTitle(editTitle),
mEditTrack(editTrack)
{
SetName(GetTitle());
SetName();
mGrid = NULL;
@ -1147,10 +1147,10 @@ void TagsEditorDialog::OnEdit(wxCommandEvent & WXUNUSED(event))
mGrid->HideCellEditControl();
}
wxDialogWrapper dlg(this, wxID_ANY, _("Edit Genres"),
wxDialogWrapper dlg(this, wxID_ANY, XO("Edit Genres"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
dlg.SetName(dlg.GetTitle());
dlg.SetName();
wxTextCtrl *tc;
ShuttleGui S(&dlg, eIsCreating);

View File

@ -90,7 +90,8 @@ class AUDACITY_DLL_API Tags final
Tags & operator= (const Tags & src );
bool ShowEditDialog(wxWindow *parent, const wxString &title, bool force = false);
bool ShowEditDialog(
wxWindow *parent, const TranslatableString &title, bool force = false);
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override;
XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
@ -142,7 +143,7 @@ class TagsEditorDialog final : public wxDialogWrapper
public:
// constructors and destructors
TagsEditorDialog(wxWindow * parent,
const wxString &title,
const TranslatableString &title,
Tags * tags,
bool editTitle,
bool editTrackNumber);

View File

@ -29,7 +29,7 @@ BEGIN_EVENT_TABLE(TimeDialog, wxDialogWrapper)
END_EVENT_TABLE()
TimeDialog::TimeDialog(wxWindow *parent,
const wxString &title,
const TranslatableString &title,
const NumericFormatSymbol &format,
double rate,
double time,
@ -41,7 +41,7 @@ TimeDialog::TimeDialog(wxWindow *parent,
mTime(time),
mTimeCtrl(NULL)
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
PopulateOrExchange(S);
}

View File

@ -25,7 +25,7 @@ class TimeDialog final : public wxDialogWrapper
public:
TimeDialog(wxWindow *parent,
const wxString &title,
const TranslatableString &title,
const NumericFormatSymbol &format,
double rate,
double time,

View File

@ -166,10 +166,10 @@ BEGIN_EVENT_TABLE(TimerRecordDialog, wxDialogWrapper)
END_EVENT_TABLE()
TimerRecordDialog::TimerRecordDialog(wxWindow* parent, bool bAlreadySaved)
: wxDialogWrapper(parent, -1, _("Audacity Timer Record"), wxDefaultPosition,
: wxDialogWrapper(parent, -1, XO("Audacity Timer Record"), wxDefaultPosition,
wxDefaultSize, wxCAPTION)
{
SetName(GetTitle());
SetName();
m_DateTime_Start = wxDateTime::UNow();
long seconds; // default duration is 1 hour = 3600 seconds

View File

@ -126,7 +126,7 @@ bool AudacityCommand::ShowInterface(wxWindow *parent, bool WXUNUSED(forceModal))
wxDialog *AudacityCommand::CreateUI(wxWindow *parent, AudacityCommand * WXUNUSED(client))
{
Destroy_ptr<AudacityCommandDialog> dlg { safenew AudacityCommandDialog{
parent, GetTranslatedName(), this}};
parent, GetUntranslatedName(), this}};
if (dlg->Init())
{
@ -258,7 +258,7 @@ BEGIN_EVENT_TABLE(AudacityCommandDialog, wxDialogWrapper)
END_EVENT_TABLE()
AudacityCommandDialog::AudacityCommandDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
AudacityCommand * pCommand,
int type,
int flags,

View File

@ -145,7 +145,7 @@ class AUDACITY_DLL_API AudacityCommandDialog /* not final */ : public wxDialogWr
public:
// constructors and destructors
AudacityCommandDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
AudacityCommand * pCommand,
int type = 0,
int flags = wxDEFAULT_DIALOG_STYLE,

View File

@ -306,7 +306,7 @@ class AUDACITY_DLL_API LongMessageDialog /* not final */ : public wxDialogWrappe
public:
// constructors and destructors
LongMessageDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
int type = 0,
int flags = wxDEFAULT_DIALOG_STYLE,
int additionalButtons = 0);
@ -339,7 +339,7 @@ BEGIN_EVENT_TABLE(LongMessageDialog, wxDialogWrapper)
END_EVENT_TABLE()
LongMessageDialog::LongMessageDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
int type,
int flags,
int additionalButtons)
@ -347,7 +347,7 @@ LongMessageDialog::LongMessageDialog(wxWindow * parent,
{
mType = type;
mAdditionalButtons = additionalButtons;
SetName( "Long Message" );
SetName(XO("Long Message"));
}
LongMessageDialog::~LongMessageDialog(){
@ -389,7 +389,7 @@ void LongMessageDialog::AcceptText( const wxString & Text )
{
if( pDlg == NULL ){
pDlg = new LongMessageDialog(
wxTheApp->GetTopWindow(), _( "Long Message" ) );
wxTheApp->GetTopWindow(), XO( "Long Message" ) );
pDlg->Init();
pDlg->Show();
}

View File

@ -171,12 +171,12 @@ void ContrastDialog::OnChar(wxKeyEvent &event)
/* i18n-hint: WCAG2 is the 'Web Content Accessibility Guidelines (WCAG) 2.0', see http://www.w3.org/TR/WCAG20/ */
ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
const wxPoint & pos):
wxDialogWrapper(parent, id, title, pos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX )
{
SetName(GetTitle());
SetName();
mT0 = 0.0;
mT1 = 0.0;

View File

@ -30,7 +30,7 @@ class ContrastDialog final : public wxDialogWrapper
public:
// constructors and destructors
ContrastDialog(wxWindow * parent, wxWindowID id,
const wxString & title, const wxPoint & pos);
const TranslatableString & title, const wxPoint & pos);
wxButton * m_pButton_UseCurrentF;
wxButton * m_pButton_UseCurrentB;

View File

@ -2444,7 +2444,7 @@ void Effect::Preview(bool dryOnly)
}
}
else {
ShowErrorDialog(FocusDialog, _("Error"),
ShowErrorDialog(FocusDialog, XO("Error"),
_("Error opening sound device.\nTry changing the audio host, playback device and the project sample rate."),
wxT("Error_opening_sound_device"));
}
@ -2467,7 +2467,7 @@ BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper)
END_EVENT_TABLE()
EffectDialog::EffectDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
int type,
int flags,
int additionalButtons)
@ -2639,7 +2639,7 @@ END_EVENT_TABLE()
EffectUIHost::EffectUIHost(wxWindow *parent,
Effect *effect,
EffectUIClientInterface *client)
: wxDialogWrapper(parent, wxID_ANY, effect->GetTranslatedName(),
: wxDialogWrapper(parent, wxID_ANY, effect->GetUntranslatedName(),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
{
@ -2648,7 +2648,7 @@ EffectUIHost::EffectUIHost(wxWindow *parent,
[ [((NSView *)GetHandle()) window] setLevel:NSFloatingWindowLevel];
#endif
SetName( effect->GetTranslatedName() );
SetName( effect->GetUntranslatedName() );
SetExtraStyle(GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY);
mParent = parent;
@ -2672,7 +2672,7 @@ EffectUIHost::EffectUIHost(wxWindow *parent,
EffectUIHost::EffectUIHost(wxWindow *parent,
AudacityCommand *command,
EffectUIClientInterface *client)
: wxDialogWrapper(parent, wxID_ANY, _("Some Command") /*command->GetTranslatedName()*/,
: wxDialogWrapper(parent, wxID_ANY, XO("Some Command") /*command->GetUntranslatedName()*/,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX)
{
@ -3467,7 +3467,7 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt))
{
wxTextCtrl *text;
wxString name;
wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Save Preset")));
wxDialogWrapper dlg(this, wxID_ANY, XO("Save Preset"));
ShuttleGui S(&dlg, eIsCreating);
@ -3741,7 +3741,7 @@ BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialogWrapper)
END_EVENT_TABLE()
EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Select Preset")))
: wxDialogWrapper(parent, wxID_ANY, XO("Select Preset"))
{
ShuttleGui S(this, eIsCreating);
S.StartVerticalLay();

View File

@ -559,7 +559,7 @@ class AUDACITY_DLL_API EffectDialog /* not final */ : public wxDialogWrapper
public:
// constructors and destructors
EffectDialog(wxWindow * parent,
const wxString & title,
const TranslatableString & title,
int type = 0,
int flags = wxDEFAULT_DIALOG_STYLE,
int additionalButtons = 0);

View File

@ -3312,12 +3312,12 @@ BEGIN_EVENT_TABLE(EditCurvesDialog, wxDialogWrapper)
END_EVENT_TABLE()
EditCurvesDialog::EditCurvesDialog(wxWindow * parent, EffectEqualization * effect, int position):
wxDialogWrapper(parent, wxID_ANY, _("Manage Curves List"),
wxDialogWrapper(parent, wxID_ANY, XO("Manage Curves List"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
SetLabel(_("Manage Curves")); // Provide visual label
SetName(_("Manage Curves List")); // Provide audible label
SetLabel(XO("Manage Curves")); // Provide visual label
SetName(XO("Manage Curves List")); // Provide audible label
mParent = parent;
mEffect = effect;
mPosition = position;

View File

@ -1543,7 +1543,7 @@ EffectNoiseReduction::Dialog::Dialog
(EffectNoiseReduction *effect,
EffectNoiseReduction::Settings *settings,
wxWindow *parent, bool bHasProfile, bool bAllowTwiddleSettings)
: EffectDialog( parent, _("Noise Reduction"), EffectTypeProcess,wxDEFAULT_DIALOG_STYLE, eHelpButton )
: EffectDialog( parent, XO("Noise Reduction"), EffectTypeProcess,wxDEFAULT_DIALOG_STYLE, eHelpButton )
, m_pEffect(effect)
, m_pSettings(settings) // point to
, mTempSettings(*settings) // copy

View File

@ -786,7 +786,7 @@ BEGIN_EVENT_TABLE(VSTEffectOptionsDialog, wxDialogWrapper)
END_EVENT_TABLE()
VSTEffectOptionsDialog::VSTEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("VST Effect Options")))
: wxDialogWrapper(parent, wxID_ANY, XO("VST Effect Options"))
{
mHost = host;

View File

@ -354,7 +354,7 @@ BEGIN_EVENT_TABLE(AudioUnitEffectOptionsDialog, wxDialogWrapper)
END_EVENT_TABLE()
AudioUnitEffectOptionsDialog::AudioUnitEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Audio Unit Effect Options")))
: wxDialogWrapper(parent, wxID_ANY, XO("Audio Unit Effect Options"))
{
mHost = host;
@ -488,7 +488,7 @@ BEGIN_EVENT_TABLE(AudioUnitEffectExportDialog, wxDialogWrapper)
END_EVENT_TABLE()
AudioUnitEffectExportDialog::AudioUnitEffectExportDialog(wxWindow * parent, AudioUnitEffect *effect)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Export Audio Unit Presets")))
: wxDialogWrapper(parent, wxID_ANY, XO("Export Audio Unit Presets"))
{
mEffect = effect;
@ -660,7 +660,7 @@ BEGIN_EVENT_TABLE(AudioUnitEffectImportDialog, wxDialogWrapper)
END_EVENT_TABLE()
AudioUnitEffectImportDialog::AudioUnitEffectImportDialog(wxWindow * parent, AudioUnitEffect *effect)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Import Audio Unit Presets")))
: wxDialogWrapper(parent, wxID_ANY, XO("Import Audio Unit Presets"))
{
mEffect = effect;

View File

@ -428,7 +428,7 @@ BEGIN_EVENT_TABLE(LadspaEffectOptionsDialog, wxDialogWrapper)
END_EVENT_TABLE()
LadspaEffectOptionsDialog::LadspaEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("LADSPA Effect Options")))
: wxDialogWrapper(parent, wxID_ANY, XO("LADSPA Effect Options"))
{
mHost = host;

View File

@ -192,7 +192,7 @@ BEGIN_EVENT_TABLE(LV2EffectSettingsDialog, wxDialogWrapper)
END_EVENT_TABLE()
LV2EffectSettingsDialog::LV2EffectSettingsDialog(wxWindow *parent, LV2Effect *effect)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("LV2 Effect Settings")))
: wxDialogWrapper(parent, wxID_ANY, XO("LV2 Effect Settings"))
{
mEffect = effect;

View File

@ -929,7 +929,7 @@ finish:
if (mDebug && !mRedirectOutput) {
NyquistOutputDialog dlog(mUIParent, -1,
mName.Translation(),
mName,
_("Debug Output: "),
mDebugOutput);
dlog.CentreOnParent();
@ -3122,12 +3122,12 @@ BEGIN_EVENT_TABLE(NyquistOutputDialog, wxDialogWrapper)
END_EVENT_TABLE()
NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
const wxString & prompt,
const wxString &message)
: wxDialogWrapper{ parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER }
{
SetName(GetTitle());
SetName();
wxBoxSizer *mainSizer;
{

View File

@ -283,7 +283,7 @@ class NyquistOutputDialog final : public wxDialogWrapper
{
public:
NyquistOutputDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
const wxString & prompt,
const wxString &message);

View File

@ -393,7 +393,7 @@ const ExportPluginArray &Exporter::GetPlugins()
}
bool Exporter::DoEditMetadata(AudacityProject &project,
const wxString &title, const wxString &shortUndoDescription, bool force)
const TranslatableString &title, const wxString &shortUndoDescription, bool force)
{
auto &settings = ProjectSettings::Get( project );
auto &tags = Tags::Get( project );
@ -409,7 +409,7 @@ bool Exporter::DoEditMetadata(AudacityProject &project,
if (tags != *newTags) {
// Commit the change to project state only now.
Tags::Set( project, newTags );
ProjectHistory::Get( project ).PushState(title, shortUndoDescription);
ProjectHistory::Get( project ).PushState(title.Translation(), shortUndoDescription);
}
bool bShowInFuture;
gPrefs->Read(wxT("/AudioFiles/ShowId3Dialog"), &bShowInFuture, true);
@ -446,7 +446,7 @@ bool Exporter::Process(AudacityProject *project, bool selectedOnly, double t0, d
// Let user edit MetaData
if (mPlugins[mFormat]->GetCanMetaData(mSubFormat)) {
if (!DoEditMetadata( *project,
_("Edit Metadata Tags"), _("Exported Tags"),
XO("Edit Metadata Tags"), _("Exported Tags"),
ProjectSettings::Get( *mProject ).GetShowId3Dialog())) {
return false;
}
@ -915,7 +915,7 @@ bool Exporter::CheckMix()
exportedChannels,
NULL,
1,
_("Advanced Mixing Options"));
XO("Advanced Mixing Options"));
if (md.ShowModal() != wxID_OK) {
return false;
@ -1102,7 +1102,7 @@ bool Exporter::SetAutoExportOptions(AudacityProject *project) {
// Let user edit MetaData
if (mPlugins[mFormat]->GetCanMetaData(mSubFormat)) {
if (!DoEditMetadata( *project,
_("Edit Metadata Tags"),
XO("Edit Metadata Tags"),
_("Exported Tags"),
ProjectSettings::Get(*mProject).GetShowId3Dialog())) {
return false;
@ -1367,11 +1367,11 @@ BEGIN_EVENT_TABLE( ExportMixerDialog, wxDialogWrapper )
END_EVENT_TABLE()
ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly,
unsigned maxNumChannels, wxWindow *parent, wxWindowID id, const wxString &title,
unsigned maxNumChannels, wxWindow *parent, wxWindowID id, const TranslatableString &title,
const wxPoint &position, const wxSize& size, long style ) :
wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
{
SetName(GetTitle());
SetName();
unsigned numTracks = 0;

View File

@ -178,7 +178,7 @@ public:
};
static bool DoEditMetadata(AudacityProject &project,
const wxString &title, const wxString &shortUndoDescription, bool force);
const TranslatableString &title, const wxString &shortUndoDescription, bool force);
Exporter();
virtual ~Exporter();
@ -296,7 +296,7 @@ class ExportMixerDialog final : public wxDialogWrapper
public:
// constructors and destructors
ExportMixerDialog( const TrackList * tracks, bool selectedOnly, unsigned maxNumChannels,
wxWindow *parent, wxWindowID id, const wxString &title,
wxWindow *parent, wxWindowID id, const TranslatableString &title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );

View File

@ -526,11 +526,11 @@ ProgressResult ExportCL::Export(AudacityProject *project,
// TODO use ShowInfoDialog() instead.
wxDialogWrapper dlg(nullptr,
wxID_ANY,
wxString(_("Command Output")),
XO("Command Output"),
wxDefaultPosition,
wxSize(600, 400),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
dlg.SetName(dlg.GetTitle());
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
S.AddTextWindow(cmd + wxT("\n\n") + output);

View File

@ -999,8 +999,8 @@ void ExportFFmpeg::SetMetadata(const Tags *tags, const char *name, const wxChar
int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate, const int *sampRates)
{
wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate")));
d.SetName(d.GetTitle());
wxDialogWrapper d(nullptr, wxID_ANY, XO("Invalid sample rate"));
d.SetName();
wxChoice *choice;
ShuttleGui S(&d, eIsCreating);

View File

@ -1450,9 +1450,9 @@ ExportFFmpegOptions::~ExportFFmpegOptions()
ExportFFmpegOptions::ExportFFmpegOptions(wxWindow *parent)
: wxDialogWrapper(parent, wxID_ANY,
wxString(_("Configure custom FFmpeg options")))
XO("Configure custom FFmpeg options"))
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreatingFromPrefs);
PickFFmpegLibs();
//FFmpegLibsInst()->LoadLibs(NULL,true); //Loaded at startup or from Prefs now

View File

@ -556,9 +556,9 @@ public:
FindDialog(wxWindow *parent, wxString path, wxString name, wxString type)
: wxDialogWrapper(parent, wxID_ANY,
/* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/
wxString(_("Locate LAME")))
XO("Locate LAME"))
{
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
mPath = path;
@ -2000,8 +2000,8 @@ wxWindow *ExportMP3::OptionsCreate(wxWindow *parent, int format)
int ExportMP3::AskResample(int bitrate, int rate, int lowrate, int highrate)
{
wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate")));
d.SetName(d.GetTitle());
wxDialogWrapper d(nullptr, wxID_ANY, XO("Invalid sample rate"));
d.SetName();
wxChoice *choice;
ShuttleGui S(&d, eIsCreating);

View File

@ -130,10 +130,10 @@ END_EVENT_TABLE()
ExportMultipleDialog::ExportMultipleDialog(AudacityProject *project)
: wxDialogWrapper( &GetProjectFrame( *project ),
wxID_ANY, wxString(_("Export Multiple")) )
wxID_ANY, XO("Export Multiple") )
, mSelectionState{ SelectionState::Get( *project ) }
{
SetName(GetTitle());
SetName();
mProject = project;
mTracks = &TrackList::Get( *project );
@ -618,7 +618,7 @@ void ExportMultipleDialog::OnExport(wxCommandEvent& WXUNUSED(event))
GuardedCall( [&] {
// This results dialog is a child of this dialog.
HelpSystem::ShowInfoDialog( this,
_("Export Multiple"),
XO("Export Multiple"),
msg,
FileList,
450,400);
@ -823,7 +823,7 @@ ProgressResult ExportMultipleDialog::ExportMultipleByLabel(bool byName,
if( bShowTagsDialog ){
bool bCancelled = !setting.filetags.ShowEditDialog(
ProjectWindow::Find( mProject ),
_("Edit Metadata Tags"), bShowTagsDialog);
XO("Edit Metadata Tags"), bShowTagsDialog);
gPrefs->Read(wxT("/AudioFiles/ShowId3Dialog"), &bShowTagsDialog, true);
settings.SetShowId3Dialog( bShowTagsDialog );
if( bCancelled )
@ -949,7 +949,7 @@ ProgressResult ExportMultipleDialog::ExportMultipleByTrack(bool byName,
if( bShowTagsDialog ){
bool bCancelled = !setting.filetags.ShowEditDialog(
ProjectWindow::Find( mProject ),
_("Edit Metadata Tags"), bShowTagsDialog);
XO("Edit Metadata Tags"), bShowTagsDialog);
gPrefs->Read(wxT("/AudioFiles/ShowId3Dialog"), &bShowTagsDialog, true);
settings.SetShowId3Dialog( bShowTagsDialog );
if( bCancelled )

View File

@ -169,7 +169,7 @@ private:
class SuccessDialog final : public wxDialogWrapper
{
public:
SuccessDialog(wxWindow *parent, wxWindowID id, const wxString &title) :
SuccessDialog(wxWindow *parent, wxWindowID id, const TranslatableString &title) :
wxDialogWrapper(parent, id, title, wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {};
void OnKeyDown(wxListEvent& event); // dismisses dialog when <enter> is pressed with list control having focus

View File

@ -405,13 +405,13 @@ void ExportPCM::ReportTooBigError(wxWindow * pParent)
_("You have attempted to Export a WAV or AIFF file which would be greater than 4GB.\n"
"Audacity cannot do this, the Export was abandoned.");
ShowErrorDialog(pParent, _("Error Exporting"), message,
ShowErrorDialog(pParent, XO("Error Exporting"), message,
wxT("Size_limits_for_WAV_and_AIFF_files"));
// This alternative error dialog was to cover the possibility we could not
// compute the size in advance.
#if 0
ShowErrorDialog(pParent, _("Error Exporting"),
ShowErrorDialog(pParent, XO("Error Exporting"),
_("Your exported WAV file has been truncated as Audacity cannot export WAV\n"
"files bigger than 4GB."),
wxT("Size_limits_for_WAV_files"));

View File

@ -532,7 +532,7 @@ bool Importer::Import(const FilePath &fName,
// File has more than one stream - display stream selector
if (inFile->GetStreamCount() > 1)
{
ImportStreamDialog ImportDlg(inFile.get(), NULL, -1, _("Select stream(s) to import"));
ImportStreamDialog ImportDlg(inFile.get(), NULL, -1, XO("Select stream(s) to import"));
if (ImportDlg.ShowModal() == wxID_CANCEL)
{
@ -741,11 +741,11 @@ BEGIN_EVENT_TABLE( ImportStreamDialog, wxDialogWrapper )
EVT_BUTTON( wxID_CANCEL, ImportStreamDialog::OnCancel )
END_EVENT_TABLE()
ImportStreamDialog::ImportStreamDialog( ImportFileHandle *_mFile, wxWindow *parent, wxWindowID id, const wxString &title,
ImportStreamDialog::ImportStreamDialog( ImportFileHandle *_mFile, wxWindow *parent, wxWindowID id, const TranslatableString &title,
const wxPoint &position, const wxSize& size, long style ):
wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER )
{
SetName(GetTitle());
SetName();
mFile = _mFile;
scount = mFile->GetStreamCount();

View File

@ -174,7 +174,7 @@ class ImportStreamDialog final : public wxDialogWrapper
public:
// constructors and destructors
ImportStreamDialog( ImportFileHandle *_mFile,
wxWindow *parent, wxWindowID id, const wxString &title,
wxWindow *parent, wxWindowID id, const TranslatableString &title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );

View File

@ -301,7 +301,7 @@ END_EVENT_TABLE()
ImportRawDialog::ImportRawDialog(wxWindow * parent,
int encoding, unsigned channels,
int offset, double rate)
: wxDialogWrapper(parent, wxID_ANY, _("Import Raw Data"),
: wxDialogWrapper(parent, wxID_ANY, XO("Import Raw Data"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
mEncoding(encoding),
@ -311,7 +311,7 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent,
{
wxASSERT(channels >= 1);
SetName(GetTitle());
SetName();
ShuttleGui S(this, eIsCreating);
wxArrayStringEx encodings;

View File

@ -928,7 +928,7 @@ void OnEditMetadata(const CommandContext &context)
{
auto &project = context.project;
(void)Exporter::DoEditMetadata( project,
_("Edit Metadata Tags"), _("Metadata Tags"), true);
XO("Edit Metadata Tags"), _("Metadata Tags"), true);
}
void OnPreferences(const CommandContext &context)

View File

@ -35,11 +35,11 @@ namespace {
void ShowDiagnostics(
AudacityProject &project, const wxString &info,
const wxString &description, const wxString &defaultPath)
const TranslatableString &description, const wxString &defaultPath)
{
auto &window = GetProjectFrame( project );
wxDialogWrapper dlg( &window, wxID_ANY, description);
dlg.SetName(dlg.GetTitle());
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
wxTextCtrl *text;
@ -57,8 +57,7 @@ void ShowDiagnostics(
if (dlg.ShowModal() == wxID_OK)
{
const auto fileDialogTitle =
wxString::Format( _("Save %s"), description );
const auto fileDialogTitle = XO("Save %s").Format( description ).Translation();
wxString fName = FileNames::SelectFile(FileNames::Operation::Export,
fileDialogTitle,
wxEmptyString,
@ -72,7 +71,7 @@ void ShowDiagnostics(
if (!text->SaveFile(fName))
{
AudacityMessageBox(
wxString::Format( _("Unable to save %s"), description ),
XO("Unable to save %s").Format( description ).Translation(),
fileDialogTitle);
}
}
@ -121,7 +120,7 @@ BEGIN_EVENT_TABLE(QuickFixDialog, wxDialogWrapper)
END_EVENT_TABLE();
QuickFixDialog::QuickFixDialog(wxWindow * pParent) :
wxDialogWrapper(pParent, wxID_ANY, _("Do you have these problems?"),
wxDialogWrapper(pParent, wxID_ANY, XO("Do you have these problems?"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE )
{
@ -176,7 +175,7 @@ void QuickFixDialog::PopulateOrExchange(ShuttleGui & S)
bool bStuckInMode = mbSyncLocked || mbInSnapTo || mbSoundActivated;
if( !bStuckInMode ){
SetLabel(_("Nothing to do"));
SetLabel(XO("Nothing to do"));
S.AddFixedText(_("No quick, easily fixed problems were found"));
}
else {
@ -315,7 +314,7 @@ void OnAudioDeviceInfo(const CommandContext &context)
auto gAudioIO = AudioIOBase::Get();
wxString info = gAudioIO->GetDeviceInfo();
ShowDiagnostics( project, info,
_("Audio Device Info"), wxT("deviceinfo.txt") );
XO("Audio Device Info"), wxT("deviceinfo.txt") );
}
#ifdef EXPERIMENTAL_MIDI_OUT
@ -325,7 +324,7 @@ void OnMidiDeviceInfo(const CommandContext &context)
auto gAudioIO = AudioIOBase::Get();
wxString info = gAudioIO->GetMidiDeviceInfo();
ShowDiagnostics( project, info,
_("MIDI Device Info"), wxT("midideviceinfo.txt") );
XO("MIDI Device Info"), wxT("midideviceinfo.txt") );
}
#endif

View File

@ -27,7 +27,7 @@ AudacityProject::AttachedWindows::RegisteredFactory sContrastDialogKey{
[]( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
auto &window = ProjectWindow::Get( parent );
return safenew ContrastDialog(
&window, -1, _("Contrast Analysis (WCAG 2 compliance)"),
&window, -1, XO("Contrast Analysis (WCAG 2 compliance)"),
wxPoint{ 150, 150 }
);
}
@ -37,7 +37,7 @@ AudacityProject::AttachedWindows::RegisteredFactory sFrequencyWindowKey{
[]( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
auto &window = ProjectWindow::Get( parent );
return safenew FrequencyPlotDialog(
&window, -1, _("Frequency Analysis"),
&window, -1, XO("Frequency Analysis"),
wxPoint{ 150, 150 }
);
}

View File

@ -514,7 +514,7 @@ void OnSetLeftSelection(const CommandContext &context)
auto fmt = settings.GetSelectionFormat();
auto rate = settings.GetRate();
TimeDialog dlg(&window, _("Set Left Selection Boundary"),
TimeDialog dlg(&window, XO("Set Left Selection Boundary"),
fmt, rate, selectedRegion.t0(), _("Position"));
if (wxID_OK == dlg.ShowModal())
@ -553,7 +553,7 @@ void OnSetRightSelection(const CommandContext &context)
auto fmt = settings.GetSelectionFormat();
auto rate = settings.GetRate();
TimeDialog dlg(&window, _("Set Right Selection Boundary"),
TimeDialog dlg(&window, XO("Set Right Selection Boundary"),
fmt, rate, selectedRegion.t1(), _("Position"));
if (wxID_OK == dlg.ShowModal())

View File

@ -697,7 +697,7 @@ void OnResample(const CommandContext &context)
while (true)
{
wxDialogWrapper dlg(&window, wxID_ANY, wxString(_("Resample")));
wxDialogWrapper dlg(&window, wxID_ANY, XO("Resample"));
ShuttleGui S(&dlg, eIsCreating);
wxString rate;
wxComboBox *cb;

View File

@ -365,7 +365,7 @@ void OnPunchAndRoll(const CommandContext &context)
? _("Please select in a stereo track.")
: wxString::Format(
_("Please select at least %d channels."), recordingChannels);
ShowErrorDialog(&window, _("Error"), message, url);
ShowErrorDialog(&window, XO("Error"), message, url);
return;
}
@ -407,7 +407,7 @@ void OnPunchAndRoll(const CommandContext &context)
if (error) {
auto message = _("Please select a time within a clip.");
ShowErrorDialog( &window, _("Error"), message, url);
ShowErrorDialog( &window, XO("Error"), message, url);
return;
}

View File

@ -534,7 +534,7 @@ PrefsDialog::Factories
PrefsDialog::PrefsDialog
(wxWindow * parent, const wxString &titlePrefix, Factories &factories)
: wxDialogWrapper(parent, wxID_ANY, wxString(_("Audacity Preferences")),
: wxDialogWrapper(parent, wxID_ANY, XO("Audacity Preferences"),
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
@ -694,7 +694,7 @@ int PrefsDialog::ShowModal()
mCategories->SetSelection(selected);
}
else {
wxString Temp = mTitlePrefix + mUniquePage->GetLabel();
auto Temp = TranslatableString{ mTitlePrefix + mUniquePage->GetLabel() };
SetTitle(Temp);
SetName(Temp);
}

View File

@ -811,22 +811,22 @@ void DeviceToolBar::OnChoice(wxCommandEvent &event)
void DeviceToolBar::ShowInputDialog()
{
ShowComboDialog(mInput, wxString(_("Select Recording Device")));
ShowComboDialog(mInput, XO("Select Recording Device"));
}
void DeviceToolBar::ShowOutputDialog()
{
ShowComboDialog(mOutput, wxString(_("Select Playback Device")));
ShowComboDialog(mOutput, XO("Select Playback Device"));
}
void DeviceToolBar::ShowHostDialog()
{
ShowComboDialog(mHost, wxString(_("Select Audio Host")));
ShowComboDialog(mHost, XO("Select Audio Host"));
}
void DeviceToolBar::ShowChannelsDialog()
{
ShowComboDialog(mInputChannels, wxString(_("Select Recording Channels")));
ShowComboDialog(mInputChannels, XO("Select Recording Channels"));
}
void DeviceToolBar::ShowComboDialog(wxChoice *combo, const wxString &title)
void DeviceToolBar::ShowComboDialog(wxChoice *combo, const TranslatableString &title)
{
if (!combo || combo->GetCount() == 0) {
AudacityMessageBox(_("Device information is not available."));
@ -837,7 +837,7 @@ void DeviceToolBar::ShowComboDialog(wxChoice *combo, const wxString &title)
wxArrayStringEx inputSources = combo->GetStrings();
wxDialogWrapper dlg(nullptr, wxID_ANY, title);
dlg.SetName(dlg.GetTitle());
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
wxChoice *c;

View File

@ -70,7 +70,7 @@ class DeviceToolBar final : public ToolBar {
void RepositionCombos();
void SetNames();
void RegenerateTooltips() override;
void ShowComboDialog(wxChoice *combo, const wxString &title);
void ShowComboDialog(wxChoice *combo, const TranslatableString &title);
wxChoice *mInput;
wxChoice *mOutput;

View File

@ -90,7 +90,7 @@ void MixerToolBar::Populate()
Add(safenew AStaticBitmap(this,
wxID_ANY,
theTheme.Bitmap(bmpMic)), 0, wxALIGN_CENTER);
mInputSlider = safenew ASlider(this, wxID_ANY, _("Recording Volume"),
mInputSlider = safenew ASlider(this, wxID_ANY, XO("Recording Volume"),
wxDefaultPosition, wxSize(130, 25),
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
Add(mInputSlider, 1, wxALIGN_CENTER);
@ -100,7 +100,7 @@ void MixerToolBar::Populate()
Add(safenew AStaticBitmap(this,
wxID_ANY,
theTheme.Bitmap(bmpSpeaker)), 0, wxALIGN_CENTER);
mOutputSlider = safenew ASlider(this, wxID_ANY, _("Playback Volume"),
mOutputSlider = safenew ASlider(this, wxID_ANY, XO("Playback Volume"),
wxDefaultPosition, wxSize(130, 25),
ASlider::Options{}.Line( 0.1f ).Page( 2.0f ));
Add(mOutputSlider, 1, wxALIGN_CENTER);

View File

@ -215,7 +215,7 @@ void TranscriptionToolBar::Populate()
const int SliderWidth=100;
mPlaySpeedSlider = safenew ASlider(this,
TTB_PlaySpeedSlider,
_("Playback Speed"),
XO("Playback Speed"),
wxDefaultPosition,
wxSize(SliderWidth,25),
ASlider::Options{}

View File

@ -110,8 +110,8 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &)
LabelTrackView::DefaultFontSize);
/* i18n-hint: (noun) This is the font for the label track.*/
wxDialogWrapper dlg(mpData->pParent, wxID_ANY, wxString(_("Label Track Font")));
dlg.SetName(dlg.GetTitle());
wxDialogWrapper dlg(mpData->pParent, wxID_ANY, XO("Label Track Font"));
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
wxListBox *lb;
wxSpinCtrl *sc;

View File

@ -294,12 +294,12 @@ void NoteTrackControls::ReCreateVelocitySlider( wxEvent &evt )
GetVelocityRect(point, sliderRect);
/* i18n-hint: Title of the Velocity slider, used to adjust the volume of note tracks */
gVelocity = std::make_unique<LWSlider>(nullptr, _("Velocity"),
gVelocity = std::make_unique<LWSlider>(nullptr, XO("Velocity"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
VEL_SLIDER);
gVelocity->SetDefaultValue(0.0);
gVelocityCaptured = std::make_unique<LWSlider>(nullptr, _("Velocity"),
gVelocityCaptured = std::make_unique<LWSlider>(nullptr, XO("Velocity"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
VEL_SLIDER);

View File

@ -478,8 +478,8 @@ void RateMenuTable::OnRateOther(wxCommandEvent &)
/// \todo Make a real dialog box out of this!!
while (true)
{
wxDialogWrapper dlg(mpData->pParent, wxID_ANY, wxString(_("Set Rate")));
dlg.SetName(dlg.GetTitle());
wxDialogWrapper dlg(mpData->pParent, wxID_ANY, XO("Set Rate"));
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
wxString rate;
wxComboBox *cb;
@ -1239,13 +1239,13 @@ void WaveTrackControls::ReCreateGainSlider( wxEvent &event )
float defPos = 1.0;
/* i18n-hint: Title of the Gain slider, used to adjust the volume */
gGain = std::make_unique<LWSlider>(nullptr, _("Gain"),
gGain = std::make_unique<LWSlider>(nullptr, XO("Gain"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
DB_SLIDER);
gGain->SetDefaultValue(defPos);
gGainCaptured = std::make_unique<LWSlider>(nullptr, _("Gain"),
gGainCaptured = std::make_unique<LWSlider>(nullptr, XO("Gain"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
DB_SLIDER);
@ -1296,13 +1296,13 @@ void WaveTrackControls::ReCreatePanSlider( wxEvent &event )
float defPos = 0.0;
/* i18n-hint: Title of the Pan slider, used to move the sound left or right */
gPan = std::make_unique<LWSlider>(nullptr, _("Pan"),
gPan = std::make_unique<LWSlider>(nullptr, XO("Pan"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
PAN_SLIDER);
gPan->SetDefaultValue(defPos);
gPanCaptured = std::make_unique<LWSlider>(nullptr, _("Pan"),
gPanCaptured = std::make_unique<LWSlider>(nullptr, XO("Pan"),
wxPoint(sliderRect.x, sliderRect.y),
wxSize(sliderRect.width, sliderRect.height),
PAN_SLIDER);

View File

@ -263,7 +263,7 @@ BEGIN_EVENT_TABLE(SliderDialog, wxDialogWrapper)
END_EVENT_TABLE();
SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
wxPoint position,
wxSize size,
int style,
@ -274,7 +274,7 @@ SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id,
wxDialogWrapper(parent,id,title,position),
mStyle(style)
{
SetName(GetTitle());
SetName();
mpOrigin = pSource;
ShuttleGui S(this, eIsCreating);
@ -436,7 +436,7 @@ static const wxPoint2DDouble disabledRightEnd[] =
// Construct customizable slider
LWSlider::LWSlider(wxWindow * parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
float minValue,
@ -454,7 +454,7 @@ LWSlider::LWSlider(wxWindow * parent,
// Construct predefined slider
LWSlider::LWSlider(wxWindow *parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
int style,
@ -514,7 +514,7 @@ LWSlider::LWSlider(wxWindow *parent,
}
void LWSlider::Init(wxWindow * parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
float minValue,
@ -982,7 +982,7 @@ wxString LWSlider::GetTip(float value) const
#endif
}
label.Printf(_("%s: %s"), mName, val);
label = XO("%s: %s").Format( mName, val ).Translation();
}
else
{
@ -1524,7 +1524,7 @@ END_EVENT_TABLE()
ASlider::ASlider( wxWindow * parent,
wxWindowID id,
const wxString &name,
const TranslatableString &name,
const wxPoint & pos,
const wxSize & size,
const Options &options)
@ -1543,7 +1543,7 @@ ASlider::ASlider( wxWindow * parent,
options.orientation);
mLWSlider->mStepValue = options.stepValue;
mLWSlider->SetId( id );
SetName( name );
SetName( name.Translation() );
mSliderIsFocused = false;
mStyle = options.style;

View File

@ -68,7 +68,7 @@ class LWSlider
// MM: Construct customizable slider
LWSlider(wxWindow * parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
float minValue,
@ -82,7 +82,7 @@ class LWSlider
// Construct predefined slider
LWSlider(wxWindow * parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
int style,
@ -91,7 +91,7 @@ class LWSlider
int orientation = wxHORIZONTAL); // wxHORIZONTAL or wxVERTICAL. wxVERTICAL is currently only for DB_SLIDER.
void Init(wxWindow * parent,
const wxString &name,
const TranslatableString &name,
const wxPoint &pos,
const wxSize &size,
float minValue,
@ -224,7 +224,7 @@ class LWSlider
std::unique_ptr<wxBitmap> mBitmap, mThumbBitmap, mThumbBitmapHilited;
wxString mName;
TranslatableString mName;
bool mEnabled;
};
@ -259,7 +259,7 @@ class ASlider /* not final */ : public wxPanel
ASlider( wxWindow * parent,
wxWindowID id,
const wxString &name,
const TranslatableString &name,
const wxPoint & pos,
const wxSize & size,
const Options &options = Options{});
@ -331,7 +331,7 @@ class SliderDialog final : public wxDialogWrapper
{
public:
SliderDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const TranslatableString & title,
wxPoint position,
wxSize size,
int style,

View File

@ -42,13 +42,13 @@ END_EVENT_TABLE()
ErrorDialog::ErrorDialog(
wxWindow *parent,
const wxString & dlogTitle,
const TranslatableString & dlogTitle,
const wxString & message,
const wxString & helpPage,
const bool Close, const bool modal):
wxDialogWrapper(parent, (wxWindowID)-1, dlogTitle)
{
SetName(GetTitle());
SetName();
long buttonMask;
@ -103,7 +103,7 @@ void ErrorDialog::OnHelp(wxCommandEvent & WXUNUSED(event))
}
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
const bool Close)
@ -116,7 +116,7 @@ void ShowErrorDialog(wxWindow *parent,
// unused.
void ShowModelessErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
const bool Close)

View File

@ -27,7 +27,7 @@ class ErrorDialog /* not final */ : public wxDialogWrapper
public:
// constructors and destructors
ErrorDialog(wxWindow *parent,
const wxString & dlogTitle,
const TranslatableString & dlogTitle,
const wxString & message,
const wxString & helpPage,
const bool Close = true, const bool modal = true);
@ -46,14 +46,14 @@ private:
/// Displays an error dialog with a button that offers help
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
bool Close = true);
/// Displays a modeless error dialog with a button that offers help
void ShowModelessErrorDialog(wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &message,
const wxString &helpPage,
bool Close = true);

View File

@ -740,7 +740,7 @@ IMPLEMENT_CLASS(ToolBarDialog, wxDialogWrapper)
ToolBarDialog::ToolBarDialog(wxWindow* parent,
wxWindowID id,
const wxString& name,
const TranslatableString& name,
const wxPoint& pos):
wxDialogWrapper(parent, id, name, pos, wxSize(1, 1),
// Workaround for bug in __WXMSW__. No close box on a wxDialog unless wxSYSTEM_MENU is used.

View File

@ -151,7 +151,7 @@ class ToolBarDialog final : public wxDialogWrapper
ToolBarDialog(wxWindow* parent,
wxWindowID id,
const wxString& name = {},
const TranslatableString& name = {},
const wxPoint& pos = wxDefaultPosition);
~ToolBarDialog();

View File

@ -66,7 +66,7 @@ namespace {
class HtmlTextHelpDialog final : public BrowserDialog
{
public:
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
HtmlTextHelpDialog(wxWindow *pParent, const TranslatableString &title)
: BrowserDialog{ pParent, title }
{
#if !wxCHECK_VERSION(3, 0, 0)
@ -90,7 +90,7 @@ public:
/// in one place. Other considerations like screen readers are also
/// handled by having the code in one place.
void HelpSystem::ShowInfoDialog( wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &shortMsg,
const wxString &message,
const int xSize, const int ySize)
@ -100,7 +100,7 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX /*| wxDEFAULT_FRAME_STYLE */);
dlog.SetName(dlog.GetTitle());
dlog.SetName();
ShuttleGui S(&dlog, eIsCreating);
S.StartVerticalLay(1);
@ -125,7 +125,7 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent,
}
void HelpSystem::ShowHtmlText(wxWindow *pParent,
const wxString &Title,
const TranslatableString &Title,
const wxString &HtmlText,
bool bIsFile,
bool bModal)
@ -138,7 +138,7 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent,
// frame??
// Bug 1412 seems to be related to the extra frame.
auto pFrame = safenew wxFrame {
pParent, wxID_ANY, Title, wxDefaultPosition, wxDefaultSize,
pParent, wxID_ANY, Title.Translation(), wxDefaultPosition, wxDefaultSize,
#if defined(__WXMAC__)
// On OSX, the html frame can go behind the help dialog and if the help
// html frame is modal, you can't get back to it. Pressing escape gets
@ -220,7 +220,7 @@ void HelpSystem::ShowHtmlText(wxWindow *pParent,
pFrame->Layout();
pFrame->SetSizeHints(pWnd->GetSize());
pFrame->SetName(Title);
pFrame->SetName(Title.Translation());
if (bModal)
pWnd->ShowModal();
else {
@ -291,7 +291,7 @@ void HelpSystem::ShowHelp(wxWindow *parent,
Text.Replace( wxT("*URL*"), remoteURL );
// Always make the 'help on the internet' dialog modal.
// Fixes Bug 1411.
ShowHtmlText( parent, _("Help on the Internet"), Text, false, true );
ShowHtmlText( parent, XO("Help on the Internet"), Text, false, true );
}
else if( HelpMode == wxT("Local") || alwaysDefaultBrowser)
{
@ -301,7 +301,7 @@ void HelpSystem::ShowHelp(wxWindow *parent,
else
{
// Local file, Built-in browser
ShowHtmlText( parent, wxT(""), localFileName, true, bModal );
ShowHtmlText( parent, {}, localFileName, true, bModal );
}
}
@ -431,7 +431,7 @@ BEGIN_EVENT_TABLE(BrowserDialog, wxDialogWrapper)
END_EVENT_TABLE()
BrowserDialog::BrowserDialog(wxWindow *pParent, const wxString &title)
BrowserDialog::BrowserDialog(wxWindow *pParent, const TranslatableString &title)
: wxDialogWrapper{ pParent, ID, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER /*| wxMAXIMIZE_BOX */ }
{
int width, height;
@ -548,7 +548,7 @@ void LinkingHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
else
{
SetPage( HelpText( href.Mid( 10 )));
wxGetTopLevelParent(this)->SetLabel( TitleText( href.Mid( 10 )));
wxGetTopLevelParent(this)->SetLabel( TitleText( href.Mid( 10 )).Translation() );
}
}
else if( href.StartsWith(wxT("mailto:")) || href.StartsWith(wxT("file:")) )

View File

@ -40,7 +40,7 @@ class HelpSystem
public:
/// Displays cutable information in a text ctrl, with an OK button.
static void ShowInfoDialog( wxWindow *parent,
const wxString &dlogTitle,
const TranslatableString &dlogTitle,
const wxString &shortMsg,
const wxString &message,
const int xSize, const int ySize);
@ -53,7 +53,7 @@ public:
/// @param bModal Whether the resulting window should be modal or not.
/// Default is modeless dialogue
static void ShowHtmlText( wxWindow * pParent,
const wxString &Title,
const TranslatableString &Title,
const wxString &HtmlText,
bool bIsFile = false,
bool bModal = false);
@ -139,7 +139,7 @@ class BrowserDialog /* not final */ : public wxDialogWrapper
{
public:
enum { ID = 0 };
BrowserDialog(wxWindow *pParent, const wxString &title);
BrowserDialog(wxWindow *pParent, const TranslatableString &title);
void OnForward(wxCommandEvent & event);
void OnBackward(wxCommandEvent & event);

View File

@ -1989,14 +1989,14 @@ void MeterPanel::OnPreferences(wxCommandEvent & WXUNUSED(event))
wxRadioButton *vertical;
int meterRefreshRate = mMeterRefreshRate;
wxString title(mIsInput ? _("Recording Meter Options") : _("Playback Meter Options"));
auto title = mIsInput ? XO("Recording Meter Options") : XO("Playback Meter Options");
// Dialog is a child of the project, rather than of the toolbar.
// This determines where it pops up.
wxDialogWrapper dlg( FindProjectFrame( GetActiveProject() ),
wxID_ANY, title );
dlg.SetName(dlg.GetTitle());
dlg.SetName();
ShuttleGui S(&dlg, eIsCreating);
S.StartVerticalLay();
{

View File

@ -40,7 +40,7 @@ class MultiDialog final : public wxDialogWrapper
public:
MultiDialog(wxWindow * pParent,
wxString message,
wxString title,
const TranslatableString &title,
const wxChar **buttons, wxString boxMsg, bool log);
~MultiDialog() {};
@ -62,13 +62,13 @@ END_EVENT_TABLE()
MultiDialog::MultiDialog(wxWindow * pParent,
wxString message,
wxString title,
const TranslatableString &title,
const wxChar **buttons, wxString boxMsg, bool log)
: wxDialogWrapper(pParent, wxID_ANY, title,
wxDefaultPosition, wxDefaultSize,
wxCAPTION) // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU
{
SetName(GetTitle());
SetName();
wxBoxSizer *mainSizer;
{
@ -159,7 +159,7 @@ void MultiDialog::OnShowLog(wxCommandEvent & WXUNUSED(event))
int ShowMultiDialog(const wxString &message,
const wxString &title,
const TranslatableString &title,
const wxChar **buttons, const wxString &boxMsg, bool log)
{
wxWindow * pParent = wxTheApp->GetTopWindow();

View File

@ -17,6 +17,7 @@
#include <wx/defs.h>
#include <wx/chartype.h> // for typedef wxChar
class TranslatableString;
class wxString;
const wxString &DefaultMultiDialogMessage();
@ -24,7 +25,7 @@ const wxString &DefaultMultiDialogMessage();
// Display a dialog with radio buttons.
// Return the zero-based index of the chosen button.
int ShowMultiDialog(const wxString &message,
const wxString &title,
const TranslatableString &title,
const wxChar **buttons,
const wxString &boxMsg = DefaultMultiDialogMessage(),
bool log = true);

View File

@ -1166,7 +1166,7 @@ bool ProgressDialog::Create(const TranslatableString & title,
bool success = wxDialogWrapper::Create(parent,
wxID_ANY,
title.Translation(),
title,
wxDefaultPosition,
wxDefaultSize,
wxDEFAULT_DIALOG_STYLE |
@ -1176,7 +1176,7 @@ bool ProgressDialog::Create(const TranslatableString & title,
return false;
}
SetName(GetTitle()); // This was added for NVDA screen reader and may now be redundant.
SetName(); // This was added for NVDA screen reader and may now be redundant.
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT); // Ancient code. Is it still required?
{
@ -1540,11 +1540,6 @@ void ProgressDialog::SetMessage(const TranslatableString & message)
}
}
void ProgressDialog::SetTitle(const TranslatableString & message)
{
wxDialogWrapper::SetTitle( message.Translation() );
}
//
// Recursivaly search the window list for the given window.
//

View File

@ -103,8 +103,6 @@ public:
ProgressResult Update(int current, int total, const TranslatableString & message = {});
void SetMessage(const TranslatableString & message);
// overloads and hides the inherited function that takes naked wxString:
void SetTitle(const TranslatableString & title);
protected:
wxWindowRef mHadFocus;

View File

@ -59,11 +59,11 @@ const wxString &DefaultWarningFooter()
WarningDialog::WarningDialog(wxWindow *parent, const wxString &message,
const wxString &footer,
bool showCancelButton)
: wxDialogWrapper(parent, wxID_ANY, (wxString)_("Warning"),
: wxDialogWrapper(parent, wxID_ANY, XO("Warning"),
wxDefaultPosition, wxDefaultSize,
(showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX.
{
SetName(GetTitle());
SetName();
SetIcon(wxArtProvider::GetIcon(wxART_WARNING, wxART_MESSAGE_BOX));
ShuttleGui S(this, eIsCreating);

View File

@ -37,3 +37,23 @@ void wxTabTraversalWrapperCharHook(wxKeyEvent &event)
event.Skip();
}
void wxDialogWrapper::SetTitle(const TranslatableString & title)
{
wxDialog::SetTitle( title.Translation() );
}
void wxDialogWrapper::SetLabel(const TranslatableString & label)
{
wxDialog::SetLabel( label.Translation() );
}
void wxDialogWrapper::SetName(const TranslatableString & name)
{
wxDialog::SetName( name.Translation() );
}
void wxDialogWrapper::SetName()
{
wxDialog::SetName( wxDialog::GetTitle() );
}

View File

@ -79,20 +79,20 @@ public:
// Constructor with no modal flag - the new convention.
wxDialogWrapper(
wxWindow *parent, wxWindowID id,
const wxString& title,
const TranslatableString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
// Important: default window name localizes!
const wxString& name = _("Dialog"))
: wxTabTraversalWrapper<wxDialog>
( parent, id, title, pos, size, style, name )
( parent, id, title.Translation(), pos, size, style, name )
{}
// Pseudo ctor
bool Create(
wxWindow *parent, wxWindowID id,
const wxString& title,
const TranslatableString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
@ -100,9 +100,16 @@ public:
const wxString& name = _("Dialog"))
{
return wxTabTraversalWrapper<wxDialog>::Create(
parent, id, title, pos, size, style, name
parent, id, title.Translation(), pos, size, style, name
);
}
// overload and hide the inherited functions that take naked wxString:
void SetTitle(const TranslatableString & title);
void SetLabel(const TranslatableString & title);
void SetName(const TranslatableString & title);
// Set the name to equal the title:
void SetName();
};
#include <wx/dirdlg.h> // to inherit