1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

AudacityMessageBox takes TranslatableString message and caption

This commit is contained in:
Paul Licameli
2019-12-07 14:30:07 -05:00
parent d8c2610d88
commit dc39f22442
77 changed files with 1005 additions and 748 deletions

View File

@@ -942,8 +942,9 @@ GStreamerImportFileHandle::Init()
// Add the decoder to the pipeline
if (!gst_bin_add(GST_BIN(mPipeline.get()), mDec))
{
AudacityMessageBox(_("Unable to add decoder to pipeline"),
_("GStreamer Importer"));
AudacityMessageBox(
XO("Unable to add decoder to pipeline"),
XO("GStreamer Importer"));
// Cleanup expected to occur in destructor
return false;
@@ -953,8 +954,9 @@ GStreamerImportFileHandle::Init()
GstStateChangeReturn state = gst_element_set_state(mPipeline.get(), GST_STATE_PAUSED);
if (state == GST_STATE_CHANGE_FAILURE)
{
AudacityMessageBox(_("Unable to set stream state to paused."),
_("GStreamer Importer"));
AudacityMessageBox(
XO("Unable to set stream state to paused."),
XO("GStreamer Importer"));
return false;
}
@@ -1082,8 +1084,9 @@ GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
// Can't do much if we don't have any streams to process
if (!haveStreams)
{
AudacityMessageBox(_("File doesn't contain any audio streams."),
_("GStreamer Importer"));
AudacityMessageBox(
XO("File doesn't contain any audio streams."),
XO("GStreamer Importer"));
return ProgressResult::Failed;
}
@@ -1091,8 +1094,9 @@ GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
GstStateChangeReturn state = gst_element_set_state(mPipeline.get(), GST_STATE_PLAYING);
if (state == GST_STATE_CHANGE_FAILURE)
{
AudacityMessageBox(_("Unable to import file, state change failed."),
_("GStreamer Importer"));
AudacityMessageBox(
XO("Unable to import file, state change failed."),
XO("GStreamer Importer"));
return ProgressResult::Failed;
}
@@ -1210,10 +1214,11 @@ GStreamerImportFileHandle::ProcessBusMessage(bool & success)
wxString::FromUTF8(err.get()->message),
debug ? wxT("\n") : wxT(""),
debug ? wxString::FromUTF8(debug.get()) : wxT(""));
auto msg = XO("GStreamer Error: %s").Format( m );
#if defined(_DEBUG)
AudacityMessageBox(wxString::Format(_("GStreamer Error: %s"), m));
AudacityMessageBox( msg );
#else
wxLogMessage(wxT("GStreamer Error: %s"), m);
wxLogMessage( msg.Debug() );
#endif
}

View File

@@ -344,9 +344,11 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
AudacityMessageBox(_("Invalid window offset in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
_("LOF Error"), wxOK | wxCENTRE);
AudacityMessageBox(
XO("Invalid window offset in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
XO("LOF Error"),
wxOK | wxCENTRE);
}
if (tok.HasMoreTokens())
@@ -365,9 +367,11 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
AudacityMessageBox(_("Invalid duration in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
_("LOF Error"), wxOK | wxCENTRE);
AudacityMessageBox(
XO("Invalid duration in LOF file."),
/* i18n-hint: You do not need to translate "LOF" */
XO("LOF Error"),
wxOK | wxCENTRE);
}
} // End if statement
@@ -457,8 +461,10 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
if (targetfile.AfterLast(wxT('.')).IsSameAs(wxT("mid"), false) ||
targetfile.AfterLast(wxT('.')).IsSameAs(wxT("midi"), false))
{
AudacityMessageBox(_("MIDI tracks cannot be offset individually, only audio files can be."),
_("LOF Error"), wxOK | wxCENTRE);
AudacityMessageBox(
XO("MIDI tracks cannot be offset individually, only audio files can be."),
XO("LOF Error"),
wxOK | wxCENTRE);
}
else
#endif
@@ -473,8 +479,10 @@ void LOFImportFileHandle::lofOpenFiles(wxString* ln)
else
{
/* i18n-hint: You do not need to translate "LOF" */
AudacityMessageBox(_("Invalid track offset in LOF file."),
_("LOF Error"), wxOK | wxCENTRE);
AudacityMessageBox(
XO("Invalid track offset in LOF file."),
XO("LOF Error"),
wxOK | wxCENTRE);
}
} // End if statement for "offset" parameters
} // End if statement (more tokens after file name)

