mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 16:37:12 +01:00
TranslatableString in ProgressDialog
This commit is contained in:
@@ -546,33 +546,34 @@ int TimerRecordDialog::RunWaitDialog()
|
||||
ProjectAudioManager::Get( *pProject ).OnRecord(false);
|
||||
bool bIsRecording = true;
|
||||
|
||||
wxString sPostAction = m_pTimerAfterCompleteChoiceCtrl->GetString(m_pTimerAfterCompleteChoiceCtrl->GetSelection());
|
||||
auto sPostAction = TranslatableString{
|
||||
m_pTimerAfterCompleteChoiceCtrl->GetStringSelection() };
|
||||
|
||||
// Two column layout.
|
||||
TimerProgressDialog::MessageTable columns{
|
||||
{
|
||||
_("Recording start:") ,
|
||||
_("Duration:") ,
|
||||
_("Recording end:") ,
|
||||
XO("Recording start:") ,
|
||||
XO("Duration:") ,
|
||||
XO("Recording end:") ,
|
||||
{} ,
|
||||
_("Automatic Save enabled:") ,
|
||||
_("Automatic Export enabled:") ,
|
||||
_("Action after Timer Recording:") ,
|
||||
XO("Automatic Save enabled:") ,
|
||||
XO("Automatic Export enabled:") ,
|
||||
XO("Action after Timer Recording:") ,
|
||||
},
|
||||
{
|
||||
GetDisplayDate(m_DateTime_Start) ,
|
||||
m_TimeSpan_Duration.Format() ,
|
||||
TranslatableString{ m_TimeSpan_Duration.Format() },
|
||||
GetDisplayDate(m_DateTime_End) ,
|
||||
{} ,
|
||||
(m_bAutoSaveEnabled ? _("Yes") : _("No")) ,
|
||||
(m_bAutoExportEnabled ? _("Yes") : _("No")) ,
|
||||
(m_bAutoSaveEnabled ? XO("Yes") : XO("No")) ,
|
||||
(m_bAutoExportEnabled ? XO("Yes") : XO("No")) ,
|
||||
sPostAction ,
|
||||
}
|
||||
};
|
||||
|
||||
TimerProgressDialog
|
||||
progress(m_TimeSpan_Duration.GetMilliseconds().GetValue(),
|
||||
_("Audacity Timer Record Progress"),
|
||||
XO("Audacity Timer Record Progress"),
|
||||
columns,
|
||||
pdlgHideCancelButton | pdlgConfirmStopCancel);
|
||||
|
||||
@@ -743,7 +744,7 @@ int TimerRecordDialog::ExecutePostRecordActions(bool bWasStopped) {
|
||||
return iPostRecordAction;
|
||||
}
|
||||
|
||||
wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
|
||||
TranslatableString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
|
||||
{
|
||||
#if defined(__WXMSW__)
|
||||
// On Windows, wxWidgets uses the system date control and it displays the
|
||||
@@ -789,7 +790,7 @@ wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
|
||||
|
||||
// Use default formatting
|
||||
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,
|
||||
@@ -1057,26 +1058,27 @@ void TimerRecordDialog::UpdateEnd()
|
||||
ProgressResult TimerRecordDialog::WaitForStart()
|
||||
{
|
||||
// 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.
|
||||
TimerProgressDialog::MessageTable columns{
|
||||
{
|
||||
_("Waiting to start recording at:") ,
|
||||
_("Recording duration:") ,
|
||||
_("Scheduled to stop at:") ,
|
||||
XO("Waiting to start recording at:") ,
|
||||
XO("Recording duration:") ,
|
||||
XO("Scheduled to stop at:") ,
|
||||
{} ,
|
||||
_("Automatic Save enabled:") ,
|
||||
_("Automatic Export enabled:") ,
|
||||
_("Action after Timer Recording:") ,
|
||||
XO("Automatic Save enabled:") ,
|
||||
XO("Automatic Export enabled:") ,
|
||||
XO("Action after Timer Recording:") ,
|
||||
},
|
||||
{
|
||||
GetDisplayDate(m_DateTime_Start) ,
|
||||
m_TimeSpan_Duration.Format() ,
|
||||
GetDisplayDate(m_DateTime_Start),
|
||||
TranslatableString{ m_TimeSpan_Duration.Format() },
|
||||
GetDisplayDate(m_DateTime_End) ,
|
||||
{} ,
|
||||
(m_bAutoSaveEnabled ? _("Yes") : _("No")) ,
|
||||
(m_bAutoExportEnabled ? _("Yes") : _("No")) ,
|
||||
(m_bAutoSaveEnabled ? XO("Yes") : XO("No")) ,
|
||||
(m_bAutoExportEnabled ? XO("Yes") : XO("No")) ,
|
||||
sPostAction ,
|
||||
},
|
||||
};
|
||||
@@ -1084,12 +1086,12 @@ ProgressResult TimerRecordDialog::WaitForStart()
|
||||
wxDateTime startWait_DateTime = wxDateTime::UNow();
|
||||
wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime;
|
||||
TimerProgressDialog progress(waitDuration.GetMilliseconds().GetValue(),
|
||||
_("Audacity Timer Record - Waiting for Start"),
|
||||
XO("Audacity Timer Record - Waiting for Start"),
|
||||
columns,
|
||||
pdlgHideStopButton | pdlgConfirmStopCancel | pdlgHideElapsedTime,
|
||||
/* i18n-hint: "in" means after a duration of time,
|
||||
which is shown below this string */
|
||||
_("Recording will commence in:"));
|
||||
XO("Recording will commence in:"));
|
||||
|
||||
auto updateResult = ProgressResult::Success;
|
||||
bool bIsRecording = false;
|
||||
@@ -1104,27 +1106,28 @@ ProgressResult TimerRecordDialog::WaitForStart()
|
||||
|
||||
ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions)
|
||||
{
|
||||
wxString sAction = m_pTimerAfterCompleteChoiceCtrl->GetString(iActionIndex);
|
||||
wxString sCountdownLabel;
|
||||
auto sAction = TranslatableString{ m_pTimerAfterCompleteChoiceCtrl
|
||||
->GetString(iActionIndex) };
|
||||
|
||||
/* i18n-hint: %s is one of "Do nothing", "Exit Audacity", "Restart system",
|
||||
or "Shutdown system", and
|
||||
"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.
|
||||
TimerProgressDialog::MessageTable columns{
|
||||
{
|
||||
_("Timer Recording completed.") ,
|
||||
XO("Timer Recording completed.") ,
|
||||
{} ,
|
||||
_("Recording Saved:") ,
|
||||
_("Recording Exported:") ,
|
||||
_("Action after Timer Recording:") ,
|
||||
XO("Recording Saved:") ,
|
||||
XO("Recording Exported:") ,
|
||||
XO("Action after Timer Recording:") ,
|
||||
},
|
||||
{
|
||||
{} ,
|
||||
{} ,
|
||||
((eCompletedActions & TR_ACTION_SAVED) ? _("Yes") : _("No")) ,
|
||||
((eCompletedActions & TR_ACTION_EXPORTED) ? _("Yes") : _("No")) ,
|
||||
((eCompletedActions & TR_ACTION_SAVED) ? XO("Yes") : XO("No")) ,
|
||||
((eCompletedActions & TR_ACTION_EXPORTED) ? XO("Yes") : XO("No")) ,
|
||||
sAction ,
|
||||
},
|
||||
};
|
||||
@@ -1135,7 +1138,7 @@ ProgressResult TimerRecordDialog::PreActionDelay(int iActionIndex, TimerRecordCo
|
||||
wxDateTime dtActionTime = dtNow.Add(tsWait);
|
||||
|
||||
TimerProgressDialog dlgAction(tsWait.GetMilliseconds().GetValue(),
|
||||
_("Audacity Timer Record - Waiting"),
|
||||
XO("Audacity Timer Record - Waiting"),
|
||||
columns,
|
||||
pdlgHideStopButton | pdlgHideElapsedTime,
|
||||
sCountdownLabel);
|
||||
|
||||
Reference in New Issue
Block a user