1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

Some more uses of TranslatableString

This commit is contained in:
Paul Licameli 2019-12-14 01:49:57 -05:00
commit 5c2aa7ce2e
46 changed files with 409 additions and 297 deletions

View File

@ -137,6 +137,9 @@ public:
// non-virtual convenience function // non-virtual convenience function
const wxString GetTranslatedName(); const wxString GetTranslatedName();
// non-virtual convenience function
const TranslatableString &GetUntranslatedName();
// Parameters, if defined. false means no defined parameters. // Parameters, if defined. false means no defined parameters.
virtual bool DefineParams( ShuttleParams & WXUNUSED(S) ){ return false;}; virtual bool DefineParams( ShuttleParams & WXUNUSED(S) ){ return false;};
}; };

View File

@ -67,7 +67,7 @@ public:
// Get a description of the file type this importer can import. // Get a description of the file type this importer can import.
// Examples: "Ogg Vorbis", "MP3", "Uncompressed PCM" // Examples: "Ogg Vorbis", "MP3", "Uncompressed PCM"
virtual wxString GetPluginFormatDescription() = 0; virtual TranslatableString GetPluginFormatDescription() = 0;
// Get a list of extensions this plugin expects to be able to // Get a list of extensions this plugin expects to be able to
// import. If a filename matches any of these extensions, // import. If a filename matches any of these extensions,
@ -134,7 +134,7 @@ public:
// This is similar to GetImporterDescription, but if possible the // This is similar to GetImporterDescription, but if possible the
// importer will return a more specific description of the // importer will return a more specific description of the
// specific file that is open. // specific file that is open.
virtual wxString GetFileDescription() = 0; virtual TranslatableString GetFileDescription() = 0;
// Return stream descriptions list // Return stream descriptions list
virtual void GetStreamInfo(wxArrayString & streamInfo) = 0; virtual void GetStreamInfo(wxArrayString & streamInfo) = 0;

View File

