diff --git a/src/Menus.cpp b/src/Menus.cpp index 86b31a8ca..7b83124d4 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -4001,14 +4001,15 @@ void AudacityProject::OnTrackMoveBottom() void AudacityProject::MoveTrack(Track* target, MoveChoice choice) { - wxString direction; + wxString longDesc, shortDesc; auto pt = dynamic_cast(target); switch (choice) { case OnMoveTopID: - /* i18n-hint: where the track is moving to.*/ - direction = _("to Top"); + /* i18n-hint: Past tense of 'to move', as in 'moved audio track up'.*/ + longDesc = _("Moved '%s' to Top"); + shortDesc = _("Move Track to Top"); while (mTracks->CanMoveUp(target)) { if (mTracks->Move(target, true)) { @@ -4019,8 +4020,9 @@ void AudacityProject::MoveTrack(Track* target, MoveChoice choice) } break; case OnMoveBottomID: - /* i18n-hint: where the track is moving to.*/ - direction = _("to Bottom"); + /* i18n-hint: Past tense of 'to move', as in 'moved audio track up'.*/ + longDesc = _("Moved '%s' to Bottom"); + shortDesc = _("Move Track to Bottom"); while (mTracks->CanMoveDown(target)) { if (mTracks->Move(target, false)) { @@ -4032,24 +4034,24 @@ void AudacityProject::MoveTrack(Track* target, MoveChoice choice) break; default: bool bUp = (OnMoveUpID == choice); - /* i18n-hint: a direction.*/ - direction = bUp ? _("Up") : _("Down"); if (mTracks->Move(target, bUp)) { MixerBoard* pMixerBoard = this->GetMixerBoard(); if (pMixerBoard && pt) pMixerBoard->MoveTrackCluster(pt, bUp); } + longDesc = + /* i18n-hint: Past tense of 'to move', as in 'moved audio track up'.*/ + bUp? _("Moved '%s' Up") + : _("Moved '%s' Down"); + shortDesc = + /* i18n-hint: Past tense of 'to move', as in 'moved audio track up'.*/ + bUp? _("Move Track Up") + : _("Move Track Down"); + } - /* i18n-hint: Past tense of 'to move', as in 'moved audio track up'.*/ - wxString longDesc = (_("Moved")); - /* i18n-hint: The direction of movement will be up, down, to top or to bottom.. */ - wxString shortDesc = (_("Move Track")); - - longDesc = (wxString::Format(wxT("%s '%s' %s"), longDesc, - target->GetName(), direction)); - shortDesc = (wxString::Format(wxT("%s %s"), shortDesc, direction)); + longDesc = longDesc.Format(target->GetName()); PushState(longDesc, shortDesc); GetTrackPanel()->Refresh(false); @@ -7497,39 +7499,78 @@ void AudacityProject::HandleAlign(int index, bool moveSel) switch(index) { case kAlignStartZero: delta = -minOffset; - action = _("start to zero"); - shortAction = _("Start"); + action = moveSel + /* i18n-hint: In this and similar messages describing editing actions, + the starting or ending points of tracks are re-"aligned" to other + times, and the time selection may be "moved" too. The first + noun -- "start" in this example -- is the object of a verb (not of + an implied preposition "from"). */ + ? _("Aligned/Moved start to zero") + : _("Aligned start to zero"); + /* i18n-hint: This and similar messages give shorter descriptions of + the aligning and moving editing actions */ + shortAction = moveSel + ? _("Align/Move Start") + : _("Align Start"); break; case kAlignStartSelStart: delta = mViewInfo.selectedRegion.t0() - minOffset; - action = _("start to cursor/selection start"); - shortAction = _("Start"); + action = moveSel + ? _("Aligned/Moved start to cursor/selection start") + : _("Aligned start to cursor/selection start"); + shortAction = moveSel + ? _("Align/Move Start") + : _("Align Start"); break; case kAlignStartSelEnd: delta = mViewInfo.selectedRegion.t1() - minOffset; - action = _("start to selection end"); - shortAction = _("Start"); + action = moveSel + ? _("Aligned/Moved start to selection end") + : _("Aligned start to selection end"); + shortAction = moveSel + ? _("Align/Move Start") + : _("Align Start"); break; case kAlignEndSelStart: delta = mViewInfo.selectedRegion.t0() - maxEndOffset; - action = _("end to cursor/selection start"); - shortAction = _("End"); + action = moveSel + ? _("Aligned/Moved end to cursor/selection start") + : _("Aligned end to cursor/selection start"); + shortAction = + moveSel + ? _("Align/Move End") + : _("Align End"); break; case kAlignEndSelEnd: delta = mViewInfo.selectedRegion.t1() - maxEndOffset; - action = _("end to selection end"); - shortAction = _("End"); + action = moveSel + ? _("Aligned/Moved end to selection end") + : _("Aligned end to selection end"); + shortAction = + moveSel + ? _("Align/Move End") + : _("Align End"); break; // index set in alignLabelsNoSync case kAlignEndToEnd: newPos = firstTrackOffset; - action = _("end to end"); - shortAction = _("End to End"); + action = moveSel + ? _("Aligned/Moved end to end") + : _("Aligned end to end"); + shortAction = + moveSel + ? _("Align/Move End to End") + : _("Align End to End"); break; case kAlignTogether: newPos = avgOffset; - action = _("together"); - shortAction = _("Together"); + action = moveSel + ? _("Aligned/Moved together") + : _("Aligned together"); + shortAction = + moveSel + ? _("Align/Move Together") + : _("Align Together"); } if ((unsigned)index >= mAlignLabelsCount) { // This is an alignLabelsNoSync command. @@ -7598,16 +7639,10 @@ void AudacityProject::HandleAlign(int index, bool moveSel) } } - if (moveSel) { + if (moveSel) mViewInfo.selectedRegion.move(delta); - action = wxString::Format(_("Aligned/Moved %s"), action); - shortAction = wxString::Format(_("Align %s/Move"),shortAction); - PushState(action, shortAction); - } else { - action = wxString::Format(_("Aligned %s"), action); - shortAction = wxString::Format(_("Align %s"),shortAction); - PushState(action, shortAction); - } + + PushState(action, shortAction); RedrawProject(); } diff --git a/src/Project.cpp b/src/Project.cpp index f791c502d..af9b6feae 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -5799,8 +5799,6 @@ wxString AudacityProject::GetHoursMinsString(int iMinutes) { wxString sFormatted = wxEmptyString; - wxString sHours = wxEmptyString; - wxString sMins = wxEmptyString; if (iMinutes < 1) { // Less than a minute... @@ -5812,12 +5810,13 @@ wxString AudacityProject::GetHoursMinsString(int iMinutes) int iHours = iMinutes / 60; int iMins = iMinutes % 60; - // Use wxPLURAL to get strings - sHours = wxPLURAL("hour", "hours", iHours); - sMins = wxPLURAL("minute", "minutes", iMins); + auto sHours = + wxString::Format( wxPLURAL("%d hour", "%d hours", iHours), iHours ); + auto sMins = + wxString::Format( wxPLURAL("%d minute", "%d minutes", iMins), iMins ); /* i18n-hint: A time in hours and minutes. Only translate the "and". */ - sFormatted.Printf(_("%d %s and %d %s."), iHours, sHours, iMins, sMins); + sFormatted.Printf( _("%s and %s."), sHours, sMins); return sFormatted; } diff --git a/src/import/ImportPCM.cpp b/src/import/ImportPCM.cpp index c28001855..c943b0ae1 100644 --- a/src/import/ImportPCM.cpp +++ b/src/import/ImportPCM.cpp @@ -250,17 +250,28 @@ static wxString AskCopyOrEdit() wxBoxSizer *vbox; dialog.SetSizer(vbox = safenew wxBoxSizer(wxVERTICAL)); - wxStaticText *message = safenew wxStaticText(&dialog, -1, wxString::Format(_("\ -When importing uncompressed audio files you can either copy them \ -into the project, or read them directly from their current location (without copying).\n\n\ -Your current preference is set to %s.\n\n\ -\ -Reading the files directly allows you to play or edit them almost immediately. \ -This is less safe than copying in, because you must retain the files with their \ -original names in their original location.\n\ -File > Check Dependencies will show the original names and location of any files that you are reading directly.\n\n\ -\ -How do you want to import the current file(s)?"), oldCopyPref == wxT("copy") ? _("copy in") : _("read directly"))); + wxString clause1 = _( +"When importing uncompressed audio files you can either copy them into the project," +" or read them directly from their current location (without copying).\n\n" + ); + + wxString clause2 = oldCopyPref == wxT("copy") + ? _("Your current preference is set to copy in.\n\n") + : _("Your current preference is set to read directly.\n\n") + ; + + wxString clause3 = _( +"Reading the files directly allows you to play or edit them almost immediately. " +"This is less safe than copying in, because you must retain the files with their " +"original names in their original locations.\n" +"File > Check Dependencies will show the original names and locations of any files " +"that you are reading directly.\n\n" +"How do you want to import the current file(s)?" + ); + + wxStaticText *message = + safenew wxStaticText(&dialog, -1, clause1 + clause2 + clause3); + message->Wrap(500); message->SetName(message->GetLabel()); diff --git a/src/tracks/ui/TimeShiftHandle.cpp b/src/tracks/ui/TimeShiftHandle.cpp index 93e3d37fb..1a44ab1c6 100644 --- a/src/tracks/ui/TimeShiftHandle.cpp +++ b/src/tracks/ui/TimeShiftHandle.cpp @@ -879,14 +879,11 @@ UIHandle::Result TimeShiftHandle::Release consolidate = false; } else { - wxString direction = mClipMoveState.hSlideAmount > 0 ? - /* i18n-hint: a direction as in left or right.*/ - _("right") : - /* i18n-hint: a direction as in left or right.*/ - _("left"); - /* i18n-hint: %s is a direction like left or right */ - msg.Printf(_("Time shifted tracks/clips %s %.02f seconds"), - direction, fabs( mClipMoveState.hSlideAmount )); + msg.Printf( + ( mClipMoveState.hSlideAmount > 0 + ? _("Time shifted tracks/clips right %.02f seconds") + : _("Time shifted tracks/clips left %.02f seconds") ), + fabs( mClipMoveState.hSlideAmount ) ); consolidate = true; } pProject->PushState(msg, _("Time-Shift"), diff --git a/src/tracks/ui/TrackSelectHandle.cpp b/src/tracks/ui/TrackSelectHandle.cpp index 20050bc02..7de8482f2 100644 --- a/src/tracks/ui/TrackSelectHandle.cpp +++ b/src/tracks/ui/TrackSelectHandle.cpp @@ -187,13 +187,12 @@ UIHandle::Result TrackSelectHandle::Release wxASSERT( mpTrack ); if (mRearrangeCount != 0) { AudacityProject *const project = ::GetActiveProject(); - wxString dir; - /* i18n-hint: a direction as in up or down.*/ - dir = mRearrangeCount < 0 ? _("up") : _("down"); -/* i18n-hint: will substitute name of track for first %s, "up" or "down" for the other.*/ - project->PushState(wxString::Format(_("Moved '%s' %s"), - mpTrack->GetName(), - dir), + project->PushState( + wxString::Format( + /* i18n-hint: will substitute name of track for %s */ + ( mRearrangeCount < 0 ? _("Moved '%s' up") : _("Moved '%s' down") ), + mpTrack->GetName() + ), _("Move Track")); } // Bug 1677