Merge pull request #537 from xylographe/larfm

Multi-language additions + minor refact (Forms/Main)
This commit is contained in:
Nikolaj Olsson 2015-02-18 09:06:05 +01:00
commit 749f8789c7
5 changed files with 93 additions and 38 deletions

View File

@ -65,6 +65,8 @@
<ControlsWindowTitle>Controls - {0}</ControlsWindowTitle>
<Advanced>Advanced</Advanced>
<Style>Style</Style>
<StyleLanguage>Style / Language</StyleLanguage>
<Character>Character</Character>
<Class>Class</Class>
<GeneralText>General</GeneralText>
<LineNumber>Line#</LineNumber>
@ -884,6 +886,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<TimedTextStyles>Timed Text styles...</TimedTextStyles>
<TimedTextSetLanguage>Timed Text - set language</TimedTextSetLanguage>
<SamiSetStyle>Sami - set class</SamiSetStyle>
<NuendoSetStyle>Nuendo - set character</NuendoSetStyle>
<Cut>Cut</Cut>
<Copy>Copy</Copy>
<Paste>Paste</Paste>
@ -1168,7 +1171,7 @@ Continue?</SubtitleAppendPrompt>
<BeforeSortX>Before sort: {0}</BeforeSortX>
<SortedByX>Sorted by: {0}</SortedByX>
<BeforeAutoBalanceSelectedLines>Before auto balance selected lines</BeforeAutoBalanceSelectedLines>
<NumberOfLinesAutoBalancedX>Number of lines auto balanced: {0}</NumberOfLinesAutoBalancedX>
<NumberOfLinesAutoBalancedX>Number of auto balanced lines: {0}</NumberOfLinesAutoBalancedX>
<BeforeRemoveLineBreaksInSelectedLines>Before remove line-breaks from selected lines</BeforeRemoveLineBreaksInSelectedLines>
<NumberOfWithRemovedLineBreakX>Number of lines with removed line-break: {0}</NumberOfWithRemovedLineBreakX>
<BeforeMultipleReplace>Before multiple replace</BeforeMultipleReplace>
@ -1186,6 +1189,7 @@ Continue?</SubtitleAppendPrompt>
<BeforeMergeShortLines>Before merge short lines</BeforeMergeShortLines>
<BeforeSplitLongLines>Before split long lines</BeforeSplitLongLines>
<MergedShortLinesX>Number of lines merged: {0}</MergedShortLinesX>
<BeforeDurationsBridgeGap>Before bridge small gaps</BeforeDurationsBridgeGap>
<BeforeSetMinimumDisplayTimeBetweenParagraphs>Before set minimum display time between subtitles</BeforeSetMinimumDisplayTimeBetweenParagraphs>
<XMinimumDisplayTimeBetweenParagraphsChanged>Number of lines with minimum display time between subtitles changed: {0}</XMinimumDisplayTimeBetweenParagraphsChanged>
<BeforeImportText>Before import plain text</BeforeImportText>
@ -1247,6 +1251,11 @@ Continue?</SubtitleAppendPrompt>
<ErrorLoadZip>This file seems to be a compressed .zip file. Subtitle Edit cannot open compressed files.</ErrorLoadZip>
<ErrorLoadPng>This file seems to be a PNG image file. Subtitle Edit cannot open PNG files.</ErrorLoadPng>
<ErrorLoadSrr>This file seems to be a ReScene .srr file - not a subtitle file.</ErrorLoadSrr>
<NoSupportEncryptedVobSub>Encrypted VobSub content is not supported.</NoSupportEncryptedVobSub>
<NoSupportHereBluRaySup>Blu-ray sup files are not supported here.</NoSupportHereBluRaySup>
<NoSupportHereDvdSup>DVD sup files are not supported here.</NoSupportHereDvdSup>
<NoSupportHereVobSub>VobSub files are not supported here.</NoSupportHereVobSub>
<NoSupportHereDivx>Divx files are not supported here.</NoSupportHereDivx>
</Main>
<MatroskaSubtitleChooser>
<Title>Choose subtitle from Matroska file</Title>

View File