@ -346,7 +346,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
for (const auto &format : l) { for (const auto &format : l) {
const Format *f = &format; const Format *f = &format;
wxString newfilter = f->formatName + wxT("|"); wxString newfilter = f->formatName.Translation() + wxT("|");
for (size_t i = 0; i < f->formatExtensions.size(); i++) { for (size_t i = 0; i < f->formatExtensions.size(); i++) {
if (!newfilter.Contains(wxT("*.") + f->formatExtensions[i] + wxT(";"))) if (!newfilter.Contains(wxT("*.") + f->formatExtensions[i] + wxT(";")))
newfilter += wxT("*.") + f->formatExtensions[i] + wxT(";"); newfilter += wxT("*.") + f->formatExtensions[i] + wxT(";");

View File

@ -170,9 +170,9 @@ static void RemoveDependencies(AudacityProject *project,
auto &dirManager = DirManager::Get( *project ); auto &dirManager = DirManager::Get( *project );
const auto &settings = ProjectSettings::Get( *project ); const auto &settings = ProjectSettings::Get( *project );
ProgressDialog progress ProgressDialog progress(
(_("Removing Dependencies"), XO("Removing Dependencies"),
_("Copying audio data into project...")); XO("Copying audio data into project..."));
auto updateResult = ProgressResult::Success; auto updateResult = ProgressResult::Success;
// Hash aliasedFiles based on their full paths and // Hash aliasedFiles based on their full paths and

View File

@ -202,12 +202,12 @@ int DirManager::RecursivelyEnumerateWithProgress(const FilePath &dirPath,
wxString filespec, wxString filespec,
bool bFiles, bool bDirs, bool bFiles, bool bDirs,
int progress_count, int progress_count,
const wxChar* message) const TranslatableString &message)
{ {
Maybe<ProgressDialog> progress{}; Maybe<ProgressDialog> progress{};
if (message) if (!message.empty())
progress.create( _("Progress"), message ); progress.create( XO("Progress"), message );
int count = RecursivelyEnumerate( int count = RecursivelyEnumerate(
dirPath, filePathArray, dirspec,filespec, dirPath, filePathArray, dirspec,filespec,
@ -284,7 +284,7 @@ int DirManager::RecursivelyRemoveEmptyDirs(const FilePath &dirPath,
} }
void DirManager::RecursivelyRemove(const FilePaths& filePathArray, int count, int bias, void DirManager::RecursivelyRemove(const FilePaths& filePathArray, int count, int bias,
int flags, const wxChar* message) int flags, const TranslatableString &message)
{ {
bool bFiles= (flags & kCleanFiles) != 0; bool bFiles= (flags & kCleanFiles) != 0;
bool bDirs = (flags & kCleanDirs) != 0; bool bDirs = (flags & kCleanDirs) != 0;
@ -292,8 +292,8 @@ void DirManager::RecursivelyRemove(const FilePaths& filePathArray, int count, in
Maybe<ProgressDialog> progress{}; Maybe<ProgressDialog> progress{};
if (message) if (!message.empty())
progress.create( _("Progress"), message ); progress.create( XO("Progress"), message );
auto nn = filePathArray.size(); auto nn = filePathArray.size();
for ( size_t ii = 0; ii < nn; ++ii ) { for ( size_t ii = 0; ii < nn; ++ii ) {
@ -451,7 +451,7 @@ DirManager::~DirManager()
CleanTempDir(); CleanTempDir();
//::wxRmdir(temp); //::wxRmdir(temp);
} else if( projFull.empty() && !mytemp.empty()) { } else if( projFull.empty() && !mytemp.empty()) {
CleanDir(mytemp, wxEmptyString, ".DS_Store", _("Cleaning project temporary files"), kCleanTopDirToo | kCleanDirsOnlyIfEmpty ); CleanDir(mytemp, wxEmptyString, ".DS_Store", XO("Cleaning project temporary files"), kCleanTopDirToo | kCleanDirsOnlyIfEmpty );
} }
} }
@ -464,7 +464,7 @@ void DirManager::CleanTempDir()
{ {
// with default flags (none) this does not clean the top directory, and may remove non-empty // with default flags (none) this does not clean the top directory, and may remove non-empty
// directories. // directories.
CleanDir(globaltemp, wxT("project*"), wxEmptyString, _("Cleaning up temporary files")); CleanDir(globaltemp, wxT("project*"), wxEmptyString, XO("Cleaning up temporary files"));
} }
// static // static
@ -472,7 +472,7 @@ void DirManager::CleanDir(
const FilePath &path, const FilePath &path,
const wxString &dirSpec, const wxString &dirSpec,
const wxString &fileSpec, const wxString &fileSpec,
const wxString &msg, const TranslatableString &msg,
int flags) int flags)
{ {
if (dontDeleteTempFiles) if (dontDeleteTempFiles)
@ -539,7 +539,7 @@ namespace {
fullPath, fullPath,
wxEmptyString, wxEmptyString,
wxEmptyString, wxEmptyString,
_("Cleaning up after failed save"), XO("Cleaning up after failed save"),
kCleanTopDirToo); kCleanTopDirToo);
} }
@ -687,8 +687,8 @@ DirManager::ProjectSetter::Impl::Impl(
{ {
/* i18n-hint: This title appears on a dialog that indicates the progress /* i18n-hint: This title appears on a dialog that indicates the progress
in doing something.*/ in doing something.*/
ProgressDialog progress(_("Progress"), ProgressDialog progress(XO("Progress"),
_("Saving project data files")); XO("Saving project data files"));
int total = dirManager.mBlockFileHash.size(); int total = dirManager.mBlockFileHash.size();
@ -790,7 +790,7 @@ void DirManager::ProjectSetter::Impl::Commit()
wxEmptyString, // EmptyString => ALL directories. wxEmptyString, // EmptyString => ALL directories.
// If the next line were wxEmptyString, ALL files would be removed. // If the next line were wxEmptyString, ALL files would be removed.
".DS_Store", // Other project files should already have been removed. ".DS_Store", // Other project files should already have been removed.
_("Cleaning up cache directories"), XO("Cleaning up cache directories"),
kCleanTopDirToo); kCleanTopDirToo);
//This destroys the empty dirs of the OD block files, which are yet to come. //This destroys the empty dirs of the OD block files, which are yet to come.
@ -1732,7 +1732,7 @@ void DirManager::RemoveOrphanBlockfiles()
wxEmptyString, // All files wxEmptyString, // All files
true, false, true, false,
mBlockFileHash.size(), // rough guess of how many BlockFiles will be found/processed, for progress mBlockFileHash.size(), // rough guess of how many BlockFiles will be found/processed, for progress
_("Inspecting project file data")); XO("Inspecting project file data"));
FilePaths orphanFilePathArray; FilePaths orphanFilePathArray;
this->FindOrphanBlockFiles( this->FindOrphanBlockFiles(
@ -1818,8 +1818,8 @@ void DirManager::WriteCacheToDisk()
if (numNeed == 0) if (numNeed == 0)
return; return;
ProgressDialog progress(_("Saving recorded audio"), ProgressDialog progress(XO("Saving recorded audio"),
_("Saving recorded audio to disk")); XO("Saving recorded audio to disk"));
iter = mBlockFileHash.begin(); iter = mBlockFileHash.begin();
int current = 0; int current = 0;

View File

@ -70,7 +70,7 @@ class PROFILE_DLL_API DirManager final
wxString filespec, wxString filespec,
bool bFiles, bool bDirs, bool bFiles, bool bDirs,
int progress_count, int progress_count,
const wxChar* message); const TranslatableString &message);
static int RecursivelyCountSubdirs( const FilePath &dirPath ); static int RecursivelyCountSubdirs( const FilePath &dirPath );
@ -79,7 +79,7 @@ class PROFILE_DLL_API DirManager final
ProgressDialog* pProgress = nullptr); ProgressDialog* pProgress = nullptr);
static void RecursivelyRemove(const FilePaths& filePathArray, int count, int bias, static void RecursivelyRemove(const FilePaths& filePathArray, int count, int bias,
int flags, const wxChar* message = nullptr); int flags, const TranslatableString &message = {});
// Type of a function that builds a block file, using attributes from XML // Type of a function that builds a block file, using attributes from XML
using BlockFileDeserializer = using BlockFileDeserializer =
@ -193,7 +193,7 @@ class PROFILE_DLL_API DirManager final
const FilePath &path, const FilePath &path,
const wxString &dirSpec, const wxString &dirSpec,
const wxString &fileSpec, const wxString &fileSpec,
const wxString &msg, const TranslatableString &msg,
int flags = 0); int flags = 0);
void FindMissingAliasFiles( void FindMissingAliasFiles(

View File

@ -156,8 +156,8 @@ void MixAndRender(TrackList *tracks, TrackFactory *trackFactory,
auto updateResult = ProgressResult::Success; auto updateResult = ProgressResult::Success;
{ {
ProgressDialog progress(_("Mix and Render"), ProgressDialog progress(XO("Mix and Render"),
_("Mixing and rendering tracks")); XO("Mixing and rendering tracks"));
while (updateResult == ProgressResult::Success) { while (updateResult == ProgressResult::Success) {
auto blockLen = mixer.Process(maxBlockLen); auto blockLen = mixer.Process(maxBlockLen);

View File

@ -982,15 +982,14 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
mLongestPath + wxT("\n") + mLongestPath + wxT("\n") +
mLongestPath + wxT("\n"); mLongestPath + wxT("\n");
wxString msg; auto msg = XO("Enabling effects or commands:\n\n%s").Format( last3 );
msg.Printf(_("Enabling effects or commands:\n\n%s"), last3);
// Make sure the progress dialog is deleted before we call EndModal() or // Make sure the progress dialog is deleted before we call EndModal() or
// we will leave the project window in an unusable state on OSX. // we will leave the project window in an unusable state on OSX.
// See bug #1192. // See bug #1192.
{ {
ProgressDialog progress(GetTitle(), msg, pdlgHideStopButton); ProgressDialog progress(
TranslatableString{ GetTitle() }, msg, pdlgHideStopButton);
progress.CenterOnParent(); progress.CenterOnParent();
int i = 0; int i = 0;
@ -1002,7 +1001,8 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
if (item.state == STATE_Enabled && item.plugs[0]->GetPluginType() == PluginTypeStub) if (item.state == STATE_Enabled && item.plugs[0]->GetPluginType() == PluginTypeStub)
{ {
last3 = last3.AfterFirst(wxT('\n')) + item.path + wxT("\n"); last3 = last3.AfterFirst(wxT('\n')) + item.path + wxT("\n");
auto status = progress.Update(++i, enableCount, wxString::Format(_("Enabling effect or command:\n\n%s"), last3)); auto status = progress.Update(++i, enableCount,
XO("Enabling effect or command:\n\n%s").Format( last3 ));
if (status == ProgressResult::Cancelled) if (status == ProgressResult::Cancelled)
{ {
break; break;
@ -3218,3 +3218,8 @@ const wxString ComponentInterface::GetTranslatedName()
{ {
return GetSymbol().Translation(); return GetSymbol().Translation();
} }
const TranslatableString &ComponentInterface::GetUntranslatedName()
{
return GetSymbol().Msgid();
}

View File

@ -111,11 +111,11 @@ public:
// Importer plugins only // Importer plugins only
const wxString & GetImporterIdentifier() const; const wxString & GetImporterIdentifier() const;
const wxString & GetImporterFilterDescription() const; const TranslatableString & GetImporterFilterDescription() const;
const FileExtensions & GetImporterExtensions() const; const FileExtensions & GetImporterExtensions() const;
void SetImporterIdentifier(const wxString & identifier); void SetImporterIdentifier(const wxString & identifier);
void SetImporterFilterDescription(const wxString & filterDesc); void SetImporterFilterDescription(const TranslatableString & filterDesc);
void SetImporterExtensions(FileExtensions extensions); void SetImporterExtensions(FileExtensions extensions);
private: private:

View File

@ -77,7 +77,7 @@ int ProjectFSCK(
wxEmptyString, // All files wxEmptyString, // All files
true, false, true, false,
dm.NumBlockFiles(), // rough guess of how many BlockFiles will be found/processed, for progress dm.NumBlockFiles(), // rough guess of how many BlockFiles will be found/processed, for progress
_("Inspecting project file data")); XO("Inspecting project file data"));
// //
// MISSING ALIASED AUDIO FILES // MISSING ALIASED AUDIO FILES
@ -360,9 +360,9 @@ other projects. \
if ((nResult != FSCKstatus_CLOSE_REQ) && !ODManager::HasLoadedODFlag()) if ((nResult != FSCKstatus_CLOSE_REQ) && !ODManager::HasLoadedODFlag())
{ {
// Remove any empty directories. // Remove any empty directories.
ProgressDialog pProgress ProgressDialog pProgress(
(_("Progress"), XO("Progress"),
_("Cleaning up unused directories in project data")); XO("Cleaning up unused directories in project data"));
// nDirCount is for updating pProgress. +1 because we may DELETE dirPath. // nDirCount is for updating pProgress. +1 because we may DELETE dirPath.
int nDirCount = DirManager::RecursivelyCountSubdirs(dirPath) + 1; int nDirCount = DirManager::RecursivelyCountSubdirs(dirPath) + 1;
DirManager::RecursivelyRemoveEmptyDirs(dirPath, nDirCount, &pProgress); DirManager::RecursivelyRemoveEmptyDirs(dirPath, nDirCount, &pProgress);

View File

@ -986,7 +986,7 @@ wxArrayString ProjectFileManager::ShowOpenDialog(const wxString &extraformat, co
/* this loop runs once per supported _format_ */ /* this loop runs once per supported _format_ */
const Format *f = &format; const Format *f = &format;
wxString newfilter = f->formatName + wxT("|"); wxString newfilter = f->formatName.Translation() + wxT("|");
// bung format name into string plus | separator // bung format name into string plus | separator
for (size_t i = 0; i < f->formatExtensions.size(); i++) { for (size_t i = 0; i < f->formatExtensions.size(); i++) {
/* this loop runs once per valid _file extension_ for file containing /* this loop runs once per valid _file extension_ for file containing
@ -1661,7 +1661,7 @@ bool ProjectFileManager::Import(
auto &dirManager = DirManager::Get( project ); auto &dirManager = DirManager::Get( project );
auto oldTags = Tags::Get( project ).shared_from_this(); auto oldTags = Tags::Get( project ).shared_from_this();
TrackHolders newTracks; TrackHolders newTracks;
wxString errorMessage; TranslatableString errorMessage;
{ {
// Backup Tags, before the import. Be prepared to roll back changes. // Backup Tags, before the import. Be prepared to roll back changes.
@ -1683,7 +1683,7 @@ bool ProjectFileManager::Import(
// Error message derived from Importer::Import // Error message derived from Importer::Import
// Additional help via a Help button links to the manual. // Additional help via a Help button links to the manual.
ShowErrorDialog(&GetProjectFrame( project ), _("Error Importing"), ShowErrorDialog(&GetProjectFrame( project ), _("Error Importing"),
errorMessage, wxT("Importing_Audio")); errorMessage.Translation(), wxT("Importing_Audio"));
} }
if (!success) if (!success)
return false; return false;

View File

@ -546,33 +546,34 @@ int TimerRecordDialog::RunWaitDialog()
ProjectAudioManager::Get( *pProject ).OnRecord(false); ProjectAudioManager::Get( *pProject ).OnRecord(false);
bool bIsRecording = true; bool bIsRecording = true;
wxString sPostAction = m_pTimerAfterCompleteChoiceCtrl->GetString(m_pTimerAfterCompleteChoiceCtrl->GetSelection()); auto sPostAction = TranslatableString{
m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() };
// Two column layout. // Two column layout.
TimerProgressDialog::MessageTable columns{ TimerProgressDialog::MessageTable columns{
{ {
_("Recording start:") , XO("Recording start:") ,
_("Duration:") , XO("Duration:") ,
_("Recording end:") , XO("Recording end:") ,
{} , {} ,
_("Automatic Save enabled:") , XO("Automatic Save enabled:") ,
_("Automatic Export enabled:") , XO("Automatic Export enabled:") ,
_("Action after Timer Recording:") , XO("Action after Timer Recording:") ,
}, },
{ {
GetDisplayDate(m_DateTime_Start) , GetDisplayDate(m_DateTime_Start) ,
m_TimeSpan_Duration.Format() , TranslatableString{ m_TimeSpan_Duration.Format() },
GetDisplayDate(m_DateTime_End) , GetDisplayDate(m_DateTime_End) ,
{} , {} ,
(m_bAutoSaveEnabled ? _("Yes") : _("No")) , (m_bAutoSaveEnabled ? XO("Yes") : XO("No")) ,
(m_bAutoExportEnabled ? _("Yes") : _("No")) , (m_bAutoExportEnabled ? XO("Yes") : XO("No")) ,
sPostAction , sPostAction ,
} }
}; };
TimerProgressDialog TimerProgressDialog
progress(m_TimeSpan_Duration.GetMilliseconds().GetValue(), progress(m_TimeSpan_Duration.GetMilliseconds().GetValue(),
_("Audacity Timer Record Progress"), XO("Audacity Timer Record Progress"),
columns, columns,
pdlgHideCancelButton | pdlgConfirmStopCancel); pdlgHideCancelButton | pdlgConfirmStopCancel);
@ -743,7 +744,7 @@ int TimerRecordDialog::ExecutePostRecordActions(bool bWasStopped) {
return iPostRecordAction; return iPostRecordAction;
} }
wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt ) TranslatableString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
{ {
#if defined(__WXMSW__) #if defined(__WXMSW__)
// On Windows, wxWidgets uses the system date control and it displays the // On Windows, wxWidgets uses the system date control and it displays the
@ -789,7 +790,7 @@ wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
// Use default formatting // Use default formatting
wxPrintf(wxT("%s\n"), dt.Format()); wxPrintf(wxT("%s\n"), dt.Format());
return dt.FormatDate() + wxT(" ") + dt.FormatTime(); return TranslatableString{ dt.FormatDate() + wxT(" ") + dt.FormatTime() };
} }
TimerRecordPathCtrl * TimerRecordDialog::NewPathControl(wxWindow *wParent, const int iID, TimerRecordPathCtrl * TimerRecordDialog::NewPathControl(wxWindow *wParent, const int iID,
@ -1057,26 +1058,27 @@ void TimerRecordDialog::UpdateEnd()
ProgressResult TimerRecordDialog::WaitForStart() ProgressResult TimerRecordDialog::WaitForStart()
{ {
// MY: The Waiting For Start dialog now shows what actions will occur after recording has completed // MY: The Waiting For Start dialog now shows what actions will occur after recording has completed
wxString sPostAction = m_pTimerAfterCompleteChoiceCtrl->GetString(m_pTimerAfterCompleteChoiceCtrl->GetSelection()); auto sPostAction = TranslatableString{
m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() };
// Two column layout. // Two column layout.
TimerProgressDialog::MessageTable columns{ TimerProgressDialog::MessageTable columns{
{ {
_("Waiting to start recording at:") , XO("Waiting to start recording at:") ,
_("Recording duration:") , XO("Recording duration:") ,
_("Scheduled to stop at:") , XO("Scheduled to stop at:") ,
{} , {} ,
_("Automatic Save enabled:") , XO("Automatic Save enabled:") ,
_("Automatic Export enabled:") , XO("Automatic Export enabled:") ,
_("Action after Timer Recording:") , XO("Action after Timer Recording:") ,
}, },
{ {
GetDisplayDate(m_DateTime_Start) , GetDisplayDate(m_DateTime_Start),
m_TimeSpan_Duration.Format() , TranslatableString{ m_TimeSpan_Duration.Format() },
GetDisplayDate(m_DateTime_End) , GetDisplayDate(m_DateTime_End) ,
{} , {} ,
(m_bAutoSaveEnabled ? _("Yes") : _("No")) , (m_bAutoSaveEnabled ? XO("Yes") : XO("No")) ,
(m_bAutoExportEnabled ? _("Yes") : _("No")) , (m_bAutoExportEnabled ? XO("Yes") : XO("No")) ,
sPostAction , sPostAction ,
}, },
}; };
@ -1084,12 +1086,12 @@ ProgressResult TimerRecordDialog::WaitForStart()
wxDateTime startWait_DateTime = wxDateTime::UNow(); wxDateTime startWait_DateTime = wxDateTime::UNow();
wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime; wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime;
TimerProgressDialog progress(waitDuration.GetMilliseconds().GetValue(), TimerProgressDialog progress(waitDuration.GetMilliseconds().GetValue(),
_("Audacity Timer Record - Waiting for Start"), XO("Audacity Timer Record - Waiting for Start"),
columns, columns,
pdlgHideStopButton | pdlgConfirmStopCancel | pdlgHideElapsedTime, pdlgHideStopButton | pdlgConfirmStopCancel | pdlgHideElapsedTime,
/* i18n-hint: "in" means after a duration of time, /* i18n-hint: "in" means after a duration of time,
which is shown below this string */ which is shown below this string */
_("Recording will commence in:")); XO("Recording will commence in:"));
auto updateResult = ProgressResult::Success; auto updateResult = ProgressResult::Success;
bool bIsRecording = false; bool bIsRecording = false;
@ -1104,27 +1106,28 @@ ProgressResult TimerRecordDialog::WaitForStart()
ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions) ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions)
{ {
wxString sAction = m_pTimerAfterCompleteChoiceCtrl->GetString(iActionIndex); auto sAction = TranslatableString{ m_pTimerAfterCompleteChoiceCtrl
wxString sCountdownLabel; ->GetString(iActionIndex) };
/* i18n-hint: %s is one of "Do nothing", "Exit Audacity", "Restart system", /* i18n-hint: %s is one of "Do nothing", "Exit Audacity", "Restart system",
or "Shutdown system", and or "Shutdown system", and
"in" means after a duration of time, shown below this string */ "in" means after a duration of time, shown below this string */
sCountdownLabel.Printf(_("%s in:"), sAction); auto sCountdownLabel = XO("%s in:").Format( sAction );
// Two column layout. // Two column layout.
TimerProgressDialog::MessageTable columns{ TimerProgressDialog::MessageTable columns{
{ {
_("Timer Recording completed.") , XO("Timer Recording completed.") ,
{} , {} ,
_("Recording Saved:") , XO("Recording Saved:") ,
_("Recording Exported:") , XO("Recording Exported:") ,
_("Action after Timer Recording:") , XO("Action after Timer Recording:") ,
}, },
{ {
{} , {} ,
{} , {} ,
((eCompletedActions & TR_ACTION_SAVED) ? _("Yes") : _("No")) , ((eCompletedActions & TR_ACTION_SAVED) ? XO("Yes") : XO("No")) ,
((eCompletedActions & TR_ACTION_EXPORTED) ? _("Yes") : _("No")) , ((eCompletedActions & TR_ACTION_EXPORTED) ? XO("Yes") : XO("No")) ,
sAction , sAction ,
}, },
}; };
@ -1135,7 +1138,7 @@ ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCo
wxDateTime dtActionTime = dtNow.Add(tsWait); wxDateTime dtActionTime = dtNow.Add(tsWait);
TimerProgressDialog dlgAction(tsWait.GetMilliseconds().GetValue(), TimerProgressDialog dlgAction(tsWait.GetMilliseconds().GetValue(),
_("Audacity Timer Record - Waiting"), XO("Audacity Timer Record - Waiting"),
columns, columns,
pdlgHideStopButton | pdlgHideElapsedTime, pdlgHideStopButton | pdlgHideElapsedTime,
sCountdownLabel); sCountdownLabel);

View File

@ -78,7 +78,7 @@ private:
void OnOK(wxCommandEvent& event); void OnOK(wxCommandEvent& event);
void OnHelpButtonClick(wxCommandEvent& event); void OnHelpButtonClick(wxCommandEvent& event);
wxString GetDisplayDate(wxDateTime & dt); TranslatableString GetDisplayDate(wxDateTime & dt);
void PopulateOrExchange(ShuttleGui& S); void PopulateOrExchange(ShuttleGui& S);
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;

View File

@ -208,10 +208,10 @@ bool AudacityCommand::DoAudacityCommand(wxWindow *parent,
bool skipFlag = CheckWhetherSkipAudacityCommand(); bool skipFlag = CheckWhetherSkipAudacityCommand();
if (skipFlag == false) if (skipFlag == false)
{ {
auto name = GetTranslatedName(); auto name = GetUntranslatedName();
ProgressDialog progress{ ProgressDialog progress{
name, name,
wxString::Format(_("Applying %s..."), name), XO("Applying %s...").Format( name ),
pdlgHideStopButton pdlgHideStopButton
}; };
auto vr = valueRestorer( mProgress, &progress ); auto vr = valueRestorer( mProgress, &progress );

View File

@ -1267,10 +1267,10 @@ bool Effect::DoEffect(wxWindow *parent,
bool skipFlag = CheckWhetherSkipEffect(); bool skipFlag = CheckWhetherSkipEffect();
if (skipFlag == false) if (skipFlag == false)
{ {
auto name = GetTranslatedName(); auto name = GetUntranslatedName();
ProgressDialog progress{ ProgressDialog progress{
name, name,
wxString::Format(_("Applying %s..."), name), XO("Applying %s...").Format( name ),
pdlgHideStopButton pdlgHideStopButton
}; };
auto vr = valueRestorer( mProgress, &progress ); auto vr = valueRestorer( mProgress, &progress );
@ -1996,7 +1996,7 @@ void Effect::IncludeNotSelectedPreviewTracks(bool includeNotSelected)
mPreviewWithNotSelected = includeNotSelected; mPreviewWithNotSelected = includeNotSelected;
} }
bool Effect::TotalProgress(double frac, const wxString &msg) bool Effect::TotalProgress(double frac, const TranslatableString &msg)
{ {
auto updateResult = (mProgress ? auto updateResult = (mProgress ?
mProgress->Update(frac, msg) : mProgress->Update(frac, msg) :
@ -2004,7 +2004,7 @@ bool Effect::TotalProgress(double frac, const wxString &msg)
return (updateResult != ProgressResult::Success); return (updateResult != ProgressResult::Success);
} }
bool Effect::TrackProgress(int whichTrack, double frac, const wxString &msg) bool Effect::TrackProgress(int whichTrack, double frac, const TranslatableString &msg)
{ {
auto updateResult = (mProgress ? auto updateResult = (mProgress ?
mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) : mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
@ -2012,7 +2012,7 @@ bool Effect::TrackProgress(int whichTrack, double frac, const wxString &msg)
return (updateResult != ProgressResult::Success); return (updateResult != ProgressResult::Success);
} }
bool Effect::TrackGroupProgress(int whichGroup, double frac, const wxString &msg) bool Effect::TrackGroupProgress(int whichGroup, double frac, const TranslatableString &msg)
{ {
auto updateResult = (mProgress ? auto updateResult = (mProgress ?
mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) : mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) :
@ -2398,8 +2398,8 @@ void Effect::Preview(bool dryOnly)
// Apply effect // Apply effect
if (!dryOnly) { if (!dryOnly) {
ProgressDialog progress{ ProgressDialog progress{
GetTranslatedName(), GetUntranslatedName(),
_("Preparing preview"), XO("Preparing preview"),
pdlgHideCancelButton pdlgHideCancelButton
}; // Have only "Stop" button. }; // Have only "Stop" button.
auto vr = valueRestorer( mProgress, &progress ); auto vr = valueRestorer( mProgress, &progress );
@ -2429,7 +2429,7 @@ void Effect::Preview(bool dryOnly)
// The progress dialog blocks these events. // The progress dialog blocks these events.
{ {
ProgressDialog progress ProgressDialog progress
(GetTranslatedName(), _("Previewing"), pdlgHideCancelButton); (GetUntranslatedName(), XO("Previewing"), pdlgHideCancelButton);
while (gAudioIO->IsStreamActive(token) && previewing == ProgressResult::Success) { while (gAudioIO->IsStreamActive(token) && previewing == ProgressResult::Success) {
::wxMilliSleep(100); ::wxMilliSleep(100);

View File

@ -335,15 +335,15 @@ protected:
// is okay, but don't try to undo). // is okay, but don't try to undo).
// Pass a fraction between 0.0 and 1.0 // Pass a fraction between 0.0 and 1.0
bool TotalProgress(double frac, const wxString & = {}); bool TotalProgress(double frac, const TranslatableString & = {});
// Pass a fraction between 0.0 and 1.0, for the current track // Pass a fraction between 0.0 and 1.0, for the current track
// (when doing one track at a time) // (when doing one track at a time)
bool TrackProgress(int whichTrack, double frac, const wxString & = {}); bool TrackProgress(int whichTrack, double frac, const TranslatableString & = {});
// Pass a fraction between 0.0 and 1.0, for the current track group // Pass a fraction between 0.0 and 1.0, for the current track group
// (when doing stereo groups at a time) // (when doing stereo groups at a time)
bool TrackGroupProgress(int whichGroup, double frac, const wxString & = {}); bool TrackGroupProgress(int whichGroup, double frac, const TranslatableString & = {});
int GetNumWaveTracks() { return mNumTracks; } int GetNumWaveTracks() { return mNumTracks; }
int GetNumWaveGroups() { return mNumGroups; } int GetNumWaveGroups() { return mNumGroups; }

View File

@ -174,7 +174,7 @@ bool EffectLoudness::Process()
// Iterate over each track // Iterate over each track
this->CopyInputTracks(); // Set up mOutputTracks. this->CopyInputTracks(); // Set up mOutputTracks.
bool bGoodResult = true; bool bGoodResult = true;
wxString topMsg = _("Normalizing Loudness...\n"); auto topMsg = XO("Normalizing Loudness...\n");
AllocBuffers(); AllocBuffers();
mProgressVal = 0; mProgressVal = 0;
@ -200,7 +200,7 @@ bool EffectLoudness::Process()
mSteps = 2; mSteps = 2;
mProgressMsg = mProgressMsg =
topMsg + wxString::Format(_("Analyzing: %s"), trackName); topMsg + XO("Analyzing: %s").Format( trackName );
auto range = mStereoInd auto range = mStereoInd
? TrackList::SingletonRange(track) ? TrackList::SingletonRange(track)
@ -258,7 +258,7 @@ bool EffectLoudness::Process()
mMult = sqrt(mMult); mMult = sqrt(mMult);
} }
mProgressMsg = topMsg + wxString::Format(_("Processing: %s"), trackName); mProgressMsg = topMsg + XO("Processing: %s").Format( trackName );
if(!ProcessOne(range, false)) if(!ProcessOne(range, false))
{ {
// Processing failed -> abort // Processing failed -> abort
@ -394,7 +394,7 @@ bool EffectLoudness::GetTrackRMS(WaveTrack* track, float& rms)
while (ProjectFileManager::GetODFlags(*track)) { while (ProjectFileManager::GetODFlags(*track)) {
// update the gui // update the gui
if (ProgressResult::Cancelled == mProgress->Update( if (ProgressResult::Cancelled == mProgress->Update(
0, _("Waiting for waveform to finish computing...")) ) 0, XO("Waiting for waveform to finish computing...")) )
return false; return false;
wxMilliSleep(100); wxMilliSleep(100);
} }

View File

@ -87,7 +87,7 @@ private:
double mCurT1; double mCurT1;
double mProgressVal; double mProgressVal;
int mSteps; int mSteps;
wxString mProgressMsg; TranslatableString mProgressMsg;
double mTrackLen; double mTrackLen;
double mCurRate; double mCurRate;

View File

@ -181,15 +181,15 @@ bool EffectNormalize::Process()
this->CopyInputTracks(); // Set up mOutputTracks. this->CopyInputTracks(); // Set up mOutputTracks.
bool bGoodResult = true; bool bGoodResult = true;
double progress = 0; double progress = 0;
wxString topMsg; TranslatableString topMsg;
if(mDC && mGain) if(mDC && mGain)
topMsg = _("Removing DC offset and Normalizing...\n"); topMsg = XO("Removing DC offset and Normalizing...\n");
else if(mDC && !mGain) else if(mDC && !mGain)
topMsg = _("Removing DC offset...\n"); topMsg = XO("Removing DC offset...\n");
else if(!mDC && mGain) else if(!mDC && mGain)
topMsg = _("Normalizing without removing DC offset...\n"); topMsg = XO("Normalizing without removing DC offset...\n");
else if(!mDC && !mGain) else if(!mDC && !mGain)
topMsg = _("Not doing anything...\n"); // shouldn't get here topMsg = XO("Not doing anything...\n"); // shouldn't get here
for ( auto track : mOutputTracks->Selected< WaveTrack >() for ( auto track : mOutputTracks->Selected< WaveTrack >()
+ ( mStereoInd ? &Track::Any : &Track::IsLeader ) ) { + ( mStereoInd ? &Track::Any : &Track::IsLeader ) ) {
@ -216,15 +216,13 @@ bool EffectNormalize::Process()
extent = std::numeric_limits<float>::lowest(); extent = std::numeric_limits<float>::lowest();
std::vector<float> offsets; std::vector<float> offsets;
wxString msg; auto msg = (range.size() == 1)
if (range.size() == 1)
// mono or 'stereo tracks independently' // mono or 'stereo tracks independently'
msg = topMsg + ? topMsg +
wxString::Format( _("Analyzing: %s"), trackName ); XO("Analyzing: %s").Format( trackName )
else : topMsg +
msg = topMsg +
// TODO: more-than-two-channels-message // TODO: more-than-two-channels-message
wxString::Format( _("Analyzing first track of stereo pair: %s"), trackName); XO("Analyzing first track of stereo pair: %s").Format( trackName );
// Analysis loop over channels collects offsets and extent // Analysis loop over channels collects offsets and extent
for (auto channel : range) { for (auto channel : range) {
@ -238,7 +236,7 @@ bool EffectNormalize::Process()
offsets.push_back(offset); offsets.push_back(offset);
// TODO: more-than-two-channels-message // TODO: more-than-two-channels-message
msg = topMsg + msg = topMsg +
wxString::Format( _("Analyzing second track of stereo pair: %s"), trackName ); XO("Analyzing second track of stereo pair: %s").Format( trackName );
} }
// Compute the multiplier using extent // Compute the multiplier using extent
@ -252,17 +250,17 @@ bool EffectNormalize::Process()
if (TrackList::Channels(track).size() == 1) if (TrackList::Channels(track).size() == 1)
// really mono // really mono
msg = topMsg + msg = topMsg +
wxString::Format( _("Processing: %s"), trackName ); XO("Processing: %s").Format( trackName );
else else
//'stereo tracks independently' //'stereo tracks independently'
// TODO: more-than-two-channels-message // TODO: more-than-two-channels-message
msg = topMsg + msg = topMsg +
wxString::Format( _("Processing stereo channels independently: %s"), trackName); XO("Processing stereo channels independently: %s").Format( trackName );
} }
else else
msg = topMsg + msg = topMsg +
// TODO: more-than-two-channels-message // TODO: more-than-two-channels-message
wxString::Format( _("Processing first track of stereo pair: %s"), trackName); XO("Processing first track of stereo pair: %s").Format( trackName );
// Use multiplier in the second, processing loop over channels // Use multiplier in the second, processing loop over channels
auto pOffset = offsets.begin(); auto pOffset = offsets.begin();
@ -272,7 +270,7 @@ bool EffectNormalize::Process()
goto break2; goto break2;
// TODO: more-than-two-channels-message // TODO: more-than-two-channels-message
msg = topMsg + msg = topMsg +
wxString::Format( _("Processing second track of stereo pair: %s"), trackName); XO("Processing second track of stereo pair: %s").Format( trackName );
} }
} }
} }
@ -359,7 +357,7 @@ bool EffectNormalize::TransferDataFromWindow()
// EffectNormalize implementation // EffectNormalize implementation
bool EffectNormalize::AnalyseTrack(const WaveTrack * track, const wxString &msg, bool EffectNormalize::AnalyseTrack(const WaveTrack * track, const TranslatableString &msg,
double &progress, float &offset, float &extent) double &progress, float &offset, float &extent)
{ {
bool result = true; bool result = true;
@ -373,7 +371,7 @@ bool EffectNormalize::AnalyseTrack(const WaveTrack * track, const wxString &msg,
while (ProjectFileManager::GetODFlags( *track )) { while (ProjectFileManager::GetODFlags( *track )) {
// update the gui // update the gui
if (ProgressResult::Cancelled == mProgress->Update( if (ProgressResult::Cancelled == mProgress->Update(
0, _("Waiting for waveform to finish computing...")) ) 0, XO("Waiting for waveform to finish computing...")) )
return false; return false;
wxMilliSleep(100); wxMilliSleep(100);
} }
@ -409,7 +407,7 @@ bool EffectNormalize::AnalyseTrack(const WaveTrack * track, const wxString &msg,
//AnalyseTrackData() takes a track, transforms it to bunch of buffer-blocks, //AnalyseTrackData() takes a track, transforms it to bunch of buffer-blocks,
//and executes selected AnalyseOperation on it... //and executes selected AnalyseOperation on it...
bool EffectNormalize::AnalyseTrackData(const WaveTrack * track, const wxString &msg, bool EffectNormalize::AnalyseTrackData(const WaveTrack * track, const TranslatableString &msg,
double &progress, AnalyseOperation op, float &offset) double &progress, AnalyseOperation op, float &offset)
{ {
bool rc = true; bool rc = true;
@ -477,7 +475,7 @@ bool EffectNormalize::AnalyseTrackData(const WaveTrack * track, const wxString &
// uses mMult and offset to normalize a track. // uses mMult and offset to normalize a track.
// mMult must be set before this is called // mMult must be set before this is called
bool EffectNormalize::ProcessOne( bool EffectNormalize::ProcessOne(
WaveTrack * track, const wxString &msg, double &progress, float offset) WaveTrack * track, const TranslatableString &msg, double &progress, float offset)
{ {
bool rc = true; bool rc = true;

View File

@ -64,10 +64,10 @@ private:
}; };
bool ProcessOne( bool ProcessOne(
WaveTrack * t, const wxString &msg, double& progress, float offset); WaveTrack * t, const TranslatableString &msg, double& progress, float offset);
bool AnalyseTrack(const WaveTrack * track, const wxString &msg, bool AnalyseTrack(const WaveTrack * track, const TranslatableString &msg,
double &progress, float &offset, float &extent); double &progress, float &offset, float &extent);
bool AnalyseTrackData(const WaveTrack * track, const wxString &msg, double &progress, bool AnalyseTrackData(const WaveTrack * track, const TranslatableString &msg, double &progress,
AnalyseOperation op, float &offset); AnalyseOperation op, float &offset);
void AnalyseDataDC(float *buffer, size_t len); void AnalyseDataDC(float *buffer, size_t len);
void ProcessData(float *buffer, size_t len, float offset); void ProcessData(float *buffer, size_t len, float offset);

View File

@ -1347,10 +1347,10 @@ bool NyquistEffect::ProcessOne()
// so notify the user that process has completed (bug 558) // so notify the user that process has completed (bug 558)
if ((rval != nyx_audio) && ((mCount + mCurNumChannels) == mNumSelectedChannels)) { if ((rval != nyx_audio) && ((mCount + mCurNumChannels) == mNumSelectedChannels)) {
if (mCurNumChannels == 1) { if (mCurNumChannels == 1) {
TrackProgress(mCount, 1.0, _("Processing complete.")); TrackProgress(mCount, 1.0, XO("Processing complete."));
} }
else { else {
TrackGroupProgress(mCount, 1.0, _("Processing complete.")); TrackGroupProgress(mCount, 1.0, XO("Processing complete."));
} }
} }

View File

@ -271,7 +271,7 @@ std::unique_ptr<Mixer> ExportPlugin::CreateMixer(const TrackList &tracks,
} }
void ExportPlugin::InitProgress(std::unique_ptr<ProgressDialog> &pDialog, void ExportPlugin::InitProgress(std::unique_ptr<ProgressDialog> &pDialog,
const wxString &title, const wxString &message) const TranslatableString &title, const TranslatableString &message)
{ {
if (!pDialog) if (!pDialog)
pDialog = std::make_unique<ProgressDialog>( title, message ); pDialog = std::make_unique<ProgressDialog>( title, message );
@ -283,9 +283,10 @@ void ExportPlugin::InitProgress(std::unique_ptr<ProgressDialog> &pDialog,
} }
void ExportPlugin::InitProgress(std::unique_ptr<ProgressDialog> &pDialog, void ExportPlugin::InitProgress(std::unique_ptr<ProgressDialog> &pDialog,
const wxFileNameWrapper &title, const wxString &message) const wxFileNameWrapper &title, const TranslatableString &message)
{ {
return InitProgress( pDialog, title.GetName(), message ); return InitProgress(
pDialog, TranslatableString{ title.GetName() }, message );
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -144,9 +144,9 @@ protected:
// Create or recycle a dialog. // Create or recycle a dialog.
static void InitProgress(std::unique_ptr<ProgressDialog> &pDialog, static void InitProgress(std::unique_ptr<ProgressDialog> &pDialog,
const wxString &title, const wxString &message); const TranslatableString &title, const TranslatableString &message);
static void InitProgress(std::unique_ptr<ProgressDialog> &pDialog, static void InitProgress(std::unique_ptr<ProgressDialog> &pDialog,
const wxFileNameWrapper &title, const wxString &message); const wxFileNameWrapper &title, const TranslatableString &message);
private: private:
std::vector<FormatInfo> mFormatInfos; std::vector<FormatInfo> mFormatInfos;

View File

@ -462,10 +462,10 @@ ProgressResult ExportCL::Export(AudacityProject *project,
} ); } );
// Prepare the progress display // Prepare the progress display
InitProgress( pDialog, _("Export"), InitProgress( pDialog, XO("Export"),
selectionOnly selectionOnly
? _("Exporting the selected audio using command-line encoder") ? XO("Exporting the selected audio using command-line encoder")
: _("Exporting the audio using command-line encoder") ); : XO("Exporting the audio using command-line encoder") );
auto &progress = *pDialog; auto &progress = *pDialog;
// Start piping the mixed data to the command // Start piping the mixed data to the command

View File

@ -912,10 +912,10 @@ ProgressResult ExportFFmpeg::Export(AudacityProject *project,
{ {
InitProgress( pDialog, fName, InitProgress( pDialog, fName,
selectionOnly selectionOnly
? wxString::Format(_("Exporting selected audio as %s"), ? XO("Exporting selected audio as %s")
ExportFFmpegOptions::fmts[mSubFormat].description.Translation()) .Format( ExportFFmpegOptions::fmts[mSubFormat].description )
: wxString::Format(_("Exporting the audio as %s"), : XO("Exporting the audio as %s")
ExportFFmpegOptions::fmts[mSubFormat].description.Translation()) ); .Format( ExportFFmpegOptions::fmts[mSubFormat].description ) );
auto &progress = *pDialog; auto &progress = *pDialog;
while (updateResult == ProgressResult::Success) { while (updateResult == ProgressResult::Success) {

View File

@ -381,8 +381,8 @@ ProgressResult ExportFLAC::Export(AudacityProject *project,
InitProgress( pDialog, fName, InitProgress( pDialog, fName,
selectionOnly selectionOnly
? _("Exporting the selected audio as FLAC") ? XO("Exporting the selected audio as FLAC")
: _("Exporting the audio as FLAC") ); : XO("Exporting the audio as FLAC") );
auto &progress = *pDialog; auto &progress = *pDialog;
while (updateResult == ProgressResult::Success) { while (updateResult == ProgressResult::Success) {

View File

@ -309,10 +309,10 @@ ProgressResult ExportMP2::Export(AudacityProject *project,
InitProgress( pDialog, fName, InitProgress( pDialog, fName,
selectionOnly selectionOnly
? wxString::Format(_("Exporting selected audio at %ld kbps"), ? XO("Exporting selected audio at %ld kbps")
bitrate) .Format( bitrate )
: wxString::Format(_("Exporting the audio at %ld kbps"), : XO("Exporting the audio at %ld kbps")
bitrate) ); .Format( bitrate ) );
auto &progress = *pDialog; auto &progress = *pDialog;
while (updateResult == ProgressResult::Success) { while (updateResult == ProgressResult::Success) {

View File

@ -1879,24 +1879,24 @@ ProgressResult ExportMP3::Export(AudacityProject *project,
channels, inSamples, true, channels, inSamples, true,
rate, int16Sample, true, mixerSpec); rate, int16Sample, true, mixerSpec);
wxString title; TranslatableString title;
if (rmode == MODE_SET) { if (rmode == MODE_SET) {
title.Printf(selectionOnly ? title = (selectionOnly ?
_("Exporting selected audio with %s preset") : XO("Exporting selected audio with %s preset") :
_("Exporting the audio with %s preset"), XO("Exporting the audio with %s preset"))
setRateNamesShort[brate].Translation()); .Format( setRateNamesShort[brate] );
} }
else if (rmode == MODE_VBR) { else if (rmode == MODE_VBR) {
title.Printf(selectionOnly ? title = (selectionOnly ?
_("Exporting selected audio with VBR quality %s") : XO("Exporting selected audio with VBR quality %s") :
_("Exporting the audio with VBR quality %s"), XO("Exporting the audio with VBR quality %s"))
varRateNames[brate].Translation()); .Format( varRateNames[brate] );
} }
else { else {
title.Printf(selectionOnly ? title = (selectionOnly ?
_("Exporting selected audio at %d Kbps") : XO("Exporting selected audio at %d Kbps") :
_("Exporting the audio at %d Kbps"), XO("Exporting the audio at %d Kbps"))
brate); .Format( brate );
} }
InitProgress( pDialog, fName, title ); InitProgress( pDialog, fName, title );

View File

@ -283,8 +283,8 @@ ProgressResult ExportOGG::Export(AudacityProject *project,
InitProgress( pDialog, fName, InitProgress( pDialog, fName,
selectionOnly selectionOnly
? _("Exporting the selected audio as Ogg Vorbis") ? XO("Exporting the selected audio as Ogg Vorbis")
: _("Exporting the audio as Ogg Vorbis") ); : XO("Exporting the audio as Ogg Vorbis") );
auto &progress = *pDialog; auto &progress = *pDialog;
while (updateResult == ProgressResult::Success && !eos) { while (updateResult == ProgressResult::Success && !eos) {

View File

@ -554,11 +554,10 @@ ProgressResult ExportPCM::Export(AudacityProject *project,
rate, format, true, mixerSpec); rate, format, true, mixerSpec);
InitProgress( pDialog, fName, InitProgress( pDialog, fName,
selectionOnly (selectionOnly
? wxString::Format(_("Exporting the selected audio as %s"), ? XO("Exporting the selected audio as %s")
formatStr) : XO("Exporting the audio as %s"))
: wxString::Format(_("Exporting the audio as %s"), .Format( formatStr ) );
formatStr) );
auto &progress = *pDialog; auto &progress = *pDialog;
while (updateResult == ProgressResult::Success) { while (updateResult == ProgressResult::Success) {

View File

@ -345,7 +345,7 @@ bool Importer::Import(const FilePath &fName,
TrackFactory *trackFactory, TrackFactory *trackFactory,
TrackHolders &tracks, TrackHolders &tracks,
Tags *tags, Tags *tags,
wxString &errorMessage) TranslatableString &errorMessage)
{ {
AudacityProject *pProj = GetActiveProject(); AudacityProject *pProj = GetActiveProject();
auto cleanup = valueRestorer( pProj->mbBusyImporting, true ); auto cleanup = valueRestorer( pProj->mbBusyImporting, true );
@ -356,7 +356,9 @@ bool Importer::Import(const FilePath &fName,
#ifdef USE_MIDI #ifdef USE_MIDI
// MIDI files must be imported, not opened // MIDI files must be imported, not opened
if (FileNames::IsMidi(fName)) { if (FileNames::IsMidi(fName)) {
errorMessage.Printf(_("\"%s\" \nis a MIDI file, not an audio file. \nAudacity cannot open this type of file for playing, but you can\nedit it by clicking File > Import > MIDI."), fName); errorMessage = XO(
"\"%s\" \nis a MIDI file, not an audio file. \nAudacity cannot open this type of file for playing, but you can\nedit it by clicking File > Import > MIDI.")
.Format( fName );
return false; return false;
} }
#endif #endif
@ -391,7 +393,7 @@ bool Importer::Import(const FilePath &fName,
// store localized strings! // store localized strings!
// The bad consequences of a change of locale are not severe -- only that // The bad consequences of a change of locale are not severe -- only that
// a default choice of file type for an open dialog is not remembered // a default choice of file type for an open dialog is not remembered
if (plugin->GetPluginFormatDescription().CompareTo(type) == 0) if (plugin->GetPluginFormatDescription().Translation() == type )
{ {
// This plugin corresponds to user-selected filter, try it first. // This plugin corresponds to user-selected filter, try it first.
wxLogDebug(wxT("Inserting %s"),plugin->GetPluginStringID()); wxLogDebug(wxT("Inserting %s"),plugin->GetPluginStringID());
@ -587,9 +589,8 @@ bool Importer::Import(const FilePath &fName,
{ {
if( unusableImportPlugin->SupportsExtension(extension) ) if( unusableImportPlugin->SupportsExtension(extension) )
{ {
errorMessage.Printf(_("This version of Audacity was not compiled with %s support."), errorMessage = XO("This version of Audacity was not compiled with %s support.")
unusableImportPlugin-> .Format( unusableImportPlugin->GetPluginFormatDescription() );
GetPluginFormatDescription());
return false; return false;
} }
} }
@ -601,101 +602,131 @@ bool Importer::Import(const FilePath &fName,
// if someone has sent us a .cda file, send them away // if someone has sent us a .cda file, send them away
if (extension.IsSameAs(wxT("cda"), false)) { if (extension.IsSameAs(wxT("cda"), false)) {
/* i18n-hint: %s will be the filename */ /* i18n-hint: %s will be the filename */
errorMessage.Printf(_("\"%s\" is an audio CD track. \nAudacity cannot open audio CDs directly. \nExtract (rip) the CD tracks to an audio format that \nAudacity can import, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is an audio CD track. \nAudacity cannot open audio CDs directly. \nExtract (rip) the CD tracks to an audio format that \nAudacity can import, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// playlist type files // playlist type files
if ((extension.IsSameAs(wxT("m3u"), false))||(extension.IsSameAs(wxT("ram"), false))||(extension.IsSameAs(wxT("pls"), false))) { if ((extension.IsSameAs(wxT("m3u"), false))||(extension.IsSameAs(wxT("ram"), false))||(extension.IsSameAs(wxT("pls"), false))) {
errorMessage.Printf(_("\"%s\" is a playlist file. \nAudacity cannot open this file because it only contains links to other files. \nYou may be able to open it in a text editor and download the actual audio files."), fName); errorMessage = XO(
"\"%s\" is a playlist file. \nAudacity cannot open this file because it only contains links to other files. \nYou may be able to open it in a text editor and download the actual audio files.")
.Format( fName );
return false; return false;
} }
//WMA files of various forms //WMA files of various forms
if ((extension.IsSameAs(wxT("wma"), false))||(extension.IsSameAs(wxT("asf"), false))) { if ((extension.IsSameAs(wxT("wma"), false))||(extension.IsSameAs(wxT("asf"), false))) {
errorMessage.Printf(_("\"%s\" is a Windows Media Audio file. \nAudacity cannot open this type of file due to patent restrictions. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a Windows Media Audio file. \nAudacity cannot open this type of file due to patent restrictions. \nYou need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
//AAC files of various forms (probably not encrypted) //AAC files of various forms (probably not encrypted)
if ((extension.IsSameAs(wxT("aac"), false))||(extension.IsSameAs(wxT("m4a"), false))||(extension.IsSameAs(wxT("m4r"), false))||(extension.IsSameAs(wxT("mp4"), false))) { if ((extension.IsSameAs(wxT("aac"), false))||(extension.IsSameAs(wxT("m4a"), false))||(extension.IsSameAs(wxT("m4r"), false))||(extension.IsSameAs(wxT("mp4"), false))) {
errorMessage.Printf(_("\"%s\" is an Advanced Audio Coding file.\nWithout the optional FFmpeg library, Audacity cannot open this type of file.\nOtherwise, you need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is an Advanced Audio Coding file.\nWithout the optional FFmpeg library, Audacity cannot open this type of file.\nOtherwise, you need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// encrypted itunes files // encrypted itunes files
if ((extension.IsSameAs(wxT("m4p"), false))) { if ((extension.IsSameAs(wxT("m4p"), false))) {
errorMessage.Printf(_("\"%s\" is an encrypted audio file. \nThese typically are from an online music store. \nAudacity cannot open this type of file due to the encryption. \nTry recording the file into Audacity, or burn it to audio CD then \nextract the CD track to a supported audio format such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is an encrypted audio file. \nThese typically are from an online music store. \nAudacity cannot open this type of file due to the encryption. \nTry recording the file into Audacity, or burn it to audio CD then \nextract the CD track to a supported audio format such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// Real Inc. files of various sorts // Real Inc. files of various sorts
if ((extension.IsSameAs(wxT("ra"), false))||(extension.IsSameAs(wxT("rm"), false))||(extension.IsSameAs(wxT("rpm"), false))) { if ((extension.IsSameAs(wxT("ra"), false))||(extension.IsSameAs(wxT("rm"), false))||(extension.IsSameAs(wxT("rpm"), false))) {
errorMessage.Printf(_("\"%s\" is a RealPlayer media file. \nAudacity cannot open this proprietary format. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a RealPlayer media file. \nAudacity cannot open this proprietary format. \nYou need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// Other notes-based formats // Other notes-based formats
if ((extension.IsSameAs(wxT("kar"), false))||(extension.IsSameAs(wxT("mod"), false))||(extension.IsSameAs(wxT("rmi"), false))) { if ((extension.IsSameAs(wxT("kar"), false))||(extension.IsSameAs(wxT("mod"), false))||(extension.IsSameAs(wxT("rmi"), false))) {
errorMessage.Printf(_("\"%s\" is a notes-based file, not an audio file. \nAudacity cannot open this type of file. \nTry converting it to an audio file such as WAV or AIFF and \nthen import it, or record it into Audacity."), fName); errorMessage = XO(
"\"%s\" is a notes-based file, not an audio file. \nAudacity cannot open this type of file. \nTry converting it to an audio file such as WAV or AIFF and \nthen import it, or record it into Audacity.")
.Format( fName );
return false; return false;
} }
// MusePack files // MusePack files
if ((extension.IsSameAs(wxT("mp+"), false))||(extension.IsSameAs(wxT("mpc"), false))||(extension.IsSameAs(wxT("mpp"), false))) { if ((extension.IsSameAs(wxT("mp+"), false))||(extension.IsSameAs(wxT("mpc"), false))||(extension.IsSameAs(wxT("mpp"), false))) {
errorMessage.Printf(_("\"%s\" is a Musepack audio file. \nAudacity cannot open this type of file. \nIf you think it might be an mp3 file, rename it to end with \".mp3\" \nand try importing it again. Otherwise you need to convert it to a supported audio \nformat, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a Musepack audio file. \nAudacity cannot open this type of file. \nIf you think it might be an mp3 file, rename it to end with \".mp3\" \nand try importing it again. Otherwise you need to convert it to a supported audio \nformat, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// WavPack files // WavPack files
if ((extension.IsSameAs(wxT("wv"), false))||(extension.IsSameAs(wxT("wvc"), false))) { if ((extension.IsSameAs(wxT("wv"), false))||(extension.IsSameAs(wxT("wvc"), false))) {
errorMessage.Printf(_("\"%s\" is a Wavpack audio file. \nAudacity cannot open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a Wavpack audio file. \nAudacity cannot open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// AC3 files // AC3 files
if ((extension.IsSameAs(wxT("ac3"), false))) { if ((extension.IsSameAs(wxT("ac3"), false))) {
errorMessage.Printf(_("\"%s\" is a Dolby Digital audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a Dolby Digital audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// Speex files // Speex files
if ((extension.IsSameAs(wxT("spx"), false))) { if ((extension.IsSameAs(wxT("spx"), false))) {
errorMessage.Printf(_("\"%s\" is an Ogg Speex audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is an Ogg Speex audio file. \nAudacity cannot currently open this type of file. \nYou need to convert it to a supported audio format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// Video files of various forms // Video files of various forms
if ((extension.IsSameAs(wxT("mpg"), false))||(extension.IsSameAs(wxT("mpeg"), false))||(extension.IsSameAs(wxT("avi"), false))||(extension.IsSameAs(wxT("wmv"), false))||(extension.IsSameAs(wxT("rv"), false))) { if ((extension.IsSameAs(wxT("mpg"), false))||(extension.IsSameAs(wxT("mpeg"), false))||(extension.IsSameAs(wxT("avi"), false))||(extension.IsSameAs(wxT("wmv"), false))||(extension.IsSameAs(wxT("rv"), false))) {
errorMessage.Printf(_("\"%s\" is a video file. \nAudacity cannot currently open this type of file. \nYou need to extract the audio to a supported format, such as WAV or AIFF."), fName); errorMessage = XO(
"\"%s\" is a video file. \nAudacity cannot currently open this type of file. \nYou need to extract the audio to a supported format, such as WAV or AIFF.")
.Format( fName );
return false; return false;
} }
// Audacity project // Audacity project
if (extension.IsSameAs(wxT("aup"), false)) { if (extension.IsSameAs(wxT("aup"), false)) {
errorMessage.Printf(_("\"%s\" is an Audacity Project file. \nUse the 'File > Open' command to open Audacity Projects."), fName); errorMessage = XO(
"\"%s\" is an Audacity Project file. \nUse the 'File > Open' command to open Audacity Projects.")
.Format( fName );
return false; return false;
} }
if( !wxFileExists(fName)){ if( !wxFileExists(fName)){
errorMessage.Printf(_("File \"%s\" not found."), fName); errorMessage = XO( "File \"%s\" not found.").Format( fName );
return false; return false;
} }
// we were not able to recognize the file type // we were not able to recognize the file type
errorMessage.Printf(_("Audacity did not recognize the type of the file '%s'.\nTry installing FFmpeg. For uncompressed files, also try File > Import > Raw Data."),fName); errorMessage = XO(
"Audacity did not recognize the type of the file '%s'.\nTry installing FFmpeg. For uncompressed files, also try File > Import > Raw Data.")
.Format( fName );
} }
else else
{ {
// We DO have a plugin for this file, but import failed. // We DO have a plugin for this file, but import failed.
wxString pluglist; TranslatableString pluglist;
for (const auto &plugin : compatiblePlugins) for (const auto &plugin : compatiblePlugins)
{ {
if (pluglist.empty()) if (pluglist.empty())
pluglist = plugin->GetPluginFormatDescription(); pluglist = plugin->GetPluginFormatDescription();
else else
pluglist = wxString::Format( _("%s, %s"), pluglist = XO("%s, %s")
pluglist, plugin->GetPluginFormatDescription() ); .Format( pluglist, plugin->GetPluginFormatDescription() );
} }
errorMessage.Printf(_("Audacity recognized the type of the file '%s'.\nImporters supposedly supporting such files are:\n%s,\nbut none of them understood this file format."),fName, pluglist); errorMessage = XO(
"Audacity recognized the type of the file '%s'.\nImporters supposedly supporting such files are:\n%s,\nbut none of them understood this file format.")
.Format( fName, pluglist );
} }
return false; return false;
@ -774,9 +805,9 @@ ImportFileHandle::~ImportFileHandle()
void ImportFileHandle::CreateProgress() void ImportFileHandle::CreateProgress()
{ {
wxFileName ff( mFilename ); wxFileName ff( mFilename );
wxString title;
title.Printf(_("Importing %s"), GetFileDescription()); auto title = XO("Importing %s").Format( GetFileDescription() );
mProgress = std::make_unique< ProgressDialog >( title, ff.GetFullName() ); mProgress = std::make_unique< ProgressDialog >(
title, TranslatableString{ ff.GetFullName() } );
} }

View File

@ -31,10 +31,10 @@ typedef bool (*progress_callback_t)( void *userData, float percent );
class Format { class Format {
public: public:
wxString formatName; TranslatableString formatName;
FileExtensions formatExtensions; FileExtensions formatExtensions;
Format(const wxString &_formatName, Format(const TranslatableString &_formatName,
FileExtensions _formatExtensions): FileExtensions _formatExtensions):
formatName(_formatName), formatName(_formatName),
formatExtensions( std::move( _formatExtensions ) ) formatExtensions( std::move( _formatExtensions ) )
@ -155,7 +155,7 @@ public:
TrackFactory *trackFactory, TrackFactory *trackFactory,
TrackHolders &tracks, TrackHolders &tracks,
Tags *tags, Tags *tags,
wxString &errorMessage); TranslatableString &errorMessage);
private: private:
static Importer mInstance; static Importer mInstance;

View File

@ -39,7 +39,7 @@ Licensed under the GNU General Public License v2 or later
#include "../widgets/ProgressDialog.h" #include "../widgets/ProgressDialog.h"
#define DESC _("FFmpeg-compatible files") #define DESC XO("FFmpeg-compatible files")
//TODO: remove non-audio extensions //TODO: remove non-audio extensions
#if defined(USE_FFMPEG) #if defined(USE_FFMPEG)
@ -180,7 +180,7 @@ public:
~FFmpegImportPlugin() { } ~FFmpegImportPlugin() { }
wxString GetPluginStringID() override { return wxT("libav"); } wxString GetPluginStringID() override { return wxT("libav"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
///! Probes the file and opens it if appropriate ///! Probes the file and opens it if appropriate
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
@ -204,7 +204,7 @@ public:
bool InitCodecs(); bool InitCodecs();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
///! Imports audio ///! Imports audio
@ -286,7 +286,7 @@ private:
}; };
wxString FFmpegImportPlugin::GetPluginFormatDescription() TranslatableString FFmpegImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -465,7 +465,7 @@ bool FFmpegImportFileHandle::InitCodecs()
return true; return true;
} }
wxString FFmpegImportFileHandle::GetFileDescription() TranslatableString FFmpegImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -49,7 +49,7 @@
#define FLAC_HEADER "fLaC" #define FLAC_HEADER "fLaC"
#define DESC _("FLAC files") #define DESC XO("FLAC files")
static const auto exts = { static const auto exts = {
wxT("flac"), wxT("flac"),
@ -134,7 +134,7 @@ class FLACImportPlugin final : public ImportPlugin
~FLACImportPlugin() { } ~FLACImportPlugin() { }
wxString GetPluginStringID() override { return wxT("libflac"); } wxString GetPluginStringID() override { return wxT("libflac"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -150,7 +150,7 @@ public:
bool Init(); bool Init();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks, ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
@ -285,7 +285,7 @@ FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *fra
}, MakeSimpleGuard(FLAC__STREAM_DECODER_WRITE_STATUS_ABORT) ); }, MakeSimpleGuard(FLAC__STREAM_DECODER_WRITE_STATUS_ABORT) );
} }
wxString FLACImportPlugin::GetPluginFormatDescription() TranslatableString FLACImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -425,7 +425,7 @@ bool FLACImportFileHandle::Init()
return true; return true;
} }
wxString FLACImportFileHandle::GetFileDescription() TranslatableString FLACImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -31,7 +31,7 @@ Licensed under the GNU General Public License v2 or later
#include <wx/window.h> #include <wx/window.h>
#include <wx/log.h> #include <wx/log.h>
#define DESC _("GStreamer-compatible files") #define DESC XO("GStreamer-compatible files")
// On Windows we don't have configure script to turn this on or off, // On Windows we don't have configure script to turn this on or off,
@ -165,7 +165,7 @@ public:
///\return true if successful, false otherwise ///\return true if successful, false otherwise
bool Init(); bool Init();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
///! Called by Import.cpp ///! Called by Import.cpp
@ -240,7 +240,7 @@ public:
///! Destructor ///! Destructor
virtual ~GStreamerImportPlugin(); virtual ~GStreamerImportPlugin();
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
wxString GetPluginStringID() override; wxString GetPluginStringID() override;
@ -323,7 +323,7 @@ GStreamerImportPlugin::~GStreamerImportPlugin()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Return the plugin description // Return the plugin description
wxString TranslatableString
GStreamerImportPlugin::GetPluginFormatDescription() GStreamerImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
@ -994,7 +994,7 @@ GStreamerImportFileHandle::Init()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Return file dialog filter description // Return file dialog filter description
wxString TranslatableString
GStreamerImportFileHandle::GetFileDescription() GStreamerImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;

View File

@ -96,7 +96,7 @@
#define BINARY_FILE_CHECK_BUFFER_SIZE 1024 #define BINARY_FILE_CHECK_BUFFER_SIZE 1024
#define DESC _("List of Files in basic text format") #define DESC XO("List of Files in basic text format")
static const auto exts = { static const auto exts = {
wxT("lof") wxT("lof")
@ -113,7 +113,7 @@ public:
~LOFImportPlugin() { } ~LOFImportPlugin() { }
wxString GetPluginStringID() override { return wxT("lof"); } wxString GetPluginStringID() override { return wxT("lof"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -126,7 +126,7 @@ public:
LOFImportFileHandle(const FilePath & name, std::unique_ptr<wxTextFile> &&file); LOFImportFileHandle(const FilePath & name, std::unique_ptr<wxTextFile> &&file);
~LOFImportFileHandle(); ~LOFImportFileHandle();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks, ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
@ -172,7 +172,7 @@ LOFImportFileHandle::LOFImportFileHandle
{ {
} }
wxString LOFImportPlugin::GetPluginFormatDescription() TranslatableString LOFImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -211,7 +211,7 @@ std::unique_ptr<ImportFileHandle> LOFImportPlugin::Open(const FilePath &filename
return std::make_unique<LOFImportFileHandle>(filename, std::move(file)); return std::make_unique<LOFImportFileHandle>(filename, std::move(file));
} }
wxString LOFImportFileHandle::GetFileDescription() TranslatableString LOFImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -45,7 +45,7 @@
#include "../prefs/QualityPrefs.h" #include "../prefs/QualityPrefs.h"
#include "../widgets/ProgressDialog.h" #include "../widgets/ProgressDialog.h"
#define DESC _("MP3 files") #define DESC XO("MP3 files")
static const auto exts = { static const auto exts = {
wxT("mp3"), wxT("mp3"),
@ -114,7 +114,7 @@ public:
~MP3ImportPlugin() { } ~MP3ImportPlugin() { }
wxString GetPluginStringID() override { return wxT("libmad"); } wxString GetPluginStringID() override { return wxT("libmad"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -131,7 +131,7 @@ public:
~MP3ImportFileHandle(); ~MP3ImportFileHandle();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks, ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
@ -172,7 +172,7 @@ inline float scale(mad_fixed_t sample)
} }
wxString MP3ImportPlugin::GetPluginFormatDescription() TranslatableString MP3ImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -190,7 +190,7 @@ std::unique_ptr<ImportFileHandle> MP3ImportPlugin::Open(const FilePath &Filename
return std::make_unique<MP3ImportFileHandle>(std::move(file), Filename); return std::make_unique<MP3ImportFileHandle>(std::move(file), Filename);
} }
wxString MP3ImportFileHandle::GetFileDescription() TranslatableString MP3ImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -45,7 +45,7 @@
#include "../widgets/ProgressDialog.h" #include "../widgets/ProgressDialog.h"
#define DESC _("Ogg Vorbis files") #define DESC XO("Ogg Vorbis files")
static const auto exts = { static const auto exts = {
wxT("ogg") wxT("ogg")
@ -88,7 +88,7 @@ public:
~OggImportPlugin() { } ~OggImportPlugin() { }
wxString GetPluginStringID() override { return wxT("liboggvorbis"); } wxString GetPluginStringID() override { return wxT("liboggvorbis"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -119,7 +119,7 @@ public:
} }
~OggImportFileHandle(); ~OggImportFileHandle();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks, ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
@ -158,7 +158,7 @@ private:
}; };
wxString OggImportPlugin::GetPluginFormatDescription() TranslatableString OggImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -218,7 +218,7 @@ static Importer::RegisteredImportPlugin registered{
std::make_unique< OggImportPlugin >() std::make_unique< OggImportPlugin >()
}; };
wxString OggImportFileHandle::GetFileDescription() TranslatableString OggImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -71,7 +71,7 @@
} }
#endif #endif
#define DESC _("WAV, AIFF, and other uncompressed types") #define DESC XO("WAV, AIFF, and other uncompressed types")
class PCMImportPlugin final : public ImportPlugin class PCMImportPlugin final : public ImportPlugin
{ {
@ -84,7 +84,7 @@ public:
~PCMImportPlugin() { } ~PCMImportPlugin() { }
wxString GetPluginStringID() override { return wxT("libsndfile"); } wxString GetPluginStringID() override { return wxT("libsndfile"); }
wxString GetPluginFormatDescription() override; TranslatableString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override; std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -97,7 +97,7 @@ public:
PCMImportFileHandle(const FilePath &name, SFFile &&file, SF_INFO info); PCMImportFileHandle(const FilePath &name, SFFile &&file, SF_INFO info);
~PCMImportFileHandle(); ~PCMImportFileHandle();
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks, ProgressResult Import(TrackFactory *trackFactory, TrackHolders &outTracks,
Tags *tags) override; Tags *tags) override;
@ -119,7 +119,7 @@ private:
sampleFormat mFormat; sampleFormat mFormat;
}; };
wxString PCMImportPlugin::GetPluginFormatDescription() TranslatableString PCMImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -220,9 +220,69 @@ PCMImportFileHandle::PCMImportFileHandle(const FilePath &name,
mFormat = floatSample; mFormat = floatSample;
} }
wxString PCMImportFileHandle::GetFileDescription() TranslatableString PCMImportFileHandle::GetFileDescription()
{ {
return SFCall<wxString>(sf_header_name, mInfo.format); // Library strings
// See the major_formats and subtype_formats tables in command.c in
// libsndfile for this list of possibilities
using Unevaluated = decltype(
/* major_formats */
XO("AIFF (Apple/SGI)")
, XO("AU (Sun/NeXT)")
, XO("AVR (Audio Visual Research)")
, XO("CAF (Apple Core Audio File)")
, XO("FLAC (FLAC Lossless Audio Codec)")
, XO("HTK (HMM Tool Kit)")
, XO("IFF (Amiga IFF/SVX8/SV16)")
, XO("MAT4 (GNU Octave 2.0 / Matlab 4.2)")
, XO("MAT5 (GNU Octave 2.1 / Matlab 5.0)")
, XO("MPC (Akai MPC 2k)")
, XO("OGG (OGG Container format)")
, XO("PAF (Ensoniq PARIS)")
, XO("PVF (Portable Voice Format)")
, XO("RAW (header-less)")
, XO("RF64 (RIFF 64)")
, XO("SD2 (Sound Designer II)")
, XO("SDS (Midi Sample Dump Standard)")
, XO("SF (Berkeley/IRCAM/CARL)")
, XO("VOC (Creative Labs)")
, XO("W64 (SoundFoundry WAVE 64)")
, XO("WAV (Microsoft)")
, XO("WAV (NIST Sphere)")
, XO("WAVEX (Microsoft)")
, XO("WVE (Psion Series 3)")
, XO("XI (FastTracker 2)")
);
using Unevaluated2 = decltype(
/* subtype_formats */
XO("Signed 8 bit PCM")
, XO("Signed 16 bit PCM")
, XO("Signed 24 bit PCM")
, XO("Signed 32 bit PCM")
, XO("Unsigned 8 bit PCM")
, XO("32 bit float")
, XO("64 bit float")
, XO("U-Law")
, XO("A-Law")
, XO("IMA ADPCM")
, XO("Microsoft ADPCM")
, XO("GSM 6.10")
, XO("32kbs G721 ADPCM")
, XO("24kbs G723 ADPCM")
, XO("12 bit DWVW")
, XO("16 bit DWVW")
, XO("24 bit DWVW")
, XO("VOX ADPCM")
, XO("16 bit DPCM")
, XO("8 bit DPCM")
, XO("Vorbis")
);
auto untranslated = SFCall<wxString>(sf_header_name, mInfo.format);
return TranslatableString{
untranslated, {} };
} }
auto PCMImportFileHandle::GetFileUncompressedBytes() -> ByteCount auto PCMImportFileHandle::GetFileUncompressedBytes() -> ByteCount

View File

@ -73,7 +73,7 @@ public:
// Get a description of the file type this importer can import. // Get a description of the file type this importer can import.
// Examples: "Ogg Vorbis", "MP3", "Uncompressed PCM" // Examples: "Ogg Vorbis", "MP3", "Uncompressed PCM"
virtual wxString GetPluginFormatDescription() = 0; virtual TranslatableString GetPluginFormatDescription() = 0;
// Get a list of extensions this plugin expects to be able to // Get a list of extensions this plugin expects to be able to
// import. If a filename matches any of these extensions, // import. If a filename matches any of these extensions,
@ -120,10 +120,10 @@ public:
// identify the filename being imported. // identify the filename being imported.
void CreateProgress(); void CreateProgress();
// This is similar to GetImporterDescription, but if possible the // This is similar to GetPluginFormatDescription, but if possible the
// importer will return a more specific description of the // importer will return a more specific description of the
// specific file that is open. // specific file that is open.
virtual wxString GetFileDescription() = 0; virtual TranslatableString GetFileDescription() = 0;
// Return an estimate of how many bytes the file will occupy once // Return an estimate of how many bytes the file will occupy once
// imported. In principle this may exceed main memory, so don't use // imported. In principle this may exceed main memory, so don't use
@ -162,13 +162,13 @@ class UnusableImportPlugin
{ {
public: public:
UnusableImportPlugin( UnusableImportPlugin(
const wxString &formatName, FileExtensions extensions): const TranslatableString &formatName, FileExtensions extensions):
mFormatName(formatName), mFormatName(formatName),
mExtensions( std::move( extensions ) ) mExtensions( std::move( extensions ) )
{ {
} }
wxString GetPluginFormatDescription() TranslatableString GetPluginFormatDescription()
{ {
return mFormatName; return mFormatName;
} }
@ -179,7 +179,7 @@ public:
} }
private: private:
wxString mFormatName; TranslatableString mFormatName;
const FileExtensions mExtensions; const FileExtensions mExtensions;
}; };

View File

@ -121,7 +121,7 @@ class QTImportPlugin final : public ImportPlugin
wxString GetPluginStringID() { return wxT("quicktime"); } wxString GetPluginStringID() { return wxT("quicktime"); }
wxString GetPluginFormatDescription(); TranslatableString GetPluginFormatDescription();
std::unique_ptr<ImportFileHandle> Open(const wxString & Filename) override; std::unique_ptr<ImportFileHandle> Open(const wxString & Filename) override;
unsigned SequenceNumber() const override; unsigned SequenceNumber() const override;
@ -147,7 +147,7 @@ class QTImportFileHandle final : public ImportFileHandle
} }
} }
wxString GetFileDescription() override; TranslatableString GetFileDescription() override;
ByteCount GetFileUncompressedBytes() override; ByteCount GetFileUncompressedBytes() override;
wxInt32 GetStreamCount() override wxInt32 GetStreamCount() override
@ -175,7 +175,7 @@ class QTImportFileHandle final : public ImportFileHandle
Movie mMovie; Movie mMovie;
}; };
wxString QTImportPlugin::GetPluginFormatDescription() TranslatableString QTImportPlugin::GetPluginFormatDescription()
{ {
return DESC; return DESC;
} }
@ -230,7 +230,7 @@ static Importer::RegisteredImportPlugin registered{
}; };
wxString QTImportFileHandle::GetFileDescription() TranslatableString QTImportFileHandle::GetFileDescription()
{ {
return DESC; return DESC;
} }

View File

@ -218,12 +218,10 @@ void ImportRaw(wxWindow *parent, const wxString &fileName,
totalFrames = 0; totalFrames = 0;
} }
wxString msg; auto msg = XO("Importing %s").Format( wxFileName::FileName(fileName).GetFullName() );
msg.Printf(_("Importing %s"), wxFileName::FileName(fileName).GetFullName());
/* i18n-hint: 'Raw' means 'unprocessed' here and should usually be tanslated.*/ /* i18n-hint: 'Raw' means 'unprocessed' here and should usually be tanslated.*/
ProgressDialog progress(_("Import Raw"), msg); ProgressDialog progress(XO("Import Raw"), msg);
size_t block; size_t block;
do { do {

View File

@ -762,11 +762,9 @@ void OnResample(const CommandContext &context)
auto flags = UndoPush::AUTOSAVE; auto flags = UndoPush::AUTOSAVE;
for (auto wt : tracks.Selected< WaveTrack >()) for (auto wt : tracks.Selected< WaveTrack >())
{ {
wxString msg; auto msg = XO("Resampling track %d").Format( ++ndx );
msg.Printf(_("Resampling track %d"), ++ndx); ProgressDialog progress(XO("Resample"), msg);
ProgressDialog progress(_("Resample"), msg);
// The resampling of a track may be stopped by the user. This might // The resampling of a track may be stopped by the user. This might
// leave a track with multiple clips in a partially resampled state. // leave a track with multiple clips in a partially resampled state.

View File

@ -467,7 +467,7 @@ void ExtImportPrefs::DoOnRuleTableSelect (int toprow)
if (item->filter_objects[i] != NULL) if (item->filter_objects[i] != NULL)
{ {
PluginList->InsertItem (i + shift, PluginList->InsertItem (i + shift,
item->filter_objects[i]->GetPluginFormatDescription()); item->filter_objects[i]->GetPluginFormatDescription().Translation());
} }
else else
{ {

View File

@ -998,19 +998,19 @@ ProgressDialog::ProgressDialog()
{ {
} }
ProgressDialog::ProgressDialog(const wxString & title, ProgressDialog::ProgressDialog(const TranslatableString & title,
const wxString & message /* = {}*/, const TranslatableString & message /* = {}*/,
int flags /* = pdlgDefaultFlags */, int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = {} */) const TranslatableString & sRemainingLabelText /* = {} */)
: wxDialogWrapper() : wxDialogWrapper()
{ {
Create(title, message, flags, sRemainingLabelText); Create(title, message, flags, sRemainingLabelText);
} }
ProgressDialog::ProgressDialog(const wxString & title, ProgressDialog::ProgressDialog(const TranslatableString & title,
const MessageTable &columns, const MessageTable &columns,
int flags /* = pdlgDefaultFlags */, int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = {} */) const TranslatableString & sRemainingLabelText /* = {} */)
: wxDialogWrapper() : wxDialogWrapper()
{ {
Create(title, columns, flags, sRemainingLabelText); Create(title, columns, flags, sRemainingLabelText);
@ -1110,16 +1110,17 @@ void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer,
// Join strings // Join strings
auto sText = column[0]; auto sText = column[0];
std::for_each( column.begin() + 1, column.end(), std::for_each( column.begin() + 1, column.end(),
[&](const wxString &text) { sText += wxT("\n") + text; }); [&](const TranslatableString &text)
{ sText.Join( text, wxT("\n") ); });
// Create a statictext object and add to the sizer // Create a statictext object and add to the sizer
wxStaticText* oText = safenew wxStaticText(this, wxStaticText* oText = safenew wxStaticText(this,
wxID_ANY, wxID_ANY,
sText, sText.Translation(),
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
wxALIGN_LEFT); wxALIGN_LEFT);
oText->SetName(sText); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) oText->SetName(sText.Translation()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
// If this is the first column then set the mMessage pointer so non-TimerRecord usages // If this is the first column then set the mMessage pointer so non-TimerRecord usages
// will still work correctly in SetMessage() // will still work correctly in SetMessage()
@ -1130,10 +1131,10 @@ void ProgressDialog::AddMessageAsColumn(wxBoxSizer * pSizer,
pSizer->Add(oText, 1, wxEXPAND | wxALL, 5); pSizer->Add(oText, 1, wxEXPAND | wxALL, 5);
} }
bool ProgressDialog::Create(const wxString & title, bool ProgressDialog::Create(const TranslatableString & title,
const wxString & message /* = {} */, const TranslatableString & message /* = {} */,
int flags /* = pdlgDefaultFlags */, int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = {} */) const TranslatableString & sRemainingLabelText /* = {} */)
{ {
MessageTable columns(1); MessageTable columns(1);
columns.back().push_back(message); columns.back().push_back(message);
@ -1143,16 +1144,16 @@ bool ProgressDialog::Create(const wxString & title,
// Record some values used in case of change of message // Record some values used in case of change of message
// TODO: make the following work in case of message tables // TODO: make the following work in case of message tables
wxClientDC dc(this); wxClientDC dc(this);
dc.GetMultiLineTextExtent(message, &mLastW, &mLastH); dc.GetMultiLineTextExtent(message.Translation(), &mLastW, &mLastH);
} }
return result; return result;
} }
bool ProgressDialog::Create(const wxString & title, bool ProgressDialog::Create(const TranslatableString & title,
const MessageTable & columns, const MessageTable & columns,
int flags /* = pdlgDefaultFlags */, int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = {} */) const TranslatableString & sRemainingLabelText /* = {} */)
{ {
Init(); Init();
@ -1165,7 +1166,7 @@ bool ProgressDialog::Create(const wxString & title,
bool success = wxDialogWrapper::Create(parent, bool success = wxDialogWrapper::Create(parent,
wxID_ANY, wxID_ANY,
title, title.Translation(),
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxDEFAULT_DIALOG_STYLE |
@ -1238,14 +1239,14 @@ bool ProgressDialog::Create(const wxString & title,
} }
// Customised "Remaining" label text // Customised "Remaining" label text
wxString sRemainingText = sRemainingLabelText; auto sRemainingText = sRemainingLabelText;
if (sRemainingText.empty()) { if (sRemainingText.empty()) {
sRemainingText = _("Remaining Time:"); sRemainingText = XO("Remaining Time:");
} }
window = safenew wxStaticText(this, window = safenew wxStaticText(this,
wxID_ANY, wxID_ANY,
sRemainingText, sRemainingText.Translation(),
wxDefaultPosition, wxDefaultPosition,
wxDefaultSize, wxDefaultSize,
wxALIGN_RIGHT); wxALIGN_RIGHT);
@ -1313,7 +1314,8 @@ bool ProgressDialog::Create(const wxString & title,
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(int value, const wxString & message) ProgressResult ProgressDialog::Update(
int value, const TranslatableString & message)
{ {
if (mCancel) if (mCancel)
{ {
@ -1406,7 +1408,8 @@ ProgressResult ProgressDialog::Update(int value, const wxString & message)
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(double current, const wxString & message) ProgressResult ProgressDialog::Update(
double current, const TranslatableString & message)
{ {
return Update((int)(current * 1000), message); return Update((int)(current * 1000), message);
} }
@ -1414,7 +1417,8 @@ ProgressResult ProgressDialog::Update(double current, const wxString & message)
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(wxULongLong_t current, wxULongLong_t total, const wxString & message) ProgressResult ProgressDialog::Update(
wxULongLong_t current, wxULongLong_t total, const TranslatableString & message)
{ {
if (total != 0) if (total != 0)
{ {
@ -1429,7 +1433,8 @@ ProgressResult ProgressDialog::Update(wxULongLong_t current, wxULongLong_t total
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(wxLongLong current, wxLongLong total, const wxString & message) ProgressResult ProgressDialog::Update(
wxLongLong current, wxLongLong total, const TranslatableString & message)
{ {
if (total.GetValue() != 0) if (total.GetValue() != 0)
{ {
@ -1444,7 +1449,8 @@ ProgressResult ProgressDialog::Update(wxLongLong current, wxLongLong total, cons
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(wxLongLong_t current, wxLongLong_t total, const wxString & message) ProgressResult ProgressDialog::Update(
wxLongLong_t current, wxLongLong_t total, const TranslatableString & message)
{ {
if (total != 0) if (total != 0)
{ {
@ -1459,7 +1465,8 @@ ProgressResult ProgressDialog::Update(wxLongLong_t current, wxLongLong_t total,
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(int current, int total, const wxString & message) ProgressResult ProgressDialog::Update(
int current, int total, const TranslatableString & message)
{ {
if (total != 0) if (total != 0)
{ {
@ -1474,7 +1481,8 @@ ProgressResult ProgressDialog::Update(int current, int total, const wxString & m
// //
// Update the time and, optionally, the message // Update the time and, optionally, the message
// //
ProgressResult ProgressDialog::Update(double current, double total, const wxString & message) ProgressResult ProgressDialog::Update(
double current, double total, const TranslatableString & message)
{ {
if (total != 0) if (total != 0)
{ {
@ -1489,15 +1497,15 @@ ProgressResult ProgressDialog::Update(double current, double total, const wxStri
// //
// Update the message text // Update the message text
// //
void ProgressDialog::SetMessage(const wxString & message) void ProgressDialog::SetMessage(const TranslatableString & message)
{ {
if (!message.empty()) if (!message.empty())
{ {
mMessage->SetLabel(message); mMessage->SetLabel(message.Translation());
int w, h; int w, h;
wxClientDC dc(mMessage); wxClientDC dc(mMessage);
dc.GetMultiLineTextExtent(message, &w, &h); dc.GetMultiLineTextExtent(message.Translation(), &w, &h);
bool sizeUpdated = false; bool sizeUpdated = false;
wxSize ds = GetClientSize(); wxSize ds = GetClientSize();
@ -1532,6 +1540,11 @@ void ProgressDialog::SetMessage(const wxString & message)
} }
} }
void ProgressDialog::SetTitle(const TranslatableString & message)
{
wxDialogWrapper::SetTitle( message.Translation() );
}
// //
// Recursivaly search the window list for the given window. // Recursivaly search the window list for the given window.
// //
@ -1634,10 +1647,10 @@ bool ProgressDialog::ConfirmAction(const wxString & sPrompt,
} }
TimerProgressDialog::TimerProgressDialog(const wxLongLong_t duration, TimerProgressDialog::TimerProgressDialog(const wxLongLong_t duration,
const wxString & title, const TranslatableString & title,
const MessageTable & columns, const MessageTable & columns,
int flags /* = pdlgDefaultFlags */, int flags /* = pdlgDefaultFlags */,
const wxString & sRemainingLabelText /* = {} */) const TranslatableString & sRemainingLabelText /* = {} */)
: ProgressDialog(title, columns, flags, sRemainingLabelText) : ProgressDialog(title, columns, flags, sRemainingLabelText)
{ {
mDuration = duration; mDuration = duration;

View File

@ -58,12 +58,12 @@ public:
ProgressDialog(); ProgressDialog();
// Display a simple message. // Display a simple message.
ProgressDialog(const wxString & title, ProgressDialog(const TranslatableString & title,
const wxString & message = {}, const TranslatableString & message = {},
int flags = pdlgDefaultFlags, int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = {}); const TranslatableString & sRemainingLabelText = {});
using MessageColumn = std::vector< wxString >; using MessageColumn = std::vector< TranslatableString >;
using MessageTable = std::vector< MessageColumn >; using MessageTable = std::vector< MessageColumn >;
protected: protected:
@ -72,36 +72,39 @@ protected:
// Each member of a column is a string that should have no newlines, // Each member of a column is a string that should have no newlines,
// and each column should have the same number of elements, to make // and each column should have the same number of elements, to make
// proper correspondences, but this is not checked. // proper correspondences, but this is not checked.
ProgressDialog(const wxString & title, ProgressDialog(const TranslatableString & title,
const MessageTable & columns, const MessageTable & columns,
int flags = pdlgDefaultFlags, int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = {}); const TranslatableString & sRemainingLabelText = {});
public: public:
virtual ~ProgressDialog(); virtual ~ProgressDialog();
bool Create(const wxString & title, bool Create(const TranslatableString & title,
const wxString & message = {}, const TranslatableString & message = {},
int flags = pdlgDefaultFlags, int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = {}); const TranslatableString & sRemainingLabelText = {});
void Reinit(); void Reinit();
protected: protected:
bool Create(const wxString & title, bool Create(const TranslatableString & title,
const MessageTable & columns, const MessageTable & columns,
int flags = pdlgDefaultFlags, int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = {}); const TranslatableString & sRemainingLabelText = {});
public: public:
ProgressResult Update(int value, const wxString & message = {}); ProgressResult Update(int value, const TranslatableString & message = {});
ProgressResult Update(double current, const wxString & message = {}); ProgressResult Update(double current, const TranslatableString & message = {});
ProgressResult Update(double current, double total, const wxString & message = {}); ProgressResult Update(double current, double total, const TranslatableString & message = {});
ProgressResult Update(wxULongLong_t current, wxULongLong_t total, const wxString & message = {}); ProgressResult Update(wxULongLong_t current, wxULongLong_t total, const TranslatableString & message = {});
ProgressResult Update(wxLongLong current, wxLongLong total, const wxString & message = {}); ProgressResult Update(wxLongLong current, wxLongLong total, const TranslatableString & message = {});
ProgressResult Update(wxLongLong_t current, wxLongLong_t total, const wxString & message = {}); ProgressResult Update(wxLongLong_t current, wxLongLong_t total, const TranslatableString & message = {});
ProgressResult Update(int current, int total, const wxString & message = {}); ProgressResult Update(int current, int total, const TranslatableString & message = {});
void SetMessage(const wxString & message);
void SetMessage(const TranslatableString & message);
// overloads and hides the inherited function that takes naked wxString:
void SetTitle(const TranslatableString & title);
protected: protected:
wxWindowRef mHadFocus; wxWindowRef mHadFocus;
@ -156,10 +159,10 @@ class AUDACITY_DLL_API TimerProgressDialog final : public ProgressDialog
{ {
public: public:
TimerProgressDialog(const wxLongLong_t duration, TimerProgressDialog(const wxLongLong_t duration,
const wxString &title, const TranslatableString &title,
const MessageTable & columns, const MessageTable & columns,
int flags = pdlgDefaultFlags, int flags = pdlgDefaultFlags,
const wxString & sRemainingLabelText = {}); const TranslatableString & sRemainingLabelText = {});
// Oh no, there is an inherited nullary "Update" in wxDialog! // Oh no, there is an inherited nullary "Update" in wxDialog!
// Choose another name then... // Choose another name then...