diff --git a/Duplicati/GUI/Program.cs b/Duplicati/GUI/Program.cs index 946ca8f60..68d2e1ca0 100644 --- a/Duplicati/GUI/Program.cs +++ b/Duplicati/GUI/Program.cs @@ -115,7 +115,6 @@ namespace Duplicati.GUI //The official Mono SQLite provider is also broken with less than 3.6.3 MessageBox.Show(string.Format(Strings.Program.WrongSQLiteVersion, System.Data.SQLite.SQLiteConnection.SQLiteVersion, "3.6.3"), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; - } System.Data.IDbConnection con = new System.Data.SQLite.SQLiteConnection(); @@ -138,9 +137,15 @@ namespace Duplicati.GUI if (!string.IsNullOrEmpty(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage)) try { - System.Threading.Thread.CurrentThread.CurrentUICulture = - System.Threading.Thread.CurrentThread.CurrentCulture = - System.Globalization.CultureInfo.GetCultureInfo(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage); + System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(new Datamodel.ApplicationSettings(DataConnection).DisplayLanguage); + try + { + System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture; + } + catch + { + //We still get the userinterface translated, but numbers and other formating is incorrect :( + } } catch(Exception ex) { diff --git a/Duplicati/Localization/Duplicati.Library.Core.dll b/Duplicati/Localization/Duplicati.Library.Core.dll index a7fba3449..536dd8649 100644 Binary files a/Duplicati/Localization/Duplicati.Library.Core.dll and b/Duplicati/Localization/Duplicati.Library.Core.dll differ diff --git a/Duplicati/Localization/LocalizationTool.exe b/Duplicati/Localization/LocalizationTool.exe index fb0f2e7fa..23e33abd9 100644 Binary files a/Duplicati/Localization/LocalizationTool.exe and b/Duplicati/Localization/LocalizationTool.exe differ diff --git a/Duplicati/Localization/configuration.xml b/Duplicati/Localization/configuration.xml index 4fa2ffff1..045c65fcf 100644 --- a/Duplicati/Localization/configuration.xml +++ b/Duplicati/Localization/configuration.xml @@ -1,33 +1,45 @@  - - Datamodel - - - Datamodel - - - Decrypter - - - - - - - - + + + Datamodel + + + Datamodel + + + Decrypter + + + + + + + + - - - - - - - - - - ..\GUI\Duplicati.snk - ..\GUI\bin\release\Duplicati.exe - .. - compiled - Duplicati + + + + + + + + + + ..\GUI\Duplicati.snk + ..\GUI\bin\release\Duplicati.exe + .. + compiled + Duplicati + + + + + + ..\..\WizardForm\WizardForm.snk + ..\GUI\bin\release\System.Windows.Forms.Wizard.dll + ..\.. + compiled + WizardForm + \ No newline at end of file diff --git a/LocalizationTool/LocalizationTool/LocalizationTool.csproj b/LocalizationTool/LocalizationTool/LocalizationTool.csproj index b96fc00ce..ed0531bb9 100644 --- a/LocalizationTool/LocalizationTool/LocalizationTool.csproj +++ b/LocalizationTool/LocalizationTool/LocalizationTool.csproj @@ -45,7 +45,7 @@ pdbonly true - bin\Release\ + ..\..\Duplicati\Localization\ TRACE prompt 4 diff --git a/LocalizationTool/LocalizationTool/Program.cs b/LocalizationTool/LocalizationTool/Program.cs index b6fbb8457..c33a8b899 100644 --- a/LocalizationTool/LocalizationTool/Program.cs +++ b/LocalizationTool/LocalizationTool/Program.cs @@ -110,62 +110,67 @@ namespace LocalizationTool { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(System.IO.Path.Combine(Application.StartupPath, "configuration.xml")); - string sourcefolder = System.IO.Path.GetFullPath(Duplicati.Library.Core.Utility.AppendDirSeperator(doc.SelectSingleNode("root/sourcefolder").InnerText)); - string outputfolder = System.IO.Path.GetFullPath(Duplicati.Library.Core.Utility.AppendDirSeperator(System.IO.Path.Combine(Application.StartupPath, culture))); - string target = System.IO.Path.Combine(outputfolder, culture); - - foreach (string s in Duplicati.Library.Core.Utility.EnumerateFiles(sourcefolder)) + foreach (System.Xml.XmlNode conf in doc.SelectNodes("root/configuration")) { - if (s.ToLower().StartsWith(Application.StartupPath.ToLower())) - continue; + string outputfolder = System.IO.Path.GetFullPath(Duplicati.Library.Core.Utility.AppendDirSeperator(System.IO.Path.Combine(Application.StartupPath, culture))); + string sourcefolder = Duplicati.Library.Core.Utility.AppendDirSeperator(System.IO.Path.GetFullPath(conf["sourcefolder"].InnerText)); - if (s.EndsWith(".resx")) + foreach (System.Xml.XmlNode fn in conf.SelectNodes("assembly")) { - string targetName = System.IO.Path.Combine(outputfolder, s.Substring(sourcefolder.Length)); - - string csFile = System.IO.Path.ChangeExtension(s, ".cs"); - - bool isForm = System.IO.File.Exists(csFile); - - if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(targetName))) - System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(targetName)); - - if (isForm) - System.IO.File.Copy(s, targetName, true); //Copy the updated resx - - targetName = targetName.Substring(0, targetName.Length - "resx".Length) + culture + ".resx"; - - if (System.IO.File.Exists(targetName)) - { - //TODO: Merge - } - else + foreach (string s in Duplicati.Library.Core.Utility.EnumerateFiles(System.IO.Path.Combine(sourcefolder, fn.Attributes["folder"].Value))) { - if (isForm) //Form - using (System.IO.StreamWriter sw = new System.IO.StreamWriter(targetName)) - sw.Write(Properties.Resources.Empty_resx); - else - System.IO.File.Copy(s, targetName); - } + if (s.ToLower().StartsWith(Application.StartupPath.ToLower())) + continue; - System.Xml.XmlDocument doc2 = new System.Xml.XmlDocument(); - doc2.Load(s); - - foreach(System.Xml.XmlNode n in doc2.SelectNodes("root/data")) - if (n.Attributes["type"] != null && n.Attributes["type"].Value == "System.Resources.ResXFileRef, System.Windows.Forms") + if (s.EndsWith(".resx")) { - string relname = n["value"].InnerText; - relname = relname.Substring(0, relname.IndexOf(";")); - string sourceRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(s), relname)); - string targetRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(targetName), relname)); - if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(targetRes))) - System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(targetRes)); + string targetName = System.IO.Path.Combine(outputfolder, s.Substring(sourcefolder.Length)); + + string csFile = System.IO.Path.ChangeExtension(s, ".cs"); + + bool isForm = System.IO.File.Exists(csFile); + + if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(targetName))) + System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(targetName)); + + if (isForm) + System.IO.File.Copy(s, targetName, true); //Copy the updated resx + + targetName = targetName.Substring(0, targetName.Length - "resx".Length) + culture + ".resx"; + + if (System.IO.File.Exists(targetName)) + { + //TODO: Merge + } + else + { + if (isForm) //Form + using (System.IO.StreamWriter sw = new System.IO.StreamWriter(targetName)) + sw.Write(Properties.Resources.Empty_resx); + else + System.IO.File.Copy(s, targetName); + } + + System.Xml.XmlDocument doc2 = new System.Xml.XmlDocument(); + doc2.Load(s); + + foreach (System.Xml.XmlNode n in doc2.SelectNodes("root/data")) + if (n.Attributes["type"] != null && n.Attributes["type"].Value == "System.Resources.ResXFileRef, System.Windows.Forms") + { + string relname = n["value"].InnerText; + relname = relname.Substring(0, relname.IndexOf(";")); + string sourceRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(s), relname)); + string targetRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(targetName), relname)); + if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(targetRes))) + System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(targetRes)); + + if (!System.IO.File.Exists(targetRes)) + System.IO.File.Copy(sourceRes, targetRes); + } - if (!System.IO.File.Exists(targetRes)) - System.IO.File.Copy(sourceRes, targetRes); } - + } } } @@ -194,41 +199,43 @@ namespace LocalizationTool System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(System.IO.Path.Combine(Application.StartupPath, "configuration.xml")); - string keyfile = doc.SelectSingleNode("root/keyfile").InnerText; - string versionassembly = doc.SelectSingleNode("root/versionassembly").InnerText; - string sourcefolder = doc.SelectSingleNode("root/sourcefolder").InnerText; - string outputfolder = doc.SelectSingleNode("root/outputfolder").InnerText; - string productname = doc.SelectSingleNode("root/productname").InnerText; - - foreach (System.Xml.XmlNode n in doc.SelectNodes("root/assembly")) + foreach (System.Xml.XmlNode conf in doc.SelectNodes("root/configuration")) { - List excludes = new List(); - foreach (System.Xml.XmlNode x in n.SelectNodes("exclude")) - excludes.Add(x.InnerText); + string keyfile = conf["keyfile"].InnerText; + string versionassembly = conf["versionassembly"].InnerText; + string outputfolder = conf["outputfolder"].InnerText; + string productname = conf["productname"].InnerText; - - string assemblyName = n.Attributes["name"].Value; - string folder = n.Attributes["folder"].Value; - string @namespace = n.Attributes["namespace"] == null ? assemblyName : n.Attributes["namespace"].Value; - - foreach (string bf in System.IO.Directory.GetDirectories(Application.StartupPath)) + foreach (System.Xml.XmlNode n in conf.SelectNodes("assembly")) { - string culture = System.IO.Path.GetFileName(bf); + List excludes = new List(); + foreach (System.Xml.XmlNode x in n.SelectNodes("exclude")) + excludes.Add(x.InnerText); - try + + string assemblyName = n.Attributes["name"].Value; + string folder = n.Attributes["folder"].Value; + string @namespace = n.Attributes["namespace"] == null ? assemblyName : n.Attributes["namespace"].Value; + + foreach (string bf in System.IO.Directory.GetDirectories(Application.StartupPath)) { - System.Globalization.CultureInfo.GetCultureInfo(culture); - } - catch - { - continue; - } + string culture = System.IO.Path.GetFileName(bf); - string outfolder = System.IO.Path.GetFullPath( System.IO.Path.Combine(outputfolder, culture)); - if (!System.IO.Directory.Exists(outfolder)) - System.IO.Directory.CreateDirectory(outfolder); + try + { + System.Globalization.CultureInfo.GetCultureInfo(culture); + } + catch + { + continue; + } - ResXCompiler.CompileResxFiles(System.IO.Path.Combine(bf, folder), excludes, @namespace, System.IO.Path.Combine(outfolder, assemblyName + ".resources.dll"), System.IO.Path.GetFullPath(versionassembly), keyfile, culture, productname); + string outfolder = System.IO.Path.GetFullPath(System.IO.Path.Combine(outputfolder, culture)); + if (!System.IO.Directory.Exists(outfolder)) + System.IO.Directory.CreateDirectory(outfolder); + + ResXCompiler.CompileResxFiles(System.IO.Path.Combine(bf, folder), excludes, @namespace, System.IO.Path.Combine(outfolder, assemblyName + ".resources.dll"), System.IO.Path.GetFullPath(versionassembly), keyfile, culture, productname); + } } } } diff --git a/WizardForm/Dialog.cs b/WizardForm/Dialog.cs index 89e9f6e3f..e77811952 100644 --- a/WizardForm/Dialog.cs +++ b/WizardForm/Dialog.cs @@ -114,9 +114,9 @@ namespace System.Windows.Forms.Wizard _BackButton.Enabled = m_visited.Count > 0; if (m_isLastPage) - _NextButton.Text = Strings.Dialog.NextButtonText; - else _NextButton.Text = Strings.Dialog.FinishButtonText; + else + _NextButton.Text = Strings.Dialog.NextButtonText; } public virtual void UpdateDisplay()