View File

@@ -59,9 +59,8 @@ bool DoImportMIDI( AudacityProject &project, const FilePath &fileName )
bool ImportMIDI(const FilePath &fName, NoteTrack * dest)
{
if (fName.length() <= 4){
AudacityMessageBox( wxString::Format(
_("Could not open file %s: Filename too short."), fName
) );
AudacityMessageBox(
XO("Could not open file %s: Filename too short.").Format( fName ) );
return false;
}
@@ -69,17 +68,15 @@ bool ImportMIDI(const FilePath &fName, NoteTrack * dest)
if (fName.Right(4).CmpNoCase(wxT(".mid")) == 0 || fName.Right(5).CmpNoCase(wxT(".midi")) == 0)
is_midi = true;
else if(fName.Right(4).CmpNoCase(wxT(".gro")) != 0) {
AudacityMessageBox( wxString::Format(
_("Could not open file %s: Incorrect filetype."), fName
) );
AudacityMessageBox(
XO("Could not open file %s: Incorrect filetype.").Format( fName ) );
return false;
}
wxFFile mf(fName, wxT("rb"));
if (!mf.IsOpened()) {
AudacityMessageBox( wxString::Format(
_("Could not open file %s."), fName
) );
AudacityMessageBox(
XO("Could not open file %s.").Format( fName ) );
return false;
}
@@ -88,9 +85,8 @@ bool ImportMIDI(const FilePath &fName, NoteTrack * dest)
//Should we also check if(seq->tracks() == 0) ?
if(new_seq->get_read_error() == alg_error_open){
AudacityMessageBox( wxString::Format(
_("Could not open file %s."), fName
) );
AudacityMessageBox(
XO("Could not open file %s.").Format( fName ) );
mf.Close();
return false;
}

View File

@@ -270,7 +270,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
{
err = MovieAudioExtractionBegin(mMovie, 0, &maer);
if (err != noErr) {
AudacityMessageBox(_("Unable to start QuickTime extraction"));
AudacityMessageBox( XO("Unable to start QuickTime extraction") );
break;
}
@@ -280,7 +280,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
sizeof(quality),
&quality);
if (err != noErr) {
AudacityMessageBox(_("Unable to set QuickTime render quality"));
AudacityMessageBox( XO("Unable to set QuickTime render quality") );
break;
}
@@ -290,7 +290,8 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
sizeof(discrete),
&discrete);
if (err != noErr) {
AudacityMessageBox(_("Unable to set QuickTime discrete channels property"));
AudacityMessageBox( XO(
"Unable to set QuickTime discrete channels property") );
break;
}
@@ -301,7 +302,8 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
&maxSampleSize,
NULL);
if (err != noErr) {
AudacityMessageBox(_("Unable to get QuickTime sample size property"));
AudacityMessageBox( XO(
"Unable to get QuickTime sample size property") );
break;
}
@@ -312,7 +314,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
&desc,
NULL);
if (err != noErr) {
AudacityMessageBox(_("Unable to retrieve stream description"));
AudacityMessageBox( XO("Unable to retrieve stream description") );
break;
}
@@ -371,7 +373,7 @@ ProgressResult QTImportFileHandle::Import(TrackFactory *trackFactory,
abl.get(),
&flags);
if (err != noErr) {
AudacityMessageBox(_("Unable to get fill buffer"));
AudacityMessageBox( XO("Unable to get fill buffer") );
break;
}