mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
More work on #6058
This commit is contained in:
parent
8fe4943eda
commit
1304bccf75
@ -2205,6 +2205,7 @@ can edit in same subtitle file (collaboration)</Information>
|
||||
<AutoBackupEveryFiveMinutes>Every 5th minute</AutoBackupEveryFiveMinutes>
|
||||
<AutoBackupEveryFifteenMinutes>Every 15th minute</AutoBackupEveryFifteenMinutes>
|
||||
<AutoBackupDeleteAfter>Delete after</AutoBackupDeleteAfter>
|
||||
<TranslationAutoSuffix>Translation auto suffix</TranslationAutoSuffix>
|
||||
<AutoBackupDeleteAfterOneMonth>1 month</AutoBackupDeleteAfterOneMonth>
|
||||
<AutoBackupDeleteAfterXMonths>{0} months</AutoBackupDeleteAfterXMonths>
|
||||
<CheckForUpdates>Check for updates</CheckForUpdates>
|
||||
|
@ -4811,20 +4811,42 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
saveFileDialog1.InitialDirectory = openFileDialog1.InitialDirectory;
|
||||
}
|
||||
|
||||
var suffix = string.Empty;
|
||||
if (_subtitleOriginal != null && !string.IsNullOrEmpty(Configuration.Settings.General.TranslationAutoSuffixDefault))
|
||||
{
|
||||
if (Configuration.Settings.General.TranslationAutoSuffixDefault.StartsWith('<'))
|
||||
{
|
||||
var translationLangauge = LanguageAutoDetect.AutoDetectGoogleLanguageOrNull(_subtitle);
|
||||
if (!string.IsNullOrEmpty(translationLangauge))
|
||||
{
|
||||
suffix = "." + translationLangauge;
|
||||
}
|
||||
else
|
||||
{
|
||||
var originalLanguage = LanguageAutoDetect.AutoDetectGoogleLanguage(_subtitleOriginal);
|
||||
suffix = "." + GenericTranslate.EvaluateDefaultTargetLanguageCode(originalLanguage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
suffix = Configuration.Settings.General.TranslationAutoSuffixDefault;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_fileName) && Configuration.Settings.General.SaveAsUseFileNameFrom.Equals("file", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_fileName);
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_fileName) + suffix;
|
||||
saveFileDialog1.InitialDirectory = Path.GetDirectoryName(_fileName);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(_videoFileName) && Configuration.Settings.General.SaveAsUseFileNameFrom.Equals("video", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (_converted && !string.IsNullOrEmpty(_fileName) && !File.Exists(_fileName))
|
||||
{
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_fileName);
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_fileName) + suffix;
|
||||
}
|
||||
else
|
||||
{
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_videoFileName);
|
||||
saveFileDialog1.FileName = Utilities.GetFileNameWithoutExtension(_videoFileName) + suffix;
|
||||
}
|
||||
|
||||
saveFileDialog1.InitialDirectory = Path.GetDirectoryName(_videoFileName);
|
||||
|
@ -5962,6 +5962,9 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
case "Settings/AutoBackupDeleteAfter":
|
||||
language.Settings.AutoBackupDeleteAfter = reader.Value;
|
||||
break;
|
||||
case "Settings/TranslationAutoSuffix":
|
||||
language.Settings.TranslationAutoSuffix = reader.Value;
|
||||
break;
|
||||
case "Settings/AutoBackupDeleteAfterOneMonth":
|
||||
language.Settings.AutoBackupDeleteAfterOneMonth = reader.Value;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user