@ -1303,28 +1303,29 @@ namespace Nikse.SubtitleEdit.Forms
labelAdjustTip.Text = _language.VideoControls.CreateTip;
//waveform
addParagraphHereToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.AddParagraphHere;
addParagraphAndPasteToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.AddParagraphHereAndPasteText;
deleteParagraphToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.DeleteParagraph;
toolStripMenuItemFocusTextbox.Text = Configuration.Settings.Language.Waveform.FocusTextBox;
var languageWaveform = Configuration.Settings.Language.Waveform;
addParagraphHereToolStripMenuItem.Text = languageWaveform.AddParagraphHere;
addParagraphAndPasteToolStripMenuItem.Text = languageWaveform.AddParagraphHereAndPasteText;
deleteParagraphToolStripMenuItem.Text = languageWaveform.DeleteParagraph;
toolStripMenuItemFocusTextbox.Text = languageWaveform.FocusTextBox;
splitToolStripMenuItem1.Text = Configuration.Settings.Language.Waveform.Split;
mergeWithPreviousToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.MergeWithPrevious;
mergeWithNextToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.MergeWithNext;
toolStripMenuItemWaveformPlaySelection.Text = Configuration.Settings.Language.Waveform.PlaySelection;
showWaveformAndSpectrogramToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.ShowWaveformAndSpectrogram;
showOnlyWaveformToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.ShowWaveformOnly;
showOnlySpectrogramToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.ShowSpectrogramOnly;
seekSilenceToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.SeekSilence;
guessTimeCodesToolStripMenuItem.Text = Configuration.Settings.Language.Waveform.GuessTimeCodes;
splitToolStripMenuItem1.Text = languageWaveform.Split;
mergeWithPreviousToolStripMenuItem.Text = languageWaveform.MergeWithPrevious;
mergeWithNextToolStripMenuItem.Text = languageWaveform.MergeWithNext;
toolStripMenuItemWaveformPlaySelection.Text = languageWaveform.PlaySelection;
showWaveformAndSpectrogramToolStripMenuItem.Text = languageWaveform.ShowWaveformAndSpectrogram;
showOnlyWaveformToolStripMenuItem.Text = languageWaveform.ShowWaveformOnly;
showOnlySpectrogramToolStripMenuItem.Text = languageWaveform.ShowSpectrogramOnly;
seekSilenceToolStripMenuItem.Text = languageWaveform.SeekSilence;
guessTimeCodesToolStripMenuItem.Text = languageWaveform.GuessTimeCodes;
toolStripButtonWaveformZoomOut.ToolTipText = Configuration.Settings.Language.Waveform.ZoomOut;
toolStripButtonWaveformZoomIn.ToolTipText = Configuration.Settings.Language.Waveform.ZoomIn;
toolStripButtonWaveformZoomOut.ToolTipText = languageWaveform.ZoomOut;
toolStripButtonWaveformZoomIn.ToolTipText = languageWaveform.ZoomIn;
if (Configuration.Settings.VideoControls.GenerateSpectrogram)
audioVisualizer.WaveformNotLoadedText = Configuration.Settings.Language.Waveform.ClickToAddWaveformAndSpectrogram;
audioVisualizer.WaveformNotLoadedText = languageWaveform.ClickToAddWaveformAndSpectrogram;
else
audioVisualizer.WaveformNotLoadedText = Configuration.Settings.Language.Waveform.ClickToAddWaveform;
audioVisualizer.WaveformNotLoadedText = languageWaveform.ClickToAddWaveform;
}
private void SetFormatToSubRip()
@ -3301,9 +3302,9 @@ namespace Nikse.SubtitleEdit.Forms
if (format.GetType() == typeof(Sami) || format.GetType() == typeof(SamiModern))
SubtitleListview1.ShowExtraColumn(_languageGeneral.Class);
else if (format.GetType() == typeof(TimedText10) || format.GetType() == typeof(ItunesTimedText))
SubtitleListview1.ShowExtraColumn("Style / Language");
SubtitleListview1.ShowExtraColumn(_languageGeneral.StyleLanguage);
else if (format.Name == "Nuendo")
SubtitleListview1.ShowExtraColumn("Character"); //TODO: Put in language xml file
SubtitleListview1.ShowExtraColumn(_languageGeneral.Character);
else
SubtitleListview1.ShowExtraColumn(_languageGeneral.Style);
@ -5573,12 +5574,12 @@ namespace Nikse.SubtitleEdit.Forms
toolStripMenuItemSetLanguage.DropDownItems.Add("-");
}
toolStripMenuItemSetLanguage.DropDownItems.Add("New");
toolStripMenuItemSetLanguage.DropDownItems.Add(_language.New);
var newItem = (ToolStripMenuItem)toolStripMenuItemSetLanguage.DropDownItems[toolStripMenuItemSetLanguage.DropDownItems.Count - 1];
var moreLanguages = new List<string>();
foreach (CultureInfo x in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
{
if (!languages.Contains(x.TwoLetterISOLanguageName.ToLower()) && !languages.Contains(x.TwoLetterISOLanguageName.ToLower()))
if (!languages.Contains(x.TwoLetterISOLanguageName.ToLower()) && !languages.Contains(x.ThreeLetterISOLanguageName.ToLower()))
moreLanguages.Add(x.TwoLetterISOLanguageName.ToLower());
}
moreLanguages.Sort();
@ -5627,7 +5628,7 @@ namespace Nikse.SubtitleEdit.Forms
}
setStylesForSelectedLinesToolStripMenuItem.Visible = styles.Count > 1;
toolStripMenuItemAssStyles.Visible = false;
setStylesForSelectedLinesToolStripMenuItem.Text = "Set character"; //TODO: Set language _language.Menu.ContextMenu.TimedTextStyles;
setStylesForSelectedLinesToolStripMenuItem.Text = _language.Menu.ContextMenu.NuendoSetStyle;
}
else
{
@ -8805,7 +8806,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (matroskaSubtitleInfo.ContentEncodingType == 1)
{
MessageBox.Show("Encrypted VobSub content not supported");
MessageBox.Show(_language.NoSupportEncryptedVobSub);
}
ShowStatus(_language.ParsingMatroskaFile);
@ -8898,7 +8899,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (matroskaSubtitleInfo.ContentEncodingType == 1)
{
MessageBox.Show("Encrypted vobsub content not supported");
MessageBox.Show(_language.NoSupportEncryptedVobSub);
}
ShowStatus(_language.ParsingMatroskaFile);
@ -11065,7 +11066,7 @@ namespace Nikse.SubtitleEdit.Forms
return new string(charArray);
}
private static string ReverseParethesis(string s)
private static string ReverseParenthesis(string s)
{
const string k = "@__<<>___@";
@ -11118,9 +11119,9 @@ namespace Nikse.SubtitleEdit.Forms
}
if (startsWithItalic)
newLines.Append("<i>");
newLines.Append(ReverseParethesis(post.ToString()));
newLines.Append(ReverseParenthesis(post.ToString()));
newLines.Append(s2.Substring(pre.Length, s2.Length - (pre.Length + post.Length)));
newLines.Append(ReverseParethesis(ReverseString(pre.ToString())));
newLines.Append(ReverseParenthesis(ReverseString(pre.ToString())));
if (endsWithItalic)
newLines.Append("</i>");
newLines.AppendLine();
@ -11601,10 +11602,10 @@ namespace Nikse.SubtitleEdit.Forms
Environment.NewLine +
exception.StackTrace, "Error loading language file");
Configuration.Settings.Language = new Language(); // default is en-US
Configuration.Settings.General.Language = null;
_languageGeneral = Configuration.Settings.Language.General;
_language = Configuration.Settings.Language.Main;
InitializeLanguage();
Configuration.Settings.General.Language = null;
}
}
@ -12068,7 +12069,7 @@ namespace Nikse.SubtitleEdit.Forms
//TODO: Check for mkv etc
if (Path.GetExtension(fileName).Equals(".sub", StringComparison.OrdinalIgnoreCase) && IsVobSubFile(fileName, false))
{
MessageBox.Show("VobSub files not supported here");
MessageBox.Show(_language.NoSupportHereVobSub);
return;
}
@ -12076,12 +12077,12 @@ namespace Nikse.SubtitleEdit.Forms
{
if (FileUtil.IsBluRaySup(fileName))
{
MessageBox.Show("Blu-ray sup files not supported here");
MessageBox.Show(_language.NoSupportHereBluRaySup);
return;
}
else if (FileUtil.IsSpDvdSup(fileName))
{
MessageBox.Show("DVD sup files not supported here");
MessageBox.Show(_language.NoSupportHereDvdSup);
return;
}
}
@ -12126,7 +12127,7 @@ namespace Nikse.SubtitleEdit.Forms
if (Path.GetExtension(fileName).Equals(".divx", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(fileName).Equals(".avi", StringComparison.OrdinalIgnoreCase))
{
MessageBox.Show("Divx files not supported here");
MessageBox.Show(_language.NoSupportHereDivx);
return;
}
@ -16899,7 +16900,7 @@ namespace Nikse.SubtitleEdit.Forms
{
toolStripMenuItemWebVttVoice.DropDownItems.Add(style, null, WebVTTSetVoiceTextBox);
}
toolStripMenuItemWebVttVoice.DropDownItems.Add("Set new voice...", null, WebVTTSetNewVoiceTextBox); //TODO: Translate
toolStripMenuItemWebVttVoice.DropDownItems.Add(_language.Menu.ContextMenu.WebVTTSetNewVoice, null, WebVTTSetNewVoiceTextBox);
}
else
{
@ -18865,7 +18866,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (!string.IsNullOrEmpty(form.OcrFileName))
{
MakeHistoryForUndo(_language.BeforeAutoBalanceSelectedLines); //TODO: Fix text
MakeHistoryForUndo(_language.BeforeAutoBalanceSelectedLines);
OpenSubtitle(form.OcrFileName, null);
}
}
@ -18940,7 +18941,7 @@ namespace Nikse.SubtitleEdit.Forms
int index = FirstSelectedIndex;
if (index < 0)
index = 0;
MakeHistoryForUndo("Before bridge small gaps"); //TODO: Fix text in SE 3.4
MakeHistoryForUndo(_language.BeforeDurationsBridgeGap);
_subtitle.Paragraphs.Clear();
foreach (Paragraph p in form.FixedSubtitle.Paragraphs)
_subtitle.Paragraphs.Add(p);

