diff --git a/tabler/Classes/TranslationManager.cs b/tabler/Classes/TranslationManager.cs index fe0c2b6..71d4dda 100644 --- a/tabler/Classes/TranslationManager.cs +++ b/tabler/Classes/TranslationManager.cs @@ -1,7 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using OfficeOpenXml; +using tabler.Classes; + namespace tabler { public class TranslationManager { @@ -81,14 +84,21 @@ public void ConvertExcelToXml(DirectoryInfo lastPathToDataFiles) { SaveModInfosToXml(lastPathToDataFiles, lstModInfos); } - private static void SaveModInfosToXml(DirectoryInfo lastPathToDataFiles, List lstModInfos) { - //if going through mods instead of files, - // we could create files - // too tired :D -> TODO - List filesByNameInDirectory = FileSystemHelper.GetFilesByNameInDirectory(lastPathToDataFiles, STRINGTABLE_NAME, SearchOption.AllDirectories); + private static bool SaveModInfosToXml(DirectoryInfo lastPathToDataFiles, List lstModInfos) { + try { + //if going through mods instead of files, + // we could create files + // too tired :D -> TODO + List filesByNameInDirectory = FileSystemHelper.GetFilesByNameInDirectory(lastPathToDataFiles, STRINGTABLE_NAME, SearchOption.AllDirectories); + + var xh = new XmlHelper(); + xh.UpdateXmlFiles(filesByNameInDirectory, lstModInfos); + } catch (Exception e) { + Logger.Log(e.Message); + return false; + } - var xh = new XmlHelper(); - xh.UpdateXmlFiles(filesByNameInDirectory, lstModInfos); + return true; } @@ -96,8 +106,8 @@ public TranslationComponents GetGridData(DirectoryInfo lastPathToDataFiles) { return GetTranslationComponents(lastPathToDataFiles, false); } - public void SaveGridData(DirectoryInfo lastPathToDataFiles, List lstModInfos) { - SaveModInfosToXml(lastPathToDataFiles, lstModInfos); + public bool SaveGridData(DirectoryInfo lastPathToDataFiles, List lstModInfos) { + return SaveModInfosToXml(lastPathToDataFiles, lstModInfos); } } } \ No newline at end of file diff --git a/tabler/Forms/AboutBox.resx b/tabler/Forms/AboutBox.resx index 1dfc12d..600d188 100644 --- a/tabler/Forms/AboutBox.resx +++ b/tabler/Forms/AboutBox.resx @@ -117,35 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - 417, 265 - - - &OK - - - 9, 9 - - - tableLayoutPanel + + + 2 - + Fill - - 2 - - - AboutBox - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m @@ -269,272 +249,289 @@ ex/6P7XzFQVkeN6NAAAAAElFTkSuQmCC - - 271, 17 + + 3, 3 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 131, 259 - - 6, 3, 3, 3 + + Zoom - - labelCompanyName + + 12 - - 6, 13 + + logoPictureBox - - labelProductName + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 0 + + + Fill + + + 143, 0 6, 0, 3, 0 - - - 6 + + 0, 17 271, 17 - - CenterParent - - - Version - - - textBoxDescription + + 19 - - 0 + + Product Name - - 0, 17 + + MiddleLeft - - 131, 259 + + labelProductName - - 12 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel - - Bottom, Right + + 1 - - Both + + Fill - - 435, 283 + + 143, 26 - - labelVersion + + 6, 0, 3, 0 0, 17 - - tableLayoutPanel - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 271, 17 0 - - 2 - - - 271, 126 - - - Fill - - - 22 - - - 75, 23 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Version - + MiddleLeft - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCompanyName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,33,Percent,67" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> + + labelVersion - - 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 339, 239 + + tableLayoutPanel - - 4 + + 2 - - $this + + Fill - - tableLayoutPanel + + 143, 52 - - okButton + + 6, 0, 3, 0 - - Fill + + 0, 17 + + + 271, 17 21 - - Description - - - 19 + + Copyright - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + MiddleLeft - - 0 + + labelCopyright - - 6, 0, 3, 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel - - 271, 17 + + 3 - - Product Name + + Fill - - 143, 107 + + 143, 78 - - MiddleLeft + + 6, 0, 3, 0 - - 23 + + 0, 17 - - 6 + + 271, 17 - - Fill + + 22 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Company Name - - 143, 0 + + MiddleLeft - - 143, 26 + + labelCompanyName - - 5 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 143, 52 + + tableLayoutPanel - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 4 - + Fill - - 1 + + 143, 107 - - logoPictureBox + + 6, 3, 3, 3 - - AboutBox + + True - - tableLayoutPanel + + Both - - Fill + + 271, 126 - - Zoom + + 23 - - Copyright + + Description - - 143, 78 + + textBoxDescription - - 3 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 271, 17 + + tableLayoutPanel - - 3, 3 + + 5 - - 9, 9, 9, 9 + + Bottom, Right - - Fill + + 339, 239 - - 0, 17 + + 75, 23 - - System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 24 - - MiddleLeft + + &OK - - Company Name + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel - - MiddleLeft + + 6 - - labelCopyright + + Fill - - 6, 0, 3, 0 + + 9, 9 - + + 6 + + + 417, 265 + + + 0 + + tableLayoutPanel - - 0, 17 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 6, 0, 3, 0 + + $this - - 24 + + 0 - - True + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCompanyName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,33,Percent,67" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> True - - de - + + 6, 13 + + + 435, 283 + + + 9, 9, 9, 9 + + + CenterParent + + + AboutBox + + + AboutBox + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/tabler/Forms/GridUI.cs b/tabler/Forms/GridUI.cs index d5d2b9d..74c0a45 100644 --- a/tabler/Forms/GridUI.cs +++ b/tabler/Forms/GridUI.cs @@ -90,7 +90,11 @@ private void openModFolderToolStripMenuItem_Click(object sender, EventArgs e) { private void saveToolStripMenuItem_Click(object sender, EventArgs e) { var lstModInfos = _gridUiHelper.ParseAllTables(); - TranslationManager.SaveGridData(ConfigHelper.GetLastPathOfDataFiles(), lstModInfos); + var success = TranslationManager.SaveGridData(ConfigHelper.GetLastPathOfDataFiles(), lstModInfos); + + if (success) { + Logger.Log(Resources.GridUI_saveToolStripMenuItem_Click_Successfully_saved); + } } private void tabControl1_Selected(object sender, TabControlEventArgs e) { diff --git a/tabler/Forms/GridUI.resx b/tabler/Forms/GridUI.resx index 4ef9fec..f532bf0 100644 --- a/tabler/Forms/GridUI.resx +++ b/tabler/Forms/GridUI.resx @@ -119,10 +119,7 @@ - 1451, 65 - - - 0, 0 + 1451, 165 @@ -132,9 +129,6 @@ Horizontal - - toolStripContainer1.TopToolStripPanel - False @@ -165,9 +159,6 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel1 - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -180,9 +171,6 @@ System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1451, 731 - 1451, 24 @@ -192,6 +180,9 @@ 61, 20 + + 1451, 731 + splitContainer2 @@ -204,15 +195,9 @@ toolStripContainer1 - - 307, 20 - tabler - Arma 3 Translation Helper - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 1 @@ -228,9 +213,12 @@ System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 0 + + toolStripContainer1.TopToolStripPanel + 6, 13 @@ -4999,20 +4987,14 @@ False - - Vertical - About - - Settings - splitContainer1 - - 1352, 20 + + 1451, 731 Fill @@ -5044,6 +5026,9 @@ toolStripContainer1 + + 1 + label1 @@ -5056,15 +5041,15 @@ True - - checkForNewVersionToolStripMenuItem + + toolStripContainer1 + + + About toolStripContainer1.BottomToolStripPanel - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 4 @@ -5072,7 +5057,10 @@ 187, 22 - 574 + 474 + + + 1352, 20 System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -5089,6 +5077,9 @@ GridUI + + 52, 20 + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -5101,8 +5092,8 @@ Exit - - 0 + + toolStripContainer1 87, 49 @@ -5158,12 +5149,18 @@ splitContainer2.Panel1 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 181, 22 + + + 0 toolStripContainer1.ContentPanel + + toolStripContainer1 + None @@ -5182,8 +5179,11 @@ Open language file(s) - - 52, 20 + + 0 + + + 0, 0 1451, 60 @@ -5209,6 +5209,9 @@ 187, 22 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 191, 22 @@ -5230,9 +5233,6 @@ splitContainer1.Panel2 - - 3 - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -5245,8 +5245,11 @@ Fill - - 184, 6 + + 0 + + + 0 toolStripContainer1.ContentPanel @@ -5269,11 +5272,11 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 181, 22 + + 184, 6 - - toolStripContainer1 + + 1 285, 293 @@ -5302,9 +5305,6 @@ splitContainer2.Panel2 - - 1 - _tbLog @@ -5317,8 +5317,8 @@ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + tableLayoutPanel1 System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -5326,8 +5326,8 @@ System.Windows.Forms.ToolStripContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - toolStripContainer1 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 menuStrip1 @@ -5341,8 +5341,8 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1451, 731 + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 openModFolderToolStripMenuItem @@ -5392,8 +5392,8 @@ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0 + + Settings 1451, 84 @@ -5405,28 +5405,25 @@ 17, 25 - 1451, 574 + 1451, 474 System.Windows.Forms.ToolStripContentPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - versionToolStripMenuItem - menuStrip1 splitContainer2.Panel1 - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + checkForNewVersionToolStripMenuItem - - 1 + + versionToolStripMenuItem - - toolStripContainer1 + + 3 System.Windows.Forms.FolderBrowserDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -5437,20 +5434,17 @@ True - - 0 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - About + + 307, 20 - - de - True - 62 + 25 186, 17 diff --git a/tabler/Properties/Resources.Designer.cs b/tabler/Properties/Resources.Designer.cs index f733965..4bac0ba 100644 --- a/tabler/Properties/Resources.Designer.cs +++ b/tabler/Properties/Resources.Designer.cs @@ -155,5 +155,14 @@ internal static string GridUI_No_stringtable_xml_files_found { return ResourceManager.GetString("GridUI_No_stringtable_xml_files_found", resourceCulture); } } + + /// + /// Looks up a localized string similar to Successfully saved.. + /// + internal static string GridUI_saveToolStripMenuItem_Click_Successfully_saved { + get { + return ResourceManager.GetString("GridUI_saveToolStripMenuItem_Click_Successfully_saved", resourceCulture); + } + } } } diff --git a/tabler/Properties/Resources.de.resx b/tabler/Properties/Resources.de.resx index ba6554b..7d5f1c0 100644 --- a/tabler/Properties/Resources.de.resx +++ b/tabler/Properties/Resources.de.resx @@ -153,4 +153,7 @@ Eintrag: '{2}' Keine 'stringtable.xml'-Dateien gefunden. + + Erfolgreich gespeichert + \ No newline at end of file diff --git a/tabler/Properties/Resources.resx b/tabler/Properties/Resources.resx index 6d64f82..5eaa3fa 100644 --- a/tabler/Properties/Resources.resx +++ b/tabler/Properties/Resources.resx @@ -154,4 +154,7 @@ Entry: '{2}' Download the new version at + + Successfully saved. + \ No newline at end of file diff --git a/tabler/tabler.csproj b/tabler/tabler.csproj index 396854e..59aad76 100644 --- a/tabler/tabler.csproj +++ b/tabler/tabler.csproj @@ -243,6 +243,7 @@ PreserveNewest +