Improve time remaining a little

This commit is contained in:
niksedk 2022-11-28 08:14:29 +01:00
parent ec45485c53
commit 840c2f010f
5 changed files with 11 additions and 0 deletions

View File

@ -860,6 +860,7 @@ Read more info (web)?</WhisperNotFound>
<XGeneratedWithBurnedInSubsInX>"{0}" generated with burned-in subtitle in {1}.</XGeneratedWithBurnedInSubsInX>
<TimeRemainingMinutes>Time remaining: {0} minutes</TimeRemainingMinutes>
<TimeRemainingSeconds>Time remaining: {0} seconds</TimeRemainingSeconds>
<TimeRemainingAFewSeconds>Time remaining: A few seconds</TimeRemainingAFewSeconds>
<TimeRemainingMinutesAndSeconds>Time remaining: {0} minutes and {1} seconds</TimeRemainingMinutesAndSeconds>
<TargetFileName>Target file name: {0}</TargetFileName>
<TargetFileSize>Target file size (requires 2 pass encoding)</TargetFileSize>

View File

@ -1087,6 +1087,7 @@ namespace Nikse.SubtitleEdit.Logic
XGeneratedWithBurnedInSubsInX = "\"{0}\" generated with burned-in subtitle in {1}.",
TimeRemainingMinutes = "Time remaining: {0} minutes",
TimeRemainingSeconds = "Time remaining: {0} seconds",
TimeRemainingAFewSeconds = "Time remaining: A few seconds",
TimeRemainingMinutesAndSeconds = "Time remaining: {0} minutes and {1} seconds",
TargetFileName = "Target file name: {0}",
TargetFileSize = "Target file size (requires 2 pass encoding)",

View File

@ -2275,6 +2275,9 @@ namespace Nikse.SubtitleEdit.Logic
case "GenerateVideoWithBurnedInSubs/TimeRemainingSeconds":
language.GenerateVideoWithBurnedInSubs.TimeRemainingSeconds = reader.Value;
break;
case "GenerateVideoWithBurnedInSubs/TimeRemainingAFewSeconds":
language.GenerateVideoWithBurnedInSubs.TimeRemainingAFewSeconds = reader.Value;
break;
case "GenerateVideoWithBurnedInSubs/TimeRemainingMinutesAndSeconds":
language.GenerateVideoWithBurnedInSubs.TimeRemainingMinutesAndSeconds = reader.Value;
break;

View File

@ -947,6 +947,7 @@ namespace Nikse.SubtitleEdit.Logic
public string XGeneratedWithBurnedInSubsInX { get; set; }
public string TimeRemainingMinutes { get; set; }
public string TimeRemainingSeconds { get; set; }
public string TimeRemainingAFewSeconds { get; set; }
public string TimeRemainingMinutesAndSeconds { get; set; }
public string TargetFileName { get; set; }
public string TargetFileSize { get; set; }

View File

@ -10,6 +10,11 @@ namespace Nikse.SubtitleEdit.Logic
var timeCode = new TimeCode(estimatedTotalMs);
if (timeCode.TotalSeconds < 60)
{
if (timeCode.TotalSeconds < 3)
{
return string.Format(LanguageSettings.Current.GenerateVideoWithBurnedInSubs.TimeRemainingAFewSeconds);
}
return string.Format(LanguageSettings.Current.GenerateVideoWithBurnedInSubs.TimeRemainingSeconds, (int)Math.Round(timeCode.TotalSeconds));
}