View File

@ -174,6 +174,8 @@ namespace Nikse.SubtitleEdit.Logic
ControlsWindowTitle = "Controls - {0}",
Advanced = "Advanced",
Style = "Style",
StyleLanguage = "Style / Language",
Character = "Character",
Class = "Class",
GeneralText = "General",
LineNumber = "Line#",
@ -1072,7 +1074,7 @@ namespace Nikse.SubtitleEdit.Logic
BeforeSortX = "Before sort: {0}",
SortedByX = "Sorted by: {0}",
BeforeAutoBalanceSelectedLines = "Before auto balance selected lines",
NumberOfLinesAutoBalancedX = "Number of lines auto balanced: {0}",
NumberOfLinesAutoBalancedX = "Number of auto balanced lines: {0}",
BeforeRemoveLineBreaksInSelectedLines = "Before remove line-breaks from selected lines",
NumberOfWithRemovedLineBreakX = "Number of lines with removed line-break: {0}",
BeforeMultipleReplace = "Before multiple replace",
@ -1090,6 +1092,7 @@ namespace Nikse.SubtitleEdit.Logic
BeforeMergeShortLines = "Before merge short lines",
BeforeSplitLongLines = "Before split long lines",
MergedShortLinesX = "Number of lines merged: {0}",
BeforeDurationsBridgeGap = "Before bridge small gaps",
BeforeSetMinimumDisplayTimeBetweenParagraphs = "Before set minimum display time between subtitles",
XMinimumDisplayTimeBetweenParagraphsChanged = "Number of lines with minimum display time between subtitles changed: {0}",
BeforeImportText = "Before import plain text",
@ -1151,6 +1154,11 @@ namespace Nikse.SubtitleEdit.Logic
ErrorLoadZip = "This file seems to be a compressed .zip file. Subtitle Edit cannot open compressed files.",
ErrorLoadPng = "This file seems to be a PNG image file. Subtitle Edit cannot open PNG files.",
ErrorLoadSrr = "This file seems to be a ReScene .srr file - not a subtitle file.",
NoSupportEncryptedVobSub = "Encrypted VobSub content is not supported.",
NoSupportHereBluRaySup = "Blu-ray sup files are not supported here.",
NoSupportHereDvdSup = "DVD sup files are not supported here.",
NoSupportHereVobSub = "VobSub files are not supported here.",
NoSupportHereDivx = "Divx files are not supported here.",
Menu = new LanguageStructure.Main.MainMenu
{
@ -1368,6 +1376,7 @@ namespace Nikse.SubtitleEdit.Logic
TimedTextSetStyle = "Timed Text - set style",
TimedTextSetLanguage = "Timed Text - set language",
SamiSetStyle = "Sami - set class",
NuendoSetStyle = "Nuendo - set character",
Cut = "Cut",
Copy = "Copy",
Paste = "Paste",

View File

@ -243,6 +243,12 @@ namespace Nikse.SubtitleEdit.Logic
case "General/Style":
language.General.Style = reader.Value;
break;
case "General/StyleLanguage":
language.General.StyleLanguage = reader.Value;
break;
case "General/Character":
language.General.Character = reader.Value;
break;
case "General/Class":
language.General.Class = reader.Value;
break;
@ -2370,6 +2376,9 @@ namespace Nikse.SubtitleEdit.Logic
case "Main/MergedShortLinesX":
language.Main.MergedShortLinesX = reader.Value;
break;
case "Main/BeforeDurationsBridgeGap":
language.Main.BeforeDurationsBridgeGap = reader.Value;
break;
case "Main/BeforeSetMinimumDisplayTimeBetweenParagraphs":
language.Main.BeforeSetMinimumDisplayTimeBetweenParagraphs = reader.Value;
break;
@ -2553,6 +2562,21 @@ namespace Nikse.SubtitleEdit.Logic
case "Main/ErrorLoadSrr":
language.Main.ErrorLoadSrr = reader.Value;
break;
case "Main/NoSupportEncryptedVobSub":
language.Main.NoSupportEncryptedVobSub = reader.Value;
break;
case "Main/NoSupportHereBluRaySup":
language.Main.NoSupportHereBluRaySup = reader.Value;
break;
case "Main/NoSupportHereDvdSup":
language.Main.NoSupportHereDvdSup = reader.Value;
break;
case "Main/NoSupportHereVobSub":
language.Main.NoSupportHereVobSub = reader.Value;
break;
case "Main/NoSupportHereDivx":
language.Main.NoSupportHereDivx = reader.Value;
break;
case "Main/Menu/File/Title":
language.Main.Menu.File.Title = reader.Value;
break;
@ -3057,6 +3081,9 @@ namespace Nikse.SubtitleEdit.Logic
case "Main/Menu/ContextMenu/SamiSetStyle":
language.Main.Menu.ContextMenu.SamiSetStyle = reader.Value;
break;
case "Main/Menu/ContextMenu/NuendoSetStyle":
language.Main.Menu.ContextMenu.NuendoSetStyle = reader.Value;
break;
case "Main/Menu/ContextMenu/Cut":
language.Main.Menu.ContextMenu.Cut = reader.Value;
break;

View File

@ -69,6 +69,8 @@
public string ControlsWindowTitle { get; set; }
public string Advanced { get; set; }
public string Style { get; set; }
public string StyleLanguage { get; set; }
public string Character { get; set; }
public string Class { get; set; }
public string GeneralText { get; set; }
public string LineNumber { get; set; }
@ -477,7 +479,7 @@
public string Right { get; set; }
public string Center { get; set; }
public string BottomMargin { get; set; }
public string LeftRightMargin { get; set; }
public string LeftRightMargin { get; set; }
public string SaveBluRraySupAs { get; set; }
public string SaveVobSubAs { get; set; }
public string SaveFabImageScriptAs { get; set; }
@ -973,6 +975,7 @@
public string BeforeMergeShortLines { get; set; }
public string BeforeSplitLongLines { get; set; }
public string MergedShortLinesX { get; set; }
public string BeforeDurationsBridgeGap { get; set; }
public string BeforeSetMinimumDisplayTimeBetweenParagraphs { get; set; }
public string XMinimumDisplayTimeBetweenParagraphsChanged { get; set; }
public string BeforeImportText { get; set; }
@ -1034,6 +1037,11 @@
public string ErrorLoadZip { get; set; }
public string ErrorLoadPng { get; set; }
public string ErrorLoadSrr { get; set; }
public string NoSupportEncryptedVobSub { get; set; }
public string NoSupportHereBluRaySup { get; set; }
public string NoSupportHereDvdSup { get; set; }
public string NoSupportHereVobSub { get; set; }
public string NoSupportHereDivx { get; set; }
public class MainMenu
{
@ -1244,6 +1252,7 @@
public string TimedTextStyles { get; set; }
public string TimedTextSetLanguage { get; set; }
public string SamiSetStyle { get; set; }
public string NuendoSetStyle { get; set; }
public string Cut { get; set; }
public string Copy { get; set; }
public string Paste { get; set; }