Included loader (+auto-gen) of language de-serializer

This commit is contained in:
niksedk 2014-06-26 14:11:00 +02:00
parent 00b63d8f20
commit f75ab4700a
47 changed files with 6994 additions and 768 deletions

3
.gitignore vendored
View File

@ -18,3 +18,6 @@
/src/SubtitleEdit.csproj.DotSettings
/src/Test/Test.csproj.user
/tabspace.exe
/src/Performance1.psess
/src/SubtitleEdit.psess
/src/SubtitleEdit140625.vsp

View File

@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Previous text takes all gap time</ProlongEndTime>
<DivideEven>Texts divides gap time</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Rip subtitles from ifo/vobs (dvd)</Title>
<DvdGroupTitle>DVD files/info</DvdGroupTitle>
<IfoFile>IFO file</IfoFile>
@ -303,7 +303,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Reading subtitle data...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripping vob file {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO type is '{0}' and not 'DVDVIDEO-VTS'.{1}Try another file than {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Choose language</Title>
<ChooseLanguageStreamId>Choose language (stream-id)</ChooseLanguageStreamId>

View File

@ -1,6 +1,6 @@
namespace Nikse.SubtitleEdit.Forms
{
partial class AddWareForm
partial class AddWaveForm
{
/// <summary>
/// Required designer variable.

View File

@ -9,7 +9,7 @@ using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class AddWareForm : Form
public sealed partial class AddWaveForm : Form
{
public string SourceVideoFileName { get; private set; }
private bool _cancel = false;
@ -21,7 +21,7 @@ namespace Nikse.SubtitleEdit.Forms
private int _audioTrackNumber = -1;
private int _delayInMilliseconds = 0;
public AddWareForm()
public AddWaveForm()
{
InitializeComponent();
labelProgress.Text = string.Empty;

View File

@ -120,9 +120,17 @@ namespace Nikse.SubtitleEdit.Forms
private void ChangeLanguage_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
DialogResult = DialogResult.Cancel;
}
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.L)
{
Configuration.Settings.Language.Save();
}
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.C)
{
XmlDeserializerGenerator.GenerateCSharpXmlDeserializerForLanguageStructure();
}
else if (e.KeyCode == Keys.F1)
{
Utilities.ShowHelp("#translate");

View File

@ -19,8 +19,8 @@ namespace Nikse.SubtitleEdit
Text = Configuration.Settings.Language.Settings.UseDoNotBreakAfterList;
labelLanguage.Text = Configuration.Settings.Language.ChooseLanguage.Language;
buttonRemoveNoBreakAfter.Text = Configuration.Settings.Language.DvdSubrip.Remove;
buttonAddNoBreakAfter.Text = Configuration.Settings.Language.DvdSubrip.Add;
buttonRemoveNoBreakAfter.Text = Configuration.Settings.Language.DvdSubRip.Remove;
buttonAddNoBreakAfter.Text = Configuration.Settings.Language.DvdSubRip.Add;
radioButtonText.Text = Configuration.Settings.Language.General.Text;
radioButtonRegEx.Text = Configuration.Settings.Language.MultipleReplace.RegularExpression;
buttonOK.Text = Configuration.Settings.Language.General.OK;

View File

@ -37,7 +37,7 @@ namespace Nikse.SubtitleEdit.Forms
labelStatus.Text = string.Empty;
buttonStartRipping.Enabled = false;
_language = Configuration.Settings.Language.DvdSubrip;
_language = Configuration.Settings.Language.DvdSubRip;
Text = _language.Title;
groupBoxDvd.Text = _language.DvdGroupTitle;
labelIfoFile.Text = _language.IfoFile;

View File

@ -25,9 +25,9 @@ namespace Nikse.SubtitleEdit.Forms
listViewParts.Columns[2].Text = Configuration.Settings.Language.JoinSubtitles.EndTime;
listViewParts.Columns[3].Text = Configuration.Settings.Language.JoinSubtitles.FileName;
buttonAddVobFile.Text = Configuration.Settings.Language.DvdSubrip.Add;
ButtonRemoveVob.Text = Configuration.Settings.Language.DvdSubrip.Remove;
buttonClear.Text = Configuration.Settings.Language.DvdSubrip.Clear;
buttonAddVobFile.Text = Configuration.Settings.Language.DvdSubRip.Add;
ButtonRemoveVob.Text = Configuration.Settings.Language.DvdSubRip.Remove;
buttonClear.Text = Configuration.Settings.Language.DvdSubRip.Clear;
Text = Configuration.Settings.Language.JoinSubtitles.Title;
groupBoxPreview.Text = Configuration.Settings.Language.JoinSubtitles.Information;

View File

@ -11932,9 +11932,11 @@ namespace Nikse.SubtitleEdit.Forms
}
else
{
var reader = new System.IO.StreamReader(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
Configuration.Settings.Language = Language.Load(reader);
reader.Close();
Configuration.Settings.Language = Language.Load(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
//var reader = new System.IO.StreamReader(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
//Configuration.Settings.Language = Language.Load(reader);
//reader.Close();
}
Configuration.Settings.General.Language = cultureName;
_languageGeneral = Configuration.Settings.Language.General;
@ -15014,7 +15016,7 @@ namespace Nikse.SubtitleEdit.Forms
if (mediaPlayer != null)
mediaPlayer.Pause();
var addWaveForm = new AddWareForm();
var addWaveForm = new AddWaveForm();
string peakWaveFileName = GetPeakWaveFileName(_videoFileName);
string spectrogramFolder = GetSpectrogramFolder(_videoFileName);
addWaveForm.Initialize(_videoFileName, spectrogramFolder, _videoAudioTrackNumber);
@ -15384,7 +15386,7 @@ namespace Nikse.SubtitleEdit.Forms
return;
}
var addWaveForm = new AddWareForm();
var addWaveForm = new AddWaveForm();
string spectrogramFolder = GetSpectrogramFolder(_videoFileName);
addWaveForm.InitializeViaWaveFile(fileName, spectrogramFolder);
if (addWaveForm.ShowDialog() == DialogResult.OK)

View File

@ -58,8 +58,8 @@ namespace Nikse.SubtitleEdit.Forms
splitContainer1.Panel1MinSize = 200;
splitContainer1.Panel2MinSize = 200;
moveUpToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.MoveUp;
moveDownToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.MoveDown;
moveUpToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.MoveUp;
moveDownToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.MoveDown;
radioButtonCaseSensitive.Left = radioButtonNormal.Left + radioButtonNormal.Width + 40;
radioButtonRegEx.Left = radioButtonCaseSensitive.Left + radioButtonCaseSensitive.Width + 40;

View File

@ -429,9 +429,9 @@ namespace Nikse.SubtitleEdit.Forms
bDNXMLToolStripMenuItem.Text = Configuration.Settings.Language.Main.Menu.File.ExportBdnXml;
bluraySupToolStripMenuItem.Text = Configuration.Settings.Language.Main.Menu.File.ExportBluRaySup;
toolStripMenuItemClearFixes.Text = Configuration.Settings.Language.DvdSubrip.Clear;
toolStripMenuItemClearGuesses.Text = Configuration.Settings.Language.DvdSubrip.Clear;
clearToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.Clear;
toolStripMenuItemClearFixes.Text = Configuration.Settings.Language.DvdSubRip.Clear;
toolStripMenuItemClearGuesses.Text = Configuration.Settings.Language.DvdSubRip.Clear;
clearToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.Clear;
checkBoxNOcrCorrect.Checked = Configuration.Settings.VobSubOcr.LineOcrDraw;
checkBoxNOcrItalic.Checked = Configuration.Settings.VobSubOcr.LineOcrAdvancedItalic;

View File

@ -289,7 +289,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ChooseColor>
</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>ifo/vobs (DVD) نسخ الترجمات من</Title>
<DvdGroupTitle>معلومات / DVD ملفات</DvdGroupTitle>
<IfoFile>IFO ملف</IfoFile>
@ -310,7 +310,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>قراءة بيانات الترجمة</ReadingSubtitleData>
<RippingVobFileXofYZ>نسخ vob file {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO وليس '{0}' النوع 'DVDVIDEO-VTS'.{1}محاولة أخرى من ملف {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>اختيار اللغة</Title>
<ChooseLanguageStreamId>اختيار اللغة</ChooseLanguageStreamId>

View File

@ -254,7 +254,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Text anterior pren tot el temps buit</ProlongEndTime>
<DivideEven>Temps buit dividit entre texts</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Extreu subtítols des de IFO/VOB (DVD)</Title>
<DvdGroupTitle>Info fitxers DVD</DvdGroupTitle>
<IfoFile>Fitxer IFO</IfoFile>
@ -275,7 +275,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Llegint dades subtítol...</ReadingSubtitleData>
<RippingVobFileXofYZ>Extraient fitxer vob {1} de {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO és '{0}' i no 'DVDVIDEO-VTS'.{1} Intenta amb altre fitxer {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Escolliu idioma</Title>
<ChooseLanguageStreamId>Escolliu idioma (flux-id)</ChooseLanguageStreamId>

View File

@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Předchozí text zabere celý čas mezery</ProlongEndTime>
<DivideEven>Texty si rozdělí čas mezery</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Vytáhnout titulky z souborů ifo/vob (DVD)</Title>
<DvdGroupTitle>DVD soubory/info</DvdGroupTitle>
<IfoFile>Soubor IFO</IfoFile>
@ -303,7 +303,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Čtení dat titulků...</ReadingSubtitleData>
<RippingVobFileXofYZ>Vytahování souboru vob {1} z {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Typ IFO je '{0}' a ne 'DVDVIDEO-VTS'.{1}Zkuste jiný soubor než {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Vybrat jazyk</Title>
<ChooseLanguageStreamId>Vyberte jazyk (ID stopy)</ChooseLanguageStreamId>

View File

@ -283,7 +283,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Forrige tekst tager alle tiden</ProlongEndTime>
<DivideEven>Tid deles</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Rip undertekster fra ifo/vobs (dvd)</Title>
<DvdGroupTitle>DVD-filer/info</DvdGroupTitle>
<IfoFile>IFO fil</IfoFile>
@ -304,7 +304,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Læser undertekst data...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripper vob fil {1} af {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO type er '{0}' og ikke 'DVD video-VTS «. {1} Prøv en anden fil end {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Vælg sprog</Title>
<ChooseLanguageStreamId>Vælg sprog (stream-id)</ChooseLanguageStreamId>

View File

@ -282,7 +282,7 @@ E-Mail: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Vorheriger Text nutzt Abstandszeit</ProlongEndTime>
<DivideEven>Texte teilen Abstandszeit</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Untertitel aus DVD (IFO/VOB) extrahieren</Title>
<DvdGroupTitle>DVD Dateien/Info</DvdGroupTitle>
<IfoFile>IFO Datei</IfoFile>
@ -303,7 +303,7 @@ E-Mail: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Lese Untertiteldaten...</ReadingSubtitleData>
<RippingVobFileXofYZ>Verarbeite VOB Datei {1} von {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO Typ ist '{0}' und nicht 'DVD VIDEO VTS'. {1}Eine andere Datei versuchen als {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Sprache auswählen</Title>
<ChooseLanguageStreamId>Sprache auswählen (Spur ID)</ChooseLanguageStreamId>

View File

@ -160,7 +160,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ShowOnlyDifferences>Εμφάνιση μόνο διαφορών</ShowOnlyDifferences>
<OnlyLookForDifferencesInText>Αναζήτηση μόνο για διαφορές στο κείμενο</OnlyLookForDifferencesInText>
</CompareSubtitles>
<DvdSubrip>
<DvdSubRip>
<Title>Αντιγράψτε υπότιτλους από IFO/VOB (DVD)</Title>
<DvdGroupTitle>DVD αρχεία/πληροφορίες</DvdGroupTitle>
<IfoFile>Αρχεία IFO</IfoFile>
@ -181,7 +181,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Ανάγνωση δεδομένων υπότιτλου...</ReadingSubtitleData>
<RippingVobFileXofYZ>Αντιγραφή αρχείου VOB {1} από {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Ο τύπος του IFO είναι '{0}' και όχι 'DVDVIDEO-VTS'.{1}Δοκιμάστε ένα άλλο αρχείο αντί του {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Επιλέξτε γλώσσα</Title>
<ChooseLanguageStreamId>Επιλέξτε γλώσσα (id-ροής)</ChooseLanguageStreamId>

View File

@ -261,7 +261,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Texto anterior se lleva todo el tiempo brecha</ProlongEndTime>
<DivideEven>Textos divide el tiempo brecha</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
<IfoFile>Archivo IFO</IfoFile>
@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Seleccionar idioma</Title>
<ChooseLanguageStreamId>Seleccione idioma (stream-id)</ChooseLanguageStreamId>

View File

@ -159,7 +159,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ShowOnlyDifferences>Mostrar solo diferencias</ShowOnlyDifferences>
<OnlyLookForDifferencesInText>Buscar solo diferencias en el texto</OnlyLookForDifferencesInText>
</CompareSubtitles>
<DvdSubrip>
<DvdSubRip>
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
<IfoFile>Archivo IFO</IfoFile>
@ -180,7 +180,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Seleccionar idioma</Title>
<ChooseLanguageStreamId>Seleccioneidioma (stream-id)</ChooseLanguageStreamId>

View File

@ -273,7 +273,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>El texto anterior lleva todo el intervalo de tiempo</ProlongEndTime>
<DivideEven>El texto divide el intervalo de tiempo</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
<IfoFile>Archivo IFO</IfoFile>
@ -294,7 +294,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Seleccionar idioma</Title>
<ChooseLanguageStreamId>Seleccioneidioma (stream-id)</ChooseLanguageStreamId>

View File

@ -262,7 +262,7 @@ Post@: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Aurreko idazkiak hutsarte denbora guztia hartzen du</ProlongEndTime>
<DivideEven>Idazkiak hutsarte denbora zatitzen du</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Grabatu ifo/vob azpidatziak (dvd)-tik</Title>
<DvdGroupTitle>DVD agiri/argibideak</DvdGroupTitle>
<IfoFile>IFO agiria</IfoFile>
@ -283,7 +283,7 @@ Post@: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Azpidatzi datuak irakurtzen...</ReadingSubtitleData>
<RippingVobFileXofYZ>Vob agiria grabatzen {1} {2}-tik: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO mota da '{0}' eta ez 'DVDVIDEO-VTS'. {1} Saiatu beste agiri batekin {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Hautatu hizkuntza</Title>
<ChooseLanguageStreamId>Hautatu hizkuntza (Jario-ezaug.)</ChooseLanguageStreamId>

View File

@ -160,7 +160,7 @@ http://soft98.ir
<ShowOnlyDifferences>فقط تفاوت ها را نمایش بده</ShowOnlyDifferences>
<OnlyLookForDifferencesInText>فقط برای تفاوت های موجود در متن نگاه کن</OnlyLookForDifferencesInText>
</CompareSubtitles>
<DvdSubrip>
<DvdSubRip>
<Title>ifo/vobs (DVD)تبدیل زیرنویسها از</Title>
<DvdGroupTitle>فایلها/اطلاعات دی وی دی</DvdGroupTitle>
<IfoFile>IFO فایل</IfoFile>
@ -181,7 +181,7 @@ http://soft98.ir
<ReadingSubtitleData>در حال خواندن اطلاعات</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripping vob file {1} of {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>نوعIFO '{0}' است و نه'DVDVIDEO-VTS'.{1}فایل دیگری را امتحان کنید {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>زبان را انتخاب کنید</Title>
<ChooseLanguageStreamId>زبان را انتخاب کنید (stream-id)</ChooseLanguageStreamId>

View File

@ -226,7 +226,7 @@ Haluatko mennä VLC media playerin kotisivulle?
<FontSize>Koko</FontSize>
<ChooseColor>Valitse väri...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Rippaa tekstitys ifo/vobs-tiedostoista (dvd)</Title>
<DvdGroupTitle>DVD tiedostot/tiedot</DvdGroupTitle>
<IfoFile>IFO-tiedosto</IfoFile>
@ -247,7 +247,7 @@ Haluatko mennä VLC media playerin kotisivulle?
<ReadingSubtitleData>Luetaan tekstityksen tietoja...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripataan vob tiedosto {1} / {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO-tyyppi on '{0}' eikä 'DVDVIDEO-VTS'.{1}Valitse muu tiedosto kuin {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Valitse kieli</Title>
<ChooseLanguageStreamId>Valitse kieli (stream-id)</ChooseLanguageStreamId>

View File

@ -253,7 +253,7 @@ E-pošta:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Prethodni tekst uzima sve vremenski razmak</ProlongEndTime>
<DivideEven>Tekstovi dijeli vremenski razmak</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Vađenje DVD podnaslova</Title>
<DvdGroupTitle>Datoteke DVD-a</DvdGroupTitle>
<IfoFile>IFO</IfoFile>
@ -274,7 +274,7 @@ E-pošta:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Učitavam Podnaslov</ReadingSubtitleData>
<RippingVobFileXofYZ>Izvlačim VOB datoteke… ({1} od {2}): {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO je pogrešne vrste. {1}Izaberite drugu datoteku.</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Odabir jezika</Title>
<ChooseLanguageStreamId>Izaberite željeni jezik ispod:</ChooseLanguageStreamId>

View File

@ -253,7 +253,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Previous text takes all gap time</ProlongEndTime>
<DivideEven>Texts divides gap time</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Feliratok rippelése ifo/vob fájlokból (dvd)</Title>
<DvdGroupTitle>DVD fájlok/információ</DvdGroupTitle>
<IfoFile>IFO fájl</IfoFile>
@ -274,7 +274,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Felirat adat olvasás...</ReadingSubtitleData>
<RippingVobFileXofYZ>{1} - {2} vob fájl rippelése: {0}</RippingVobFileXofYZ>
<WrongIfoType>'{0}' IFO típus és nem 'DVDVIDEO-VTS'.{1}Próbáljon másik fájlt, mint {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Válasszon nyelvet</Title>
<ChooseLanguageStreamId>Válasszon nyelvet (adatfolyam-azonosító)</ChooseLanguageStreamId>

View File

@ -262,7 +262,7 @@
<ProlongEndTime>Il testo precedente prende tutto il tempo di vuoto</ProlongEndTime>
<DivideEven>I testi si suddividono il tempo vuoto </DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Estrazione sottotitoli da ifo/vob (DVD)</Title>
<DvdGroupTitle>File DVD/info</DvdGroupTitle>
<IfoFile>File IFO</IfoFile>
@ -283,7 +283,7 @@
<ReadingSubtitleData>Lettura informazioni sottotitoli...</ReadingSubtitleData>
<RippingVobFileXofYZ>Estrazione file vob {1} di {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Il tipo IFO è '{0}' e non 'DVDVIDEO-VTS'.{1}Prova un altro file di {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Scegli lingua</Title>
<ChooseLanguageStreamId>Scegli lingua (ID del flusso)</ChooseLanguageStreamId>

View File

@ -225,7 +225,7 @@ C# ソース コードは https://github.com/SubtitleEdit/subtitleedit にあり
<FontSize>サイズ</FontSize>
<ChooseColor>色の選択...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>ifo/vob (DVD) から字幕を抽出</Title>
<DvdGroupTitle>DVD ファイル/情報</DvdGroupTitle>
<IfoFile>IFO ファイル</IfoFile>
@ -246,7 +246,7 @@ C# ソース コードは https://github.com/SubtitleEdit/subtitleedit にあり
<ReadingSubtitleData>字幕データを読み取っています...</ReadingSubtitleData>
<RippingVobFileXofYZ>{2} の vob ファイル {1} を抽出中: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO の種類が '{0}' で 'DVDVIDEO-VTS' ではありません.{1}{2} 以上のファイルで試行してください</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>言語の選択</Title>
<ChooseLanguageStreamId>言語の選択 (stream-id)</ChooseLanguageStreamId>

View File

@ -280,7 +280,7 @@ C# 코드는 https://github.com/SubtitleEdit/subtitleedit 에 있습니다.
<ProlongEndTime>이전 텍스트로 시간 간격 메움</ProlongEndTime>
<DivideEven>텍스트로 시간 간격을 공유</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>DVD(ifo/vob)에서 자막 가져오기</Title>
<DvdGroupTitle>DVD 파일/정보</DvdGroupTitle>
<IfoFile>IFO 파일</IfoFile>
@ -301,7 +301,7 @@ C# 코드는 https://github.com/SubtitleEdit/subtitleedit 에 있습니다.
<ReadingSubtitleData>자막 데이터를 읽는 중...</ReadingSubtitleData>
<RippingVobFileXofYZ>{2}개의 Vob 중 {1}번째 추출 중.../ 현재 파일: {0}</RippingVobFileXofYZ>
<WrongIfoType>이 IFO의 형식은 '{0}'입니다. 'DVDVideo-VTS'가 아닙니다. {2}가 아닌 다른 파일로 {1}시도해 주십시오!</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>언어 선택</Title>
<ChooseLanguageStreamId>언어 선택 (스트림 ID)</ChooseLanguageStreamId>

View File

@ -262,7 +262,7 @@ Suggesties zijn van harte welkom
<ProlongEndTime>Eerdere tekst gebruikt de gehele hiaattijd.</ProlongEndTime>
<DivideEven>Tekst verdeeld hiaattijd</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Rip ondertitels van ifo/vobs (dvd)</Title>
<DvdGroupTitle>dvd-bestanden/info</DvdGroupTitle>
<IfoFile>IFO-bestand</IfoFile>
@ -283,7 +283,7 @@ Suggesties zijn van harte welkom
<ReadingSubtitleData>Lezen ondertitel data...</ReadingSubtitleData>
<RippingVobFileXofYZ>Rippen vob-bestand {1} van {2}:. {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO type is '{0}' en niet 'DVDVIDEO-VTS' {1} Probeer dan een ander bestand {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Kies taal</Title>
<ChooseLanguageStreamId>Kies taal (stroom-id)</ChooseLanguageStreamId>

View File

@ -283,7 +283,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Poprzedni tekst widoczny przez cały czas trwania odstępu</ProlongEndTime>
<DivideEven>Teksty rozdzielane są czasem trwania odstępu</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Przechwyt napisów z ifo/vob (dvd)</Title>
<DvdGroupTitle>Pliki/info DVD</DvdGroupTitle>
<IfoFile>Plik IFO</IfoFile>
@ -304,7 +304,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Odczyt danych napisów...</ReadingSubtitleData>
<RippingVobFileXofYZ>Odczyt z pliku VOB {1} z {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Typ IFO '{0} i nie jest to 'DVDVideo-VTS'. {1} Spróbuj wybrać inny plik zamiast {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Wybór języka</Title>
<ChooseLanguageStreamId>Wybierz język (strumień-id)</ChooseLanguageStreamId>

View File

@ -265,7 +265,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Texto anterior assume todo o intervalo</ProlongEndTime>
<DivideEven>Texto divide o intervalo</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Ripar legendas de IFO/VOBs (DVD)</Title>
<DvdGroupTitle>Arquivos DVD/info</DvdGroupTitle>
<IfoFile>Arquivo IFO</IfoFile>
@ -286,7 +286,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Lendo dados da legenda...</ReadingSubtitleData>
<RippingVobFileXofYZ>Ripando arquivo VOB {1} de {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>O tipo IFO é '{0}' e não 'DVDVIDEO-VTS'.{1}Tente outro arquivo que {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Selecionar idioma</Title>
<ChooseLanguageStreamId>Selecionar idioma (stream-id)</ChooseLanguageStreamId>

View File

@ -284,7 +284,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ProlongEndTime>Texto anterior com todos os tempos de intervalo</ProlongEndTime>
<DivideEven>Texto divide o tempo do intervalo</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>Extrair legendas de IFO/VOBs (DVD)</Title>
<DvdGroupTitle>Ficheiro DVD/info</DvdGroupTitle>
<IfoFile>Ficheiro IFO</IfoFile>
@ -305,7 +305,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>A ler dados da legenda...</ReadingSubtitleData>
<RippingVobFileXofYZ>Extrair ficheiro VOB {1} de {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>O tipo IFO é '{0}' e não 'DVDVIDEO-VTS'.{1}Tentar outro ficheiro que {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Seleccionar idioma</Title>
<ChooseLanguageStreamId>Seleccionar idioma (stream-id)</ChooseLanguageStreamId>

View File

@ -224,7 +224,7 @@ E-mail: nikse.dk @gmail.com</AboutText1>
<FontSize>Marime</FontSize>
<ChooseColor>Alege culoare</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Extrage subtitrare din IFO/vobs (DVD)</Title>
<DvdGroupTitle>Fisiere DVD/info</DvdGroupTitle>
<IfoFile>Fisier IFO</IfoFile>
@ -245,7 +245,7 @@ E-mail: nikse.dk @gmail.com</AboutText1>
<ReadingSubtitleData>Citeste datele subtitrarii...</ReadingSubtitleData>
<RippingVobFileXofYZ>Extrage fisier VOB {1} din {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Tipul IFO este '{0}'si nu "DVDVIDEO -VTS'. {1}Incearca alt fisier decat {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Alege limba</Title>
<ChooseLanguageStreamId>Alege limba (stream-id)</ChooseLanguageStreamId>

View File

@ -158,7 +158,7 @@
<ShowOnlyDifferences>П&amp;рикажи само разлике</ShowOnlyDifferences>
<OnlyLookForDifferencesInText>&amp;Тражи само разлике у тексту</OnlyLookForDifferencesInText>
</CompareSubtitles>
<DvdSubrip>
<DvdSubRip>
<Title>Вађење ДВД титла</Title>
<DvdGroupTitle>Датотеке ДВД-ја</DvdGroupTitle>
<IfoFile>IFO</IfoFile>
@ -179,7 +179,7 @@
<ReadingSubtitleData>Учитавам титл…</ReadingSubtitleData>
<RippingVobFileXofYZ>Извршавам VOB датотеку… ({1} од {2}): {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO је погрешне врсте. {1}Изаберите другу датотеку.</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Одабир језика</Title>
<ChooseLanguageStreamId>Изаберите жељени језик испод:</ChooseLanguageStreamId>

View File

@ -225,7 +225,7 @@ E-pošta:mailto:nikse.dk@gmail.com</AboutText1>
<FontSize>Veličina Fonta</FontSize>
<ChooseColor>Odaberite boju...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Vađenje DVD prevoda</Title>
<DvdGroupTitle>Datoteke DVD-a</DvdGroupTitle>
<IfoFile>IFO</IfoFile>
@ -246,7 +246,7 @@ E-pošta:mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Učitavam prevod</ReadingSubtitleData>
<RippingVobFileXofYZ>Izvlačim VOB datoteke… ({1} od {2}): {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO je pogrešne vrste. {1}Izaberite drugu datoteku.</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Biranje jezika</Title>
<ChooseLanguageStreamId>Izaberite željeni jezik ispod:</ChooseLanguageStreamId>

View File

@ -226,7 +226,7 @@ E-post: mailto:nikse.dk@gmail.com</AboutText1>
<FontSize>Storlek</FontSize>
<ChooseColor>Välj färg</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Rippa text från Ifo/vobs (DVD)</Title>
<DvdGroupTitle>DVD-fil/info</DvdGroupTitle>
<IfoFile>IFO-fil</IfoFile>
@ -247,7 +247,7 @@ E-post: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Läs text data</ReadingSubtitleData>
<RippingVobFileXofYZ>Rippa VOB-fil {1} av {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO typ '{0}' och inte 'DVD-video VTS'. {1} Försök med en annan fil än {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Välj språk</Title>
<ChooseLanguageStreamId>Välj språk (stream-id)</ChooseLanguageStreamId>

View File

@ -226,7 +226,7 @@ E-posta: mailto:nikse.dk@gmail.com</AboutText1>
<FontSize>Boyur</FontSize>
<ChooseColor>Renk seç...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Ifo/vobs (dvd) dosyasından altyazı riple</Title>
<DvdGroupTitle>DVD dosyaları/bilgi</DvdGroupTitle>
<IfoFile>IFO dosyası</IfoFile>
@ -247,7 +247,7 @@ E-posta: mailto:nikse.dk@gmail.com</AboutText1>
<ReadingSubtitleData>Altyazı verisi okunuyor...</ReadingSubtitleData>
<RippingVobFileXofYZ>Vob dosyası ripleniyor {1} / {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO type is '{0}' and not 'DVDVIDEO-VTS'.{1}Try another file than {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Dil seç</Title>
<ChooseLanguageStreamId>Dil seç (stream-id)</ChooseLanguageStreamId>

View File

@ -242,7 +242,7 @@ Rất hân hạnh được chào đón.
<FontSize>Kích thước</FontSize>
<ChooseColor>Chọn màusắc ...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>Trích xuất phụ đề từ ifo/vobs (dvd)</Title>
<DvdGroupTitle>Tập tin DVD/Thông tin</DvdGroupTitle>
<IfoFile>Tập tin IFO</IfoFile>
@ -263,7 +263,7 @@ Rất hân hạnh được chào đón.
<ReadingSubtitleData>Đọc dữ liệu phụ đề...</ReadingSubtitleData>
<RippingVobFileXofYZ>Trích xuất tập tin vob {1} của {2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>Loại IFO là '{0}' và không phải 'DVDVIDEO-VTS' {1} Hãy thử một tập tin khác {2}.</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>Chọn ngôn ngữ</Title>
<ChooseLanguageStreamId>Chọn ngôn ngữ (dòng-id)</ChooseLanguageStreamId>

View File

@ -264,7 +264,7 @@ C# 源代码可从 https://github.com/SubtitleEdit/subtitleedit 获得。
<ProlongEndTime>间隔时间分配给前一行</ProlongEndTime>
<DivideEven>间隔时间均分给前后两行</DivideEven>
</DurationsBridgeGaps>
<DvdSubrip>
<DvdSubRip>
<Title>从 DVD 中提取字幕</Title>
<DvdGroupTitle>DVD 文件/信息</DvdGroupTitle>
<IfoFile>IFO 文件</IfoFile>
@ -285,7 +285,7 @@ C# 源代码可从 https://github.com/SubtitleEdit/subtitleedit 获得。
<ReadingSubtitleData>正在读取字幕数据...</ReadingSubtitleData>
<RippingVobFileXofYZ>正在提取 VOB 文件 {1}/{2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO 类型是 '{0}' 而不是 'DVDVIDEO-VTS'。{1}请尝试其它文件而不是 {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>选择语言</Title>
<ChooseLanguageStreamId>选择语言 (流 ID)</ChooseLanguageStreamId>

View File

@ -224,7 +224,7 @@ C# 原始碼可從 https://github.com/SubtitleEdit/subtitleedit 獲得。
<FontSize>大小</FontSize>
<ChooseColor>選取彩色...</ChooseColor>
</DCinemaProperties>
<DvdSubrip>
<DvdSubRip>
<Title>從 DVD 提取字幕</Title>
<DvdGroupTitle>DVD 檔案/訊息</DvdGroupTitle>
<IfoFile>IFO 檔案</IfoFile>
@ -245,7 +245,7 @@ C# 原始碼可從 https://github.com/SubtitleEdit/subtitleedit 獲得。
<ReadingSubtitleData>正在讀取字幕資料...</ReadingSubtitleData>
<RippingVobFileXofYZ>正在提取 VOB 檔案 {1}/{2}: {0}</RippingVobFileXofYZ>
<WrongIfoType>IFO 類型是 '{0}' 而不是 'DVDVIDEO-VTS'。{1}請嘗試其它檔案而不是 {2}</WrongIfoType>
</DvdSubrip>
</DvdSubRip>
<DvdSubRipChooseLanguage>
<Title>選取語系</Title>
<ChooseLanguageStreamId>選取語系 (流 ID)</ChooseLanguageStreamId>

View File

@ -117,7 +117,7 @@ namespace Nikse.SubtitleEdit.Logic
string id = Encoding.UTF8.GetString(buffer);
if (id != "DVDVIDEO-VTS")
{
ErrorMessage = string.Format(Configuration.Settings.Language.DvdSubrip.WrongIfoType, id, Environment.NewLine, fileName);
ErrorMessage = string.Format(Configuration.Settings.Language.DvdSubRip.WrongIfoType, id, Environment.NewLine, fileName);
return;
}
ParseVtsVobs();

View File

@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.Logic
public LanguageStructure.AddToNames AddToNames;
public LanguageStructure.AddToOcrReplaceList AddToOcrReplaceList;
public LanguageStructure.AddToUserDictionary AddToUserDictionary;
public LanguageStructure.AddWareForm AddWaveForm;
public LanguageStructure.AddWaveForm AddWaveForm;
public LanguageStructure.AdjustDisplayDuration AdjustDisplayDuration;
public LanguageStructure.ApplyDurationLimits ApplyDurationLimits;
public LanguageStructure.AutoBreakUnbreakLines AutoBreakUnbreakLines;
@ -35,7 +35,7 @@ namespace Nikse.SubtitleEdit.Logic
public LanguageStructure.CompareSubtitles CompareSubtitles;
public LanguageStructure.DCinemaProperties DCinemaProperties;
public LanguageStructure.DurationsBridgeGaps DurationsBridgeGaps;
public LanguageStructure.DvdSubRip DvdSubrip;
public LanguageStructure.DvdSubRip DvdSubRip;
public LanguageStructure.DvdSubRipChooseLanguage DvdSubRipChooseLanguage;
public LanguageStructure.EbuSaveOtpions EbuSaveOtpions;
public LanguageStructure.EffectKaraoke EffectKaraoke;
@ -214,7 +214,7 @@ namespace Nikse.SubtitleEdit.Logic
Description = "Add word to user dictionary (not case sensitive)",
};
AddWaveForm = new LanguageStructure.AddWareForm
AddWaveForm = new LanguageStructure.AddWaveForm
{
Title = "Generate wave form data",
GenerateWaveFormData = "Generate wave form data",
@ -438,7 +438,7 @@ namespace Nikse.SubtitleEdit.Logic
DivideEven = "Texts divides gap time",
};
DvdSubrip = new LanguageStructure.DvdSubRip
DvdSubRip = new LanguageStructure.DvdSubRip
{
Title = "Rip subtitles from ifo/vobs (dvd)",
DvdGroupTitle = "DVD files/info",
@ -2336,15 +2336,6 @@ Keep changes?",
}
public static Language LoadAndDecompress(StreamReader sr)
{
using (var zip = new GZipStream(sr.BaseStream, CompressionMode.Decompress))
{
var s = new XmlSerializer(typeof(Language));
return (Language)s.Deserialize(zip);
}
}
public static Language Load(StreamReader sr)
{
var s = new XmlSerializer(typeof(Language));
@ -2352,6 +2343,11 @@ Keep changes?",
return language;
}
public static Language Load(string fileName)
{
return LanguageDeserializer.CustomDeserializeLanguage(fileName);
}
public void Save()
{
var s = new XmlSerializer(typeof(Language));

File diff suppressed because it is too large Load Diff

View File

@ -101,7 +101,7 @@
public string Description { get; set; }
}
public class AddWareForm
public class AddWaveForm
{
public string Title { get; set; }
public string SourceVideoFile { get; set; }

View File

@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace Nikse.SubtitleEdit.Logic
{
public static class XmlDeserializerGenerator
{
public static string GenerateCSharpXmlDeserializerForLanguageStructure()
{
var sb = new StringBuilder();
sb.AppendLine(@"using System.IO;
using System.Xml;
namespace Nikse.SubtitleEdit.Logic
{
public class LanguageDeserializer
{
public static Language CustomDeserializeLanguage(string fileName)
{
var doc = new XmlDocument();
doc.PreserveWhitespace = true;
var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
doc.Load(stream);
stream.Close();
XmlNode node = doc.DocumentElement;
XmlNode subNode;
var language = new Language();
");
sb.AppendLine(GenerateCSharpXmlDeserializer(typeof(Language), "language", string.Empty));
sb.AppendLine();
sb.AppendLine("\t\t\treturn language;");
sb.AppendLine("\t\t}");
sb.AppendLine("\t}");
sb.AppendLine("}");
System.IO.File.WriteAllText(@"C:\Data\subtitleedit\subtitleedit\src\Logic\LanguageDeserializer.cs", sb.ToString());
return sb.ToString();
}
private static string GenerateCSharpXmlDeserializer(Type classType, string currentName, string xmlPath)
{
xmlPath = xmlPath.Trim('/');
var sb = new StringBuilder();
var properties = classType.GetProperties();
if (properties.Length == 0)
{
var fields = classType.GetFields();
foreach (var fieldInfo in fields)
{
if (fieldInfo.FieldType.Name == "String")
{
sb.AppendLine("\t\t\tsubNode = node.SelectSingleNode(\"" + fieldInfo.Name + "\");");
sb.AppendLine("\t\t\tif (subNode != null)");
sb.AppendLine("\t\t\t\t" + currentName + "." + fieldInfo.Name + " = subNode.InnerText;");
}
}
foreach (var fieldInfo in fields)
{
if (fieldInfo.FieldType.Name != "String" && fieldInfo.FieldType.FullName.Contains("LanguageStructure"))
{
sb.AppendLine();
sb.AppendLine("\t\t\t" + currentName + "." + fieldInfo.Name + " = new " + fieldInfo.FieldType.FullName.Replace("+", ".") + "();");
sb.AppendLine("\t\t\tnode = doc.DocumentElement.SelectSingleNode(\"" + fieldInfo.Name + "\");");
sb.AppendLine("\t\t\tif (node != null)");
sb.AppendLine("\t\t\t{");
sb.AppendLine(GenerateCSharpXmlDeserializer(fieldInfo.FieldType, currentName + "." + fieldInfo.Name, xmlPath + "/" + fieldInfo.Name + "/"));
sb.AppendLine("\t\t\t}");
}
}
}
else
{
foreach (var prp in properties)
{
if (prp.PropertyType.Name == "String")
{
sb.AppendLine("\t\t\tsubNode = node.SelectSingleNode(\"" + prp.Name + "\");");
sb.AppendLine("\t\t\tif (subNode != null)");
sb.AppendLine("\t\t\t\t" + currentName + "." + prp.Name + " = subNode.InnerText;");
}
}
foreach (var prp in properties)
{
if (prp.PropertyType.Name != "String" && prp.PropertyType.FullName.Contains("LanguageStructure"))
{
sb.AppendLine();
sb.AppendLine("\t\t\t" + currentName + "." + prp.Name + " = new " + prp.PropertyType.FullName.Replace("+", ".") + "();");
sb.AppendLine("\t\t\tnode = doc.DocumentElement.SelectSingleNode(\"" + xmlPath + "/" + prp.Name + "\");");
sb.AppendLine("\t\t\tif (node != null)");
sb.AppendLine("\t\t\t{");
sb.AppendLine(GenerateCSharpXmlDeserializer(prp.PropertyType, currentName + "." + prp.Name, xmlPath + "/" + prp.Name + "/"));
sb.AppendLine("\t\t\t}");
}
}
}
return sb.ToString();
}
}
}

View File

@ -117,11 +117,11 @@
<Compile Include="Forms\AddToUserDic.Designer.cs">
<DependentUpon>AddToUserDic.cs</DependentUpon>
</Compile>
<Compile Include="Forms\AddWareForm.cs">
<Compile Include="Forms\AddWaveForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\AddWareForm.Designer.cs">
<DependentUpon>AddWareForm.cs</DependentUpon>
<Compile Include="Forms\AddWaveForm.Designer.cs">
<DependentUpon>AddWaveForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\AlignmentPicker.cs">
<SubType>Form</SubType>
@ -763,6 +763,7 @@
<Compile Include="Logic\Forms\RemoveTextForHISettings.cs" />
<Compile Include="Logic\Forms\RemoveTextForHI.cs" />
<Compile Include="Logic\Forms\SplitLongLinesHelper.cs" />
<Compile Include="Logic\LanguageDeserializer.cs" />
<Compile Include="Logic\MurMurHash3.cs" />
<Compile Include="Logic\NHunspell\Hunspell.cs" />
<Compile Include="Logic\NHunspell\Hyphen.cs" />
@ -1136,6 +1137,7 @@
<Compile Include="Logic\VobSub\VobSubPack.cs" />
<Compile Include="Logic\VobSub\VobSubWriter.cs" />
<Compile Include="Logic\WordSpellChecker.cs" />
<Compile Include="Logic\XmlDeserializerGenerator.cs" />
<Compile Include="Logic\XSub.cs" />
<Compile Include="Logic\zlib\Adler32.cs" />
<Compile Include="Logic\zlib\Deflate.cs" />
@ -1201,8 +1203,8 @@
<EmbeddedResource Include="Forms\AddToUserDic.resx">
<DependentUpon>AddToUserDic.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AddWareForm.resx">
<DependentUpon>AddWareForm.cs</DependentUpon>
<EmbeddedResource Include="Forms\AddWaveForm.resx">
<DependentUpon>AddWaveForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\AlignmentPicker.resx">
<DependentUpon>AlignmentPicker.cs</DependentUpon>