Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragrajaghh <agrajaghh@gmail.com>2016-10-07 11:53:29 +0300
committeragrajaghh <agrajaghh@gmail.com>2016-10-07 11:53:29 +0300
commit35c46c4651d90515d032b35d0e9cb99d71545c55 (patch)
tree3e365abb007227666baa7cbfe7a42e5794cc76a0 /BuildTools
parentc9e81b3c30aece825ca4d5983f6678ca427133a1 (diff)
remove LocalizationTool[2]
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool.sln26
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/CSVReader.cs122
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/LinqHelpers.cs239
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/LocalizationTool.csproj155
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Program.cs999
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Properties/AssemblyInfo.cs52
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.Designer.cs105
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.resx127
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.Designer.cs26
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.settings5
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs230
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Resources/Batchjob.bat.txt9
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/Resources/Empty_resx.txt120
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.Designer.cs311
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.cs233
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.resx120
-rw-r--r--BuildTools/LocalizationTool/LocalizationTool/app.config5
-rw-r--r--BuildTools/LocalizationTool2/LocalizationEntry.cs29
-rw-r--r--BuildTools/LocalizationTool2/LocalizationTool2.csproj46
-rw-r--r--BuildTools/LocalizationTool2/LocalizationTool2.sln46
-rw-r--r--BuildTools/LocalizationTool2/Program.cs95
-rw-r--r--BuildTools/LocalizationTool2/Properties/AssemblyInfo.cs26
-rw-r--r--BuildTools/LocalizationTool2/packages.config4
23 files changed, 0 insertions, 3130 deletions
diff --git a/BuildTools/LocalizationTool/LocalizationTool.sln b/BuildTools/LocalizationTool/LocalizationTool.sln
deleted file mode 100644
index 80c06b81c..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationTool", "LocalizationTool\LocalizationTool.csproj", "{F093C3D3-28A8-405E-96C0-97AE2C296CCC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duplicati.Library.Utility", "..\..\Duplicati\Library\Utility\Duplicati.Library.Utility.csproj", "{DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {F093C3D3-28A8-405E-96C0-97AE2C296CCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F093C3D3-28A8-405E-96C0-97AE2C296CCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F093C3D3-28A8-405E-96C0-97AE2C296CCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F093C3D3-28A8-405E-96C0-97AE2C296CCC}.Release|Any CPU.Build.0 = Release|Any CPU
- {DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/BuildTools/LocalizationTool/LocalizationTool/CSVReader.cs b/BuildTools/LocalizationTool/LocalizationTool/CSVReader.cs
deleted file mode 100644
index 805fca986..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/CSVReader.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace LocalizationTool
-{
- public class CSVReader : IDisposable
- {
- private System.IO.StreamReader m_reader;
-
- public CSVReader(string filename)
- {
- m_reader = new System.IO.StreamReader(filename, System.Text.Encoding.UTF8, true);
- }
-
- public List<string> AdvanceLine()
- {
- bool inQuote = false;
- StringBuilder sb = new StringBuilder();
- do
- {
- string line = m_reader.ReadLine();
- if (line == null)
- {
- if (sb.Length == 0)
- return null;
- else
- throw new Exception("Unexpected EOF, buffer was: " + sb.ToString());
- }
-
- sb.AppendLine(line);
-
- foreach (char c in line)
- if (c == '"')
- inQuote = !inQuote;
- } while (inQuote);
-
- string txt = sb.ToString();
-
- if (txt.EndsWith("\r\n"))
- txt = txt.Substring(0, txt.Length - 2);
- else if (txt.EndsWith("\r\n"))
- txt = txt.Substring(0, txt.Length - 2);
- else if (txt.EndsWith("\n"))
- txt = txt.Substring(0, txt.Length - 1);
- else if (txt.EndsWith("\r"))
- txt = txt.Substring(0, txt.Length - 1);
-
-
- inQuote = false;
- int ix = 0;
- List<string> result = new List<string>();
- for(int i = 0; i < txt.Length; i++)
- if (inQuote)
- {
- if (txt[i] == '"')
- inQuote = false;
- }
- else
- {
- if (txt[i] == '"')
- inQuote = true;
- else if (txt[i] == ',')
- {
- result.Add(CleanString(txt.Substring(ix, i - ix)));
- ix = i + 1;
- }
- }
-
- if (inQuote)
- throw new Exception("Failed to parse line: " + txt);
-
- if (ix != txt.Length)
- result.Add(CleanString(txt.Substring(ix)));
-
- return result;
- }
-
- private string CleanString(string v)
- {
- //v = v.Trim();
-
- if (v.StartsWith("\"") && v.EndsWith("\""))
- return v.Substring(1, v.Length - 2).Replace("\"\"", "\"");
- else
- return v;
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- if (m_reader != null)
- {
- m_reader.Dispose();
- m_reader = null;
- }
- }
-
- #endregion
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/LinqHelpers.cs b/BuildTools/LocalizationTool/LocalizationTool/LinqHelpers.cs
deleted file mode 100644
index d6660ac2a..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/LinqHelpers.cs
+++ /dev/null
@@ -1,239 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace LocalizationTool
-{
- public static class LinqHelpers
- {
- //
- // Summary:
- // Creates a System.Collections.Generic.Dictionary<TKey,TValue> from an System.Collections.Generic.IEnumerable<T>
- // according to a specified key selector function.
- //
- // Parameters:
- // source:
- // An System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.Dictionary<TKey,TValue>
- // from.
- //
- // keySelector:
- // A function to extract a key from each element.
- //
- // Type parameters:
- // TSource:
- // The type of the elements of source.
- //
- // TKey:
- // The type of the key returned by keySelector.
- //
- // Returns:
- // A System.Collections.Generic.Dictionary<TKey,TValue> that contains keys and
- // values.
- //
- // Exceptions:
- // System.ArgumentNullException:
- // source or keySelector is null. -or- keySelector produces a key that is null.
- public static Dictionary<TKey, TSource> ToSafeDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, string locationName)
- {
- if (source == null)
- throw new ArgumentNullException("source");
- if (keySelector == null)
- throw new ArgumentNullException("keySelector");
-
- Dictionary<TKey, TSource> res = new Dictionary<TKey, TSource>();
- foreach (TSource el in source)
- {
- TKey k = keySelector(el);
- if (res.ContainsKey(k))
- Console.WriteLine("*** Warning, duplicate key: " + k.ToString() + " in " + locationName);
- else
- res.Add(k, el);
- }
-
- return res;
- }
- //
- // Summary:
- // Creates a System.Collections.Generic.Dictionary<TKey,TValue> from an System.Collections.Generic.IEnumerable<T>
- // according to specified key selector and element selector functions.
- //
- // Parameters:
- // source:
- // An System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.Dictionary<TKey,TValue>
- // from.
- //
- // keySelector:
- // A function to extract a key from each element.
- //
- // elementSelector:
- // A transform function to produce a result element value from each element.
- //
- // Type parameters:
- // TSource:
- // The type of the elements of source.
- //
- // TKey:
- // The type of the key returned by keySelector.
- //
- // TElement:
- // The type of the value returned by elementSelector.
- //
- // Returns:
- // A System.Collections.Generic.Dictionary<TKey,TValue> that contains values
- // of type TElement selected from the input sequence.
- //
- // Exceptions:
- // System.ArgumentNullException:
- // source or keySelector or elementSelector is null. -or- keySelector produces
- // a key that is null.
- public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, string locationName)
- {
- if (source == null)
- throw new ArgumentNullException("source");
- if (keySelector == null)
- throw new ArgumentNullException("keySelector");
- if (elementSelector == null)
- throw new ArgumentNullException("elementSelector");
-
- Dictionary<TKey, TElement> res = new Dictionary<TKey, TElement>();
- foreach (TSource el in source)
- {
- TKey k = keySelector(el);
- if (res.ContainsKey(k))
- Console.WriteLine("*** Warning, duplicate key: " + k.ToString() + " in " + locationName);
- else
- res.Add(k, elementSelector(el));
- }
-
- return res;
- }
- //
- // Summary:
- // Creates a System.Collections.Generic.Dictionary<TKey,TValue> from an System.Collections.Generic.IEnumerable<T>
- // according to a specified key selector function and key comparer.
- //
- // Parameters:
- // source:
- // An System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.Dictionary<TKey,TValue>
- // from.
- //
- // keySelector:
- // A function to extract a key from each element.
- //
- // comparer:
- // An System.Collections.Generic.IEqualityComparer<T> to compare keys.
- //
- // Type parameters:
- // TSource:
- // The type of the elements of source.
- //
- // TKey:
- // The type of the keys returned by keySelector.
- //
- // Returns:
- // A System.Collections.Generic.Dictionary<TKey,TValue> that contains keys and
- // values.
- //
- // Exceptions:
- // System.ArgumentNullException:
- // source or keySelector is null. -or- keySelector produces a key that is null.
- public static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer, string locationName)
- {
- if (source == null)
- throw new ArgumentNullException("source");
- if (keySelector == null)
- throw new ArgumentNullException("keySelector");
-
- Dictionary<TKey, TSource> res = new Dictionary<TKey, TSource>(comparer);
- foreach (TSource el in source)
- {
- TKey k = keySelector(el);
- if (res.ContainsKey(k))
- Console.WriteLine("*** Warning, duplicate key: " + k.ToString() + " in " + locationName);
- else
- res.Add(k, el);
- }
-
- return res;
- }
- //
- // Summary:
- // Creates a System.Collections.Generic.Dictionary<TKey,TValue> from an System.Collections.Generic.IEnumerable<T>
- // according to a specified key selector function, a comparer, and an element
- // selector function.
- //
- // Parameters:
- // source:
- // An System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.Dictionary<TKey,TValue>
- // from.
- //
- // keySelector:
- // A function to extract a key from each element.
- //
- // elementSelector:
- // A transform function to produce a result element value from each element.
- //
- // comparer:
- // An System.Collections.Generic.IEqualityComparer<T> to compare keys.
- //
- // Type parameters:
- // TSource:
- // The type of the elements of source.
- //
- // TKey:
- // The type of the key returned by keySelector.
- //
- // TElement:
- // The type of the value returned by elementSelector.
- //
- // Returns:
- // A System.Collections.Generic.Dictionary<TKey,TValue> that contains values
- // of type TElement selected from the input sequence.
- //
- // Exceptions:
- // System.ArgumentNullException:
- // source or keySelector or elementSelector is null. -or- keySelector produces
- // a key that is null.
- public static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, string locationName)
- {
- if (source == null)
- throw new ArgumentNullException("source");
- if (keySelector == null)
- throw new ArgumentNullException("keySelector");
- if (elementSelector == null)
- throw new ArgumentNullException("elementSelector");
-
- Dictionary<TKey, TElement> res = new Dictionary<TKey, TElement>(comparer);
- foreach (TSource el in source)
- {
- TKey k = keySelector(el);
- if (res.ContainsKey(k))
- Console.WriteLine("*** Warning, duplicate key: " + k.ToString() + " in " + locationName);
- else
- res.Add(k, elementSelector(el));
- }
-
- return res;
- }
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/LocalizationTool.csproj b/BuildTools/LocalizationTool/LocalizationTool/LocalizationTool.csproj
deleted file mode 100644
index b3aa9a0d0..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/LocalizationTool.csproj
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{F093C3D3-28A8-405E-96C0-97AE2C296CCC}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>LocalizationTool</RootNamespace>
- <AssemblyName>LocalizationTool</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\..\..\Duplicati\Localization\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <Commandlineparameters>export</Commandlineparameters>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\..\..\Duplicati\Localization\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="CSVReader.cs" />
- <Compile Include="LinqHelpers.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="UpdateGUI.resx">
- <DependentUpon>UpdateGUI.cs</DependentUpon>
- </EmbeddedResource>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- <DesignTime>True</DesignTime>
- </Compile>
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- <Compile Include="ResXCompiler.cs" />
- <Compile Include="UpdateGUI.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="UpdateGUI.Designer.cs">
- <DependentUpon>UpdateGUI.cs</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- <None Include="Resources\Empty_resx.txt" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\Duplicati\Library\Utility\Duplicati.Library.Utility.csproj">
- <Project>{DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}</Project>
- <Name>Duplicati.Library.Utility</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <None Include="Resources\Batchjob.bat.txt" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Program.cs b/BuildTools/LocalizationTool/LocalizationTool/Program.cs
deleted file mode 100644
index 0fd401444..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Program.cs
+++ /dev/null
@@ -1,999 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Windows.Forms;
-using System.Collections.Generic;
-using System.Linq;
-using System.Xml.Linq;
-using System.IO;
-using System.Net;
-
-namespace LocalizationTool
-{
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main(string[] args)
- {
- if (args.Length == 0)
- {
- PrintUsage();
- return;
- }
-
- //All relative paths are to the app dir
- System.IO.Directory.SetCurrentDirectory(Application.StartupPath);
-
- string loc = args.Length >= 2 ? args[1] : null;
-
- switch (args[0].ToLower())
- {
- case "clean":
- case "cleanup":
- Clean(loc);
- break;
- case "build":
- Compile(loc);
- break;
- case "update":
- Update(loc);
- break;
- case "create":
- if (args.Length != 2)
- {
- Console.WriteLine("missing locale identifier");
- PrintUsage();
- return;
- }
- Create(loc);
- break;
- case "report":
- Report(loc);
- break;
- case "export":
- Export(loc);
- break;
- case "exportdiff":
- if (args.Length != 3)
- {
- Console.WriteLine("missing locale identifier or input CSV file");
- PrintUsage();
- return;
- }
-
- ExportDiff(loc, args[2]);
- break;
- case "import":
- if (args.Length != 3)
- {
- Console.WriteLine("missing locale identifier or input CSV file");
- PrintUsage();
- return;
- }
- Import(loc, args[2]);
- break;
- case "guiupdate":
- Application.EnableVisualStyles();
- Application.DoEvents();
-
- Report(loc);
- new UpdateGUI(System.IO.Path.Combine(Application.StartupPath, "report." + loc + ".xml")).ShowDialog();
- break;
- case "webpull":
- WebPull(loc, false);
- break;
- case "webupdate":
- WebPull(loc, true);
- break;
- default:
- PrintUsage();
- return;
- }
- }
-
-
- private static void PrintUsage()
- {
- Console.WriteLine("Usage: ");
-
- Console.WriteLine("LocalizationTool.exe CLEAN [locale identifier]");
- Console.WriteLine("LocalizationTool.exe BUILD [locale identifier]");
- Console.WriteLine("LocalizationTool.exe UPDATE [locale identifier]");
- Console.WriteLine("LocalizationTool.exe REPORT [locale identifier]");
- Console.WriteLine("LocalizationTool.exe CREATE <locale indentifier>");
- Console.WriteLine("LocalizationTool.exe GUIUPDATE <locale identifier>");
- Console.WriteLine("LocalizationTool.exe EXPORT [locale identifier]");
- Console.WriteLine("LocalizationTool.exe IMPORT <locale identifier> <input CSV file>");
- Console.WriteLine("LocalizationTool.exe EXPORTDIFF <locale identifier> <input CSV file>");
- Console.WriteLine("LocalizationTool.exe WEBPULL [locale identifier]");
- Console.WriteLine("LocalizationTool.exe WEBUPDATE [locale identifier]");
- }
-
- private struct CSVEntry
- {
- public string Filename;
- public string Fieldkey;
- public string Origvalue;
- public string Value;
- public string Status;
-
- public string[] extraFields;
-
- public CSVEntry(List<string> fields)
- {
- Filename = fields[0];
- Fieldkey = fields[1];
- Status = fields[2];
- Origvalue = fields[3];
- Value = fields[4];
-
- if (fields.Count > 5)
- {
- extraFields = new string[fields.Count - 5];
- fields.CopyTo(5, extraFields, 0, extraFields.Length);
- }
- else
- extraFields = null;
- }
- }
-
- private static bool IsValidCulture(string c)
- {
- try
- {
- System.Globalization.CultureInfo.GetCultureInfo(c);
- return true;
- }
- catch
- {
- return false;
- }
- }
-
- /// <summary>
- /// Downloads updated CSV files from the web and generates diff files, and optionally updates the local CSV files
- /// </summary>
- /// <param name="loc">The culture to use</param>
- /// <param name="update">True if the elements should be updated as well</param>
- private static void WebPull(string loc, bool update)
- {
- var locs =
- from n in Directory.GetFiles(Application.StartupPath, "report.*.url")
- where IsValidCulture(Path.GetFileNameWithoutExtension(n).Substring("report.".Length))
- select Path.GetFileNameWithoutExtension(n).Substring("report.".Length);
-
- if (!string.IsNullOrEmpty(loc))
- {
- locs = locs.Where(c => string.Equals(c, loc, StringComparison.CurrentCultureIgnoreCase));
- if (locs.Count() == 0)
- {
- Console.WriteLine("No URL file found for culture {0}", loc);
- return;
- }
- }
-
- if (locs.Count() == 0)
- {
- Console.WriteLine("No culture.url files found");
- return;
- }
-
- foreach (var culture in locs)
- {
- var url = string.Format("report.{0}.url", culture);
- var file = string.Format("report.{0}.new.csv", culture);
-
- if (File.Exists(file))
- File.Delete(file);
- Console.Write("Downloading updated CSV for {0} ... ", culture);
- try { new WebClient().DownloadFile(File.ReadAllText(url).Trim(), file); }
- catch (Exception ex)
- {
- Console.WriteLine("Failed!");
- Console.WriteLine(" -> {0}", ex.Message);
- continue;
- }
- Console.WriteLine("Done!");
-
- if (update)
- {
- Console.Write("Updating local files for {0} .", culture);
- ExportDiff(culture, file);
- Console.Write(".");
- Import(culture, file);
- Console.Write(".");
- Export(culture);
- Console.WriteLine(" Done!");
- }
-
- }
-
- }
-
- /// <summary>
- /// Imports a CSV file into a dictionary format,
- /// Outer key is filename, inner key is fieldname, inner value is translated text
- /// </summary>
- /// <param name="file">The CSV file to read from</param>
- /// <param name="loc">The current culture string</param>
- /// <returns>Dictionary where outer key is filename, inner key is fieldname, inner value is translated text</returns>
- private static Dictionary<string, Dictionary<string, CSVEntry>> ImportCSV(string file, string loc, Func<CSVEntry, bool> filter)
- {
- Dictionary<string, Dictionary<string, CSVEntry>> values = new Dictionary<string, Dictionary<string, CSVEntry>>();
-
- using (CSVReader r = new CSVReader(file))
- {
- List<string> fields = null;
- while ((fields = r.AdvanceLine()) != null)
- if (fields.Count >= 5)
- {
- CSVEntry e = new CSVEntry(fields);
- e.Filename = System.IO.Path.Combine(System.IO.Path.Combine(Application.StartupPath, loc), e.Filename);
-
- if (filter != null && filter(e))
- continue;
-
- if (!values.ContainsKey(e.Filename))
- values.Add(e.Filename, new Dictionary<string, CSVEntry>());
-
- Dictionary<string, CSVEntry> l = values[e.Filename];
- l[e.Fieldkey] = e;
- }
- }
-
- return values;
- }
-
- private static void Import(string loc, string p)
- {
- //Outer key is filename, inner key is fieldname, inner value is translated text
- Dictionary<string, Dictionary<string, CSVEntry>> values = ImportCSV(p, loc, e => e.Value.Trim().Length == 0 || e.Value == e.Origvalue);
-
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- {
- Dictionary<string, Dictionary<string, CSVEntry>> remap = new Dictionary<string, Dictionary<string, CSVEntry>>();
- foreach(string key in values.Keys)
- remap[key.Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString ())] = values[key];
-
- values = remap;
- }
-
- string folder = System.IO.Path.Combine(Application.StartupPath, loc);
- if (!System.IO.Directory.Exists(folder))
- Create(loc);
- else
- Update(loc);
-
- XNamespace xmlns = "";
- foreach (ResXFileInfo inf in GetResXList(loc))
- {
- if (System.IO.File.Exists(inf.TargetFile) && values.ContainsKey(inf.TargetFile))
- {
- XDocument targetDoc = XDocument.Load(inf.TargetFile);
- XNode insertTarget = targetDoc.Element("root").LastNode;
- var targetVals = targetDoc.Element("root").Elements("data").ToSafeDictionary(c => c.Attribute("name").Value, inf.TargetFile);
- var sourceVals = values[inf.TargetFile];
- values.Remove(inf.TargetFile);
-
- bool updated = false;
- foreach (var item in sourceVals)
- if (targetVals.ContainsKey(item.Key))
- {
- if (targetVals[item.Key].Element("value").Value.Replace("\r\n", "\n") != item.Value.Value.Replace("\r\n", "\n"))
- {
- updated = true;
- targetVals[item.Key].Element("value").Value = item.Value.Value;
- }
- }
- else
- {
- updated = true;
- insertTarget.AddAfterSelf(new XElement("data",
- new XAttribute("name", item.Key),
- new XAttribute(xmlns + "space", "preserve"),
- new XElement("value", item.Value.Value)
- ));
- }
-
- if (updated)
- targetDoc.Save(inf.TargetFile);
- }
- }
-
- if (values.Count != 0)
- Console.WriteLine("The following files were translated but did not exist: " + string.Join(Environment.NewLine, values.Keys.ToArray()));
- }
-
-
- public static IEnumerable<string> GetLocaleFolders(string locid)
- {
- if (string.IsNullOrEmpty(locid))
- return System.IO.Directory.GetDirectories(Application.StartupPath).Where(c =>
- {
- try
- {
- System.Globalization.CultureInfo.GetCultureInfo(System.IO.Path.GetFileName(c));
- return true;
- }
- catch
- {
- return false;
- }
- }).Select(c => System.IO.Path.GetFileName(c));
- else
- return new string[] { locid };
- }
-
- private static void Export(string cultures)
- {
- Update(cultures);
- Report(cultures);
-
- foreach (string culture in GetLocaleFolders(cultures))
- {
- XDocument doc = XDocument.Load(System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".xml"));
- string outfile = System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".csv");
-
- Dictionary<string, Dictionary<string, CSVEntry>> elems = new Dictionary<string, Dictionary<string, CSVEntry>>();
- foreach (var file in doc.Element("root").Elements("file"))
- {
- string filename = file.Attribute("filename").Value.Substring(Duplicati.Library.Utility.Utility.AppendDirSeparator(Application.StartupPath).Length);
- filename = filename.Substring(culture.Length + 1);
-
- Dictionary<string, CSVEntry> e = new Dictionary<string, CSVEntry>();
- elems[filename] = e;
-
- foreach (var item in file.Element("updated").Elements("item"))
- {
- CSVEntry c = new CSVEntry();
- c.Filename = filename;
- c.Fieldkey = item.Attribute("name").Value;
- c.Status = item.Parent.Name.LocalName;
- c.Origvalue = item.Element("original").Value;
- c.Value = item.Element("translated").Value;
- e.Add(c.Fieldkey, c);
-
- }
-
- foreach (var item in file.Element("missing").Elements("item"))
- {
- CSVEntry c = new CSVEntry();
- c.Filename = filename;
- c.Fieldkey = item.Attribute("name").Value;
- c.Status = item.Parent.Name.LocalName;
- c.Origvalue = item.Value;
- c.Value = "";
- e.Add(c.Fieldkey, c);
- }
-
- foreach (var item in file.Element("not-updated").Elements("item"))
- {
- CSVEntry c = new CSVEntry();
- c.Filename = filename;
- c.Fieldkey = item.Attribute("name").Value;
- c.Status = item.Parent.Name.LocalName;
- c.Origvalue = item.Value;
- c.Value = "";
- e.Add(c.Fieldkey, c);
- }
-
- foreach (var item in file.Element("unused").Elements("item"))
- {
- CSVEntry c = new CSVEntry();
- c.Filename = filename;
- c.Fieldkey = item.Attribute("name").Value;
- c.Status = item.Parent.Name.LocalName;
- c.Origvalue = "";
- c.Value = item.Value;
- e.Add(c.Fieldkey, c);
- }
-
- }
-
- WriteCSVFile(outfile, culture, elems, null);
- }
- }
-
- private static void ExportDiff(string culture, string inputfile)
- {
- inputfile = System.IO.Path.GetFullPath(inputfile);
-
- string currentFile = System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".csv");
- string diffFile = System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".diff.csv");
-
- if (currentFile.Equals(inputfile, Duplicati.Library.Utility.Utility.ClientFilenameStringComparision))
- throw new Exception("Input file will be overwritten, please use another file");
-
- Export(culture);
-
-
- //Outer key is filename, inner key is fieldname, inner value is translated text
- Dictionary<string, Dictionary<string, CSVEntry>> inputValues = ImportCSV(inputfile, culture, null);
- Dictionary<string, Dictionary<string, CSVEntry>> currentValues = ImportCSV(currentFile, culture, null);
-
- Dictionary<string, Dictionary<string, CSVEntry>> added = new Dictionary<string, Dictionary<string, CSVEntry>>();
- Dictionary<string, Dictionary<string, CSVEntry>> removed = new Dictionary<string, Dictionary<string, CSVEntry>>();
-
- foreach (var f in currentValues)
- {
- Dictionary<string, CSVEntry> other;
- inputValues.TryGetValue(f.Key, out other);
-
- if (other == null)
- {
- added.Add(f.Key, f.Value);
- }
- else
- {
- Dictionary<string, CSVEntry> a = new Dictionary<string,CSVEntry>();
-
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- {
- if (other.ContainsKey(s.Key))
- other.Remove(s.Key);
- else
- a.Add(s.Key, s.Value);
- }
-
- if (a.Count > 0)
- added.Add(f.Key, a);
-
- if (other.Count > 0)
- removed.Add(f.Key, other);
- }
- }
-
- Dictionary<string, Dictionary<string, string>> overrides = new Dictionary<string, Dictionary<string, string>>();
- Dictionary<string, Dictionary<string, CSVEntry>> diffElems = new Dictionary<string, Dictionary<string, CSVEntry>>();
-
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in added)
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- if (s.Value.Origvalue == s.Value.Value || s.Value.Value.Trim().Length == 0)
- {
- if (!overrides.ContainsKey(f.Key))
- overrides.Add(f.Key, new Dictionary<string, string>());
- if (!diffElems.ContainsKey(f.Key))
- diffElems.Add(f.Key, new Dictionary<string, CSVEntry>());
- overrides[f.Key].Add(s.Key, "not-updated");
- diffElems[f.Key].Add(s.Key, s.Value);
- }
-
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in removed)
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- {
- if (!overrides.ContainsKey(f.Key))
- overrides.Add(f.Key, new Dictionary<string, string>());
- if (!diffElems.ContainsKey(f.Key))
- diffElems.Add(f.Key, new Dictionary<string, CSVEntry>());
- overrides[f.Key].Add(s.Key, "unused");
- diffElems[f.Key].Add(s.Key, s.Value);
- }
-
- WriteCSVFile(diffFile, culture, diffElems, overrides);
-
- //Re-read the file
- inputValues = ImportCSV(inputfile, culture, null);
-
- //Add the new entries
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in added)
- {
- if (!inputValues.ContainsKey(f.Key))
- inputValues.Add(f.Key, new Dictionary<string, CSVEntry>());
-
- Dictionary<string, CSVEntry> o = inputValues[f.Key];
-
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- o.Add(s.Key, s.Value);
-
- }
-
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in currentValues)
- {
- Dictionary<string, CSVEntry> o = inputValues[f.Key];
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- {
- CSVEntry c = o[s.Key];
- if (s.Value.Status == "unused")
- c.Status = "unused";
- else if (c.Origvalue == c.Value)
- c.Status = "not-updated";
- else if (string.IsNullOrEmpty(c.Value) || c.Value.Trim().Length == 0)
- c.Status = "missing";
- else
- c.Status = "updated";
-
- o[s.Key] = c;
- }
- }
-
- //Update the removed entries
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in removed)
- {
- Dictionary<string, CSVEntry> o = inputValues[f.Key];
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- {
- CSVEntry c = o[s.Key];
- c.Status = "unused";
- o[s.Key] = c;
- }
- }
-
-
-
- //Write the output file
- diffFile = System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".updated.csv");
- WriteCSVFile(diffFile, culture, inputValues, null);
- }
-
- private static void WriteCSVFile(string filename, string culture, Dictionary<string, Dictionary<string, CSVEntry>> entries, Dictionary<string, Dictionary<string, string>> status_overrides)
- {
- if (status_overrides == null)
- status_overrides = new Dictionary<string, Dictionary<string, string>>();
-
- List<KeyValuePair<string, KeyValuePair<string, CSVEntry>>> sortlist = new List<KeyValuePair<string, KeyValuePair<string, CSVEntry>>>();
- foreach (KeyValuePair<string, Dictionary<string, CSVEntry>> f in entries)
- foreach (KeyValuePair<string, CSVEntry> s in f.Value)
- sortlist.Add(new KeyValuePair<string, KeyValuePair<string, CSVEntry>>(f.Key, s));
-
- var sortedlist = sortlist.OrderBy(x => x.Key + System.IO.Path.PathSeparator + x.Value.Key);
-
- using (System.IO.StreamWriter sw = new System.IO.StreamWriter(filename, false, new System.Text.UTF8Encoding(false)))
- {
- string filenameprefix = System.IO.Path.Combine(Application.StartupPath, culture);
- int pfl = filenameprefix.Length + 1;
-
- foreach (KeyValuePair<string, KeyValuePair<string, CSVEntry>> f in sortedlist)
- {
- string status = f.Value.Value.Status;
- if (status_overrides.ContainsKey(f.Key) && status_overrides[f.Key].ContainsKey(f.Value.Key))
- status = status_overrides[f.Key][f.Value.Key];
-
- string path = f.Key;
- if (f.Key.StartsWith(filenameprefix, Duplicati.Library.Utility.Utility.ClientFilenameStringComparision))
- path = f.Key.Substring(Math.Min(pfl, f.Key.Length));
-
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- path = path.Replace(System.IO.Path.DirectorySeparatorChar.ToString(), "\\");
-
- WriteCSVLine(sw, path, f.Value.Key, status, f.Value.Value.Origvalue, f.Value.Value.Value, f.Value.Value.extraFields);
- }
- }
- }
-
- private static string CSV_SEPARATOR = ",";
-
- private static void WriteCSVLine(System.IO.StreamWriter sw, string filename, string key, string status, string originalText, string translatedText, string[] extraFields)
- {
- sw.Write(EscapeCSVString(filename));
- sw.Write(CSV_SEPARATOR);
- sw.Write(EscapeCSVString(key));
- sw.Write(CSV_SEPARATOR);
- sw.Write(EscapeCSVString(status));
- sw.Write(CSV_SEPARATOR);
- sw.Write(EscapeCSVString(originalText));
- sw.Write(CSV_SEPARATOR);
- sw.Write(EscapeCSVString(translatedText));
-
- if (extraFields != null && extraFields.Length > 0)
- foreach (string s in extraFields)
- {
- sw.Write(CSV_SEPARATOR);
- sw.Write(EscapeCSVString(s));
- }
-
- sw.Write("\r\n");
- }
-
- private static string EscapeCSVString(string value)
- {
- //.Replace("\\", "\\\\").Replace("\r\n", "\\n").Replace("\r", "\\n").Replace("\n", "\\n").Replace("\t", "\\t")
- return "\"" + value.Replace("\"", "\"\"") + "\"";
- }
-
- private static void Report(string cultures)
- {
- foreach (string culture in GetLocaleFolders(cultures))
- {
- Dictionary<string, string> ignores = new Dictionary<string, string>();
- string ignorefile = System.IO.Path.Combine(Application.StartupPath, "ignore." + culture + ".xml");
- if (System.IO.File.Exists(ignorefile))
- ignores = XDocument.Load(ignorefile).Element("root").Elements("ignore").Select(c => c.Value).ToSafeDictionary(c => c.ToLower().Trim(), ignorefile);
-
- //Make sure we ignore empty strings
- ignores[""] = "";
-
- //Ignore common leftover values
- for (int i = 1; i < 20; i++)
- {
- string _i = i.ToString();
- ignores["textbox" + _i] = "";
- ignores["combobox" + _i] = "";
- ignores["checkbox" + _i] = "";
- ignores["label" + _i] = "";
- ignores["radiobutton" + _i] = "";
- ignores["button" + _i] = "";
- ignores["toolstrip" + _i] = "";
- ignores["toolstripbutton" + _i] = "";
- ignores["statusstrip" + _i] = "";
- }
-
-
- XDocument report = new XDocument(
- new XElement("root")
- );
- XElement reportRoot = report.Element("root");
-
- IEnumerable<ResXFileInfo> files = GetResXList(culture);
- var missingFiles = files.Where(c => !System.IO.File.Exists(c.TargetFile));
- var existingFiles = files.Where(c => System.IO.File.Exists(c.TargetFile));
-
- var extraFiles = from x in Duplicati.Library.Utility.Utility.EnumerateFiles(System.IO.Path.Combine(Application.StartupPath, culture))
- where
- x.EndsWith("." + culture + ".resx")
- &&
- !files.Select(c => c.TargetFile).Contains(x)
- select x;
-
- reportRoot.Add(
- new XElement("files",
- new XElement("missing",
- from x in missingFiles
- select new XElement("file", x.TargetFile)
- ),
- new XElement("unused",
- from x in extraFiles
- select new XElement("file", x)
- )
- )
- );
-
- foreach(ResXFileInfo inf in existingFiles)
- {
- IEnumerable<XElement> sourceElements = XDocument.Load(inf.SourceFile).Element("root").Elements("data");
- IEnumerable<XElement> targetElements = XDocument.Load(inf.TargetFile).Element("root").Elements("data");
-
- if (inf.IsForm)
- {
- //Look only for strings
- Func<XElement, bool> filter =
- c =>
- !c.Attribute("name").Value.StartsWith(">>")
- &&
- c.Attribute("mimetype") == null
- &&
- (
- c.Attribute("type") == null
- ||
- c.Attribute("type").Value == "System.String, mscorlib"
- ||
- c.Attribute("type").Value == "System.String"
- );
-
- sourceElements = sourceElements.Where(filter);
- targetElements = targetElements.Where(filter);
- }
-
- //Filter the source and target before proceeding
- sourceElements = sourceElements.Where(c => !ignores.ContainsKey(c.Element("value").Value.Trim().ToLower()) && !c.Element("value").Value.Trim().ToLower().StartsWith("..\\resources\\") && !c.Element("value").Value.Trim().ToLower().StartsWith("../resources/"));
- targetElements = targetElements.Where(c => !ignores.ContainsKey(c.Element("value").Value.Trim().ToLower()) && !c.Element("value").Value.Trim().ToLower().StartsWith("..\\resources\\") && !c.Element("value").Value.Trim().ToLower().StartsWith("../resources/"));
-
- var sourceVals = sourceElements.ToSafeDictionary(c => c.Attribute("name").Value, inf.SourceFile);
- var targetVals = targetElements.ToSafeDictionary(c => c.Attribute("name").Value, inf.TargetFile);
-
- var missing = sourceVals.Where(c => !targetVals.ContainsKey(c.Key)).ToList();
- var unused = targetVals.Where(c => !sourceVals.ContainsKey(c.Key)).ToList();
- var notUpdated = sourceVals.Where(c =>
- targetVals.ContainsKey(c.Key)
- &&
- targetVals[c.Key].Element("value").Value == c.Value.Element("value").Value).ToList();
-
- var updated = sourceVals.Where(c =>
- !missing.Contains(c)
- &&
- !unused.Contains(c)
- &&
- !notUpdated.Contains(c)
- &&
- targetVals.ContainsKey(c.Key)
- );
-
- var yy = sourceVals.Values.Where(x => x.Value.Contains("System.Draw")).Concat(targetVals.Values.Where(x => x.Value.Contains("System.Draw")));
- if (yy.Count() != 0)
- {
- }
-
- reportRoot.Add(
- new XElement("file",
- new XAttribute("filename", inf.TargetFile),
- new XElement("missing",
- from x in missing
- select new XElement("item",
- new XAttribute("name", x.Key),
- x.Value.Element("value").Value
- )
- ),
- new XElement("unused",
- from x in unused
- select new XElement("item",
- new XAttribute("name", x.Key),
- x.Value.Element("value").Value
- )
- ),
- new XElement("not-updated",
- from x in notUpdated
- select new XElement("item",
- new XAttribute("name", x.Key),
- x.Value.Element("value").Value
- )
- ),
- new XElement("updated",
- from x in updated
- select new XElement("item",
- new XAttribute("name", x.Key),
- new XElement("original",
- x.Value.Element("value").Value
- ),
- new XElement("translated",
- targetVals[x.Key].Element("value").Value
- )
- )
- )
- )
- );
- }
-
- report.Save(System.IO.Path.Combine(Application.StartupPath, "report." + culture + ".xml"));
- }
- }
-
- private static void Create(string culture)
- {
- System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.GetCultureInfo(culture); //Validate
- string folder = System.IO.Path.Combine(Application.StartupPath, culture);
- if (!System.IO.Directory.Exists(folder))
- System.IO.Directory.CreateDirectory(folder);
- Update(culture);
- }
-
- public class ResXFileInfo
- {
- public string SourceFile { get; set; }
- public string TargetFile { get; set; }
- public string NetrualTargetFile { get; set; }
- public bool IsForm { get; set; }
- }
-
- public static IEnumerable<ResXFileInfo> GetResXList(string culture)
- {
- List<ResXFileInfo> res = new List<ResXFileInfo>();
- foreach (XElement conf in XDocument.Load(System.IO.Path.Combine(Application.StartupPath, "configuration.xml")).Element("root").Elements("configuration"))
- {
- string sourcefolder = conf.Element("sourcefolder").Value;
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- sourcefolder = sourcefolder.Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString());
-
- string outputfolder = System.IO.Path.GetFullPath(Duplicati.Library.Utility.Utility.AppendDirSeparator(System.IO.Path.Combine(Application.StartupPath, culture)));
- sourcefolder = Duplicati.Library.Utility.Utility.AppendDirSeparator(System.IO.Path.GetFullPath(sourcefolder));
-
- foreach (XElement fn in conf.Elements("assembly"))
- {
- string subfolder = fn.Attribute("folder").Value;
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- subfolder = subfolder.Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString());
-
- foreach (string s in Duplicati.Library.Utility.Utility.EnumerateFiles(System.IO.Path.Combine(sourcefolder, subfolder)))
- {
- if (s.ToLower().StartsWith(Application.StartupPath.ToLower()))
- continue;
-
- if (s.EndsWith(".resx"))
- {
- string targetNameNeutral = System.IO.Path.Combine(outputfolder, s.Substring(sourcefolder.Length));
-
- if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(targetNameNeutral)))
- System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(targetNameNeutral));
-
- string targetFilename = targetNameNeutral.Substring(0, targetNameNeutral.Length - "resx".Length) + culture + ".resx";
- if (res.Where(x => x.TargetFile == targetFilename).FirstOrDefault() == null)
- res.Add(new ResXFileInfo()
- {
- SourceFile = s,
- IsForm = System.IO.File.Exists(System.IO.Path.ChangeExtension(s, ".cs")),
- NetrualTargetFile = targetNameNeutral,
- TargetFile = targetFilename
- });
- }
- }
- }
- }
-
- return res;
- }
-
- private static void Update(string cultures)
- {
- foreach (string culture in GetLocaleFolders(cultures))
- {
- foreach (ResXFileInfo inf in GetResXList(culture))
- {
- if (inf.IsForm)
- System.IO.File.Copy(inf.SourceFile, inf.NetrualTargetFile, true); //Copy the updated resx
-
- if (System.IO.File.Exists(inf.TargetFile))
- {
- //Merge, forms are auto-merged, in that they depend on the neutral .resx file
- if (!inf.IsForm)
- {
- XDocument targetDoc = XDocument.Load(inf.TargetFile);
- XNode insertTarget = targetDoc.Element("root").LastNode;
-
- var sourceVals = XDocument.Load(inf.SourceFile).Element("root").Elements("data").ToSafeDictionary(c => c.Attribute("name").Value, inf.SourceFile);
- var targetVals = targetDoc.Element("root").Elements("data").ToSafeDictionary(c => c.Attribute("name").Value, inf.TargetFile);
-
- bool updated = false;
- foreach (var item in sourceVals)
- if (!targetVals.ContainsKey(item.Key))
- {
- updated = true;
- insertTarget.AddAfterSelf(new XElement(item.Value));
- }
-
- if (updated)
- targetDoc.Save(inf.TargetFile);
- }
- }
- else
- {
- if (inf.IsForm)
- using (System.IO.StreamWriter sw = new System.IO.StreamWriter(inf.TargetFile))
- sw.Write(Properties.Resources.Empty_resx);
- else
- {
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- {
- var doc = XDocument.Load(inf.SourceFile);
- var entries = from x in doc.Element("root").Elements("data")
- where
- x.Attribute("type") != null
- &&
- x.Attribute("type").Value == "System.Resources.ResXFileRef, System.Windows.Forms"
- select x;
-
- foreach(var e in entries)
- {
- string name = e.Element("value").Value;
- int ixpos = name.IndexOf(";");
- string path = name.Substring(0, ixpos);
- path = path.Replace ("\\", System.IO.Path.DirectorySeparatorChar.ToString());
- e.Element("value").Value = path + name.Substring(ixpos);
- }
-
- doc.Save(inf.TargetFile);
-
- } else {
- System.IO.File.Copy(inf.SourceFile, inf.TargetFile);
- }
- }
- }
-
-
- foreach (var item in from y in
- (from x in XDocument.Load(inf.SourceFile).Element("root").Elements("data")
- where
- x.Attribute("type") != null
- &&
- x.Attribute("type").Value == "System.Resources.ResXFileRef, System.Windows.Forms"
- select x)
- let relname = y.Element("value").Value.Substring(0, y.Element("value").Value.IndexOf(";"))
- let sourceRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(inf.SourceFile), relname)).Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString())
- let targetRes = System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(inf.TargetFile), relname)).Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString())
-
- select new { sourceRes, targetRes }
- )
- {
- if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(item.targetRes)))
- System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(item.targetRes));
-
- if (!System.IO.File.Exists(item.targetRes))
- {
- if (Duplicati.Library.Utility.Utility.IsClientLinux && !System.IO.File.Exists(item.sourceRes))
- {
- string basefolder = System.IO.Path.GetDirectoryName(item.sourceRes);
- string sourcefile = System.IO.Directory.GetFiles (basefolder).FirstOrDefault (x => item.sourceRes.Equals(x, StringComparison.InvariantCultureIgnoreCase));
- if (sourcefile == null)
- Console.WriteLine ("Source file not found: " + item.sourceRes);
- else
- System.IO.File.Copy (sourcefile, item.targetRes);
-
- } else {
- System.IO.File.Copy(item.sourceRes, item.targetRes);
- }
- }
- }
-
- }
-
- string batchfilename = System.IO.Path.Combine(System.IO.Path.Combine(Application.StartupPath, culture), "gui update.bat");
- System.IO.File.WriteAllText(batchfilename, Properties.Resources.Batchjob_bat, System.Text.Encoding.Default);
- }
- }
-
-
-
- private static void Clean(string cultureReq)
- {
- string root = Duplicati.Library.Utility.Utility.AppendDirSeparator(Application.StartupPath);
- if (!string.IsNullOrEmpty(cultureReq))
- root = System.IO.Path.Combine(root, cultureReq);
-
- foreach (string s in Duplicati.Library.Utility.Utility.EnumerateFiles(Application.StartupPath))
- if (System.IO.Path.GetDirectoryName(s) != Application.StartupPath && (System.IO.Path.GetExtension(s) == ".resources" || System.IO.Path.GetExtension(s) == ".dll"))
- System.IO.File.Delete(s);
- else if (System.IO.Path.GetExtension(s) == ".resx")
- {
- //Remove the extra files required for resgen.exe
- string culture = s.Substring(root.Length);
- culture = culture.Substring(0, culture.IndexOf(System.IO.Path.DirectorySeparatorChar));
- if (!s.ToLower().EndsWith("." + culture.ToLower() + ".resx") && System.IO.File.Exists(s.Substring(0, s.Length - "resx".Length) + culture + ".resx"))
- System.IO.File.Delete(s);
- }
-
- }
-
- private static void Compile(string cultureReq)
- {
- XDocument doc = XDocument.Load(System.IO.Path.Combine(Application.StartupPath, "configuration.xml"));
-
- foreach (XElement conf in doc.Element("root").Elements("configuration"))
- {
- string keyfile = conf.Element("keyfile") == null ? null : conf.Element("keyfile").Value;
- string versionassembly = conf.Element("versionassembly").Value;
- string outputfolder = conf.Element("outputfolder").Value;
- string productname = conf.Element("productname").Value;
- string fxVer = conf.Element("frameworkVersion") == null ? "4.0" : conf.Element("frameworkVersion").Value;
-
- Console.WriteLine("Compiling for framework: " + fxVer);
-
- foreach (XElement n in conf.Elements("assembly"))
- {
- string assemblyName = n.Attribute("name").Value;
- string folder = n.Attribute("folder").Value;
- string @namespace = n.Attribute("namespace") == null ? assemblyName : n.Attribute("namespace").Value;
-
- foreach (string culture in GetLocaleFolders(cultureReq))
- {
- List<string> excludes = (from x in n.Elements("exclude")
- let fullpath = System.IO.Path.Combine(System.IO.Path.Combine(Application.StartupPath, culture), x.Value)
- select fullpath).ToList();
-
- 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(System.IO.Path.Combine(Application.StartupPath, culture), folder), excludes, @namespace, System.IO.Path.Combine(outfolder, assemblyName + ".resources.dll"), System.IO.Path.GetFullPath(versionassembly), keyfile, culture, productname, fxVer);
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Properties/AssemblyInfo.cs b/BuildTools/LocalizationTool/LocalizationTool/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1390e93f9..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("LocalizationTool")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Duplicati Team")]
-[assembly: AssemblyProduct("LocalizationTool")]
-[assembly: AssemblyCopyright("Copyright © Duplicati Team 2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("6f59216b-26e5-48cc-907b-16a97c7625df")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.0.0.7")]
-[assembly: AssemblyFileVersion("2.0.0.7")]
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.Designer.cs b/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.Designer.cs
deleted file mode 100644
index c9038c95b..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,105 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.544
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace LocalizationTool.Properties {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LocalizationTool.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to @echo off
- ///
- ///echo Processing updates, please wait ...
- ///
- ///set FOLDERNAME=
- ///for /f &quot;tokens=*&quot; %%a in (&quot;%CD%&quot;) do set FOLDERNAME=%%~na
- ///
- ///..\LocalizationTool.exe update %FOLDERNAME%
- ///..\LocalizationTool.exe guiupdate %FOLDERNAME%.
- /// </summary>
- internal static string Batchjob_bat {
- get {
- return ResourceManager.GetString("Batchjob.bat", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
- ///&lt;root&gt;
- /// &lt;!--
- /// Microsoft ResX Schema
- ///
- /// Version 2.0
- ///
- /// The primary goals of this format is to allow a simple XML format
- /// that is mostly human readable. The generation and parsing of the
- /// various data types are done through the TypeConverter classes
- /// associated with the data types.
- ///
- /// Example:
- ///
- /// ... ado.net/XML headers &amp; schema ...
- /// &lt;resheader name=&quot;resmimetype&quot;&gt;text/microsoft-resx&lt;/resheader&gt;
- /// &lt;resheader n [rest of string was truncated]&quot;;.
- /// </summary>
- internal static string Empty_resx {
- get {
- return ResourceManager.GetString("Empty_resx", resourceCulture);
- }
- }
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.resx b/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.resx
deleted file mode 100644
index 3fb3e1583..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Properties/Resources.resx
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <data name="Batchjob.bat" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\Batchjob.bat.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
- </data>
- <data name="Empty_resx" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\Empty_resx.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
- </data>
-</root> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.Designer.cs b/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.Designer.cs
deleted file mode 100644
index 5870bf2f4..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.544
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace LocalizationTool.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.settings b/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.settings
deleted file mode 100644
index 2bd17f050..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Properties/Settings.settings
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
- <Profiles />
- <Settings />
-</SettingsFile> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs b/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs
deleted file mode 100644
index 218085c36..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/ResXCompiler.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using System.Configuration;
-
-namespace LocalizationTool
-{
- public static class ResXCompiler
- {
- private static string ExecuteAndRead(string command, string arguments)
- {
- var psi = new System.Diagnostics.ProcessStartInfo(command, arguments);
- psi.RedirectStandardOutput = true;
- psi.UseShellExecute = false;
-
- var pi = System.Diagnostics.Process.Start(psi);
- pi.WaitForExit(5000);
- if (pi.HasExited)
- return pi.StandardOutput.ReadToEnd().Trim();
-
- return null;
- }
-
- public static void CompileResxFiles(string folder, List<string> excludeFolders, string @namespace, string assemblyname, string versionAssembly, string keyfile, string culture, string productname, string fxVer)
- {
- string resgenexe;
- string alexe;
- if (Duplicati.Library.Utility.Utility.IsClientLinux)
- {
- resgenexe = ExecuteAndRead("which", "resgen");
- alexe = ExecuteAndRead("which", "al");
- }
- else //Windows
- {
- //Order of these paths is also the search order
- string[] known_sdk_paths = null;
- if (fxVer == "2.0")
- {
- known_sdk_paths = new string[]
- {
- Environment.ExpandEnvironmentVariables("%WINDIR%\\Microsoft.Net\\Framework\\v2.0.50727\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft.NET\\SDK\\v2.0\\bin\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft.NET\\SDK\\v2.0\\bin\\"),
- };
- }
- else if (fxVer == "3.0")
- {
- known_sdk_paths = new string[]
- {
- Environment.ExpandEnvironmentVariables("%WINDIR%\\Microsoft.Net\\Framework\\v3.0\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft SDKs\\Windows\\v6.0A\\bin\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft SDKs\\Windows\\v6.0A\\bin\\"),
-
- };
- }
- else if (fxVer == "3.5")
- {
- known_sdk_paths = new string[]
- {
- Environment.ExpandEnvironmentVariables("%WINDIR%\\Microsoft.Net\\Framework\\v3.5\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft SDKs\\Windows\\v7.0A\\bin\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft SDKs\\Windows\\v7.0A\\bin\\"),
- };
- }
- else
- {
- known_sdk_paths = new string[]
- {
- Environment.ExpandEnvironmentVariables("%WINDIR%\\Microsoft.Net\\Framework\\v4.0\\"),
- Environment.ExpandEnvironmentVariables("%WINDIR%\\Microsoft.Net\\Framework\\v4.0.30319\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft SDKs\\Windows\\v8.0A\\bin\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft SDKs\\Windows\\v8.0A\\bin\\NETFX 4.0 Tools\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES%\\Microsoft SDKs\\Windows\\v7.1\\Bin\\NETFX 4.0 Tools\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft SDKs\\Windows\\v8.0A\\bin\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft SDKs\\Windows\\v8.0A\\bin\\NETFX 4.0 Tools\\"),
- Environment.ExpandEnvironmentVariables("%PROGRAMFILES(X86)%\\Microsoft SDKs\\Windows\\v7.1\\Bin\\NETFX 4.0 Tools\\"),
- };
- }
- resgenexe = "resgen.exe";
- alexe = "al.exe";
-
- foreach(var p in known_sdk_paths)
- if (System.IO.File.Exists(System.IO.Path.Combine(p, resgenexe)))
- {
- resgenexe = System.IO.Path.Combine(p, resgenexe);
- break;
- }
-
- foreach (var p in known_sdk_paths)
- if (System.IO.File.Exists(System.IO.Path.Combine(p, alexe)))
- {
- alexe = System.IO.Path.Combine(p, alexe);
- break;
- }
-
- }
- if (!System.IO.File.Exists(resgenexe))
- {
- Console.WriteLine("Unable to locate file: {0}", resgenexe);
- Console.WriteLine("This can be fixed by installing a microsoft platform SDK, or visual studio (express is fine)");
- return;
- }
-
- if (!System.IO.File.Exists(alexe))
- {
- Console.WriteLine("Unable to locate file: {0}", alexe);
- Console.WriteLine("This can be fixed by installing the .Net framework version 2.0");
- return;
- }
-
- if (!string.IsNullOrEmpty(keyfile) && Duplicati.Library.Utility.Utility.IsClientLinux)
- keyfile = keyfile.Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString());
-
-
- List<string> resources = new List<string>();
-
- folder = Duplicati.Library.Utility.Utility.AppendDirSeparator(folder);
-
- foreach (string s in Duplicati.Library.Utility.Utility.EnumerateFiles(folder))
- {
- if (s.ToLower().EndsWith("." + culture.ToLower() + ".resx"))
- {
- if (excludeFolders.Any(xf => s.ToLower().StartsWith(Duplicati.Library.Utility.Utility.AppendDirSeparator(xf).ToLower())))
- continue;
-
- string resname = System.IO.Path.ChangeExtension(s, ".resources");
-
- if (!System.IO.File.Exists(resname) || System.IO.File.GetLastWriteTime(resname) < System.IO.File.GetLastWriteTime(s))
- {
- Console.WriteLine("Compiling: " + s);
- System.Diagnostics.ProcessStartInfo pi = new System.Diagnostics.ProcessStartInfo(resgenexe, "\"" + s + "\"");
- pi.CreateNoWindow = true;
- pi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
- pi.RedirectStandardOutput = true;
- pi.RedirectStandardError = true;
- pi.UseShellExecute = false;
- pi.WorkingDirectory = System.IO.Path.GetDirectoryName(s);
-
- System.Diagnostics.Process pr = System.Diagnostics.Process.Start(pi);
- pr.WaitForExit();
-
- if (pr.ExitCode != 0)
- {
- Console.WriteLine("Error");
- Console.WriteLine(pr.StandardOutput.ReadToEnd());
- Console.WriteLine(pr.StandardError.ReadToEnd());
- throw new Exception("Resgen failure: " + s);
- }
- }
- else
- Console.WriteLine("Not modified: " + s);
-
- resources.Add(resname);
- }
- }
-
- if (resources.Count == 0)
- return;
-
- if (!System.IO.File.Exists(versionAssembly) && Duplicati.Library.Utility.Utility.IsClientLinux)
- versionAssembly = versionAssembly.Replace("\\", System.IO.Path.DirectorySeparatorChar.ToString());
-
- if (!System.IO.File.Exists(versionAssembly))
- {
- Console.WriteLine("Unable to locate file: {0}", versionAssembly);
- Console.WriteLine("This can be fixed by compiling the application or modifying the file configuration.xml");
- return;
- }
-
- using (Duplicati.Library.Utility.TempFile tf = new Duplicati.Library.Utility.TempFile())
- {
- using (System.IO.StreamWriter sw = new System.IO.StreamWriter(tf))
- {
- System.Reflection.Assembly asm = System.Reflection.Assembly.ReflectionOnlyLoadFrom(versionAssembly);
-
- sw.WriteLine("/t:lib");
- sw.WriteLine("/out:\"" + assemblyname + "\"");
- sw.WriteLine("/product:\"" + productname + "\"");
- sw.WriteLine("/title:\"" + productname + "\"");
- sw.WriteLine("/version:" + asm.GetName().Version.ToString());
- if (!string.IsNullOrEmpty(keyfile))
- sw.WriteLine("/keyfile:\"" + keyfile + "\"");
- sw.WriteLine("/culture:" + culture);
-
- foreach (string s in resources)
- {
- string resname = s.Substring(folder.Length);
- resname = resname.Replace("\\", ".");
- resname = resname.Replace(" ", "_");
- resname = @namespace + "." + resname;
-
- sw.WriteLine("/embed:\"" + s + "\"," + resname);
- }
- }
-
- Console.WriteLine("Linking ...");
- System.Diagnostics.ProcessStartInfo pi = new System.Diagnostics.ProcessStartInfo(alexe, "@\"" + tf + "\"");
- pi.CreateNoWindow = true;
- pi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
-
- System.Diagnostics.Process pr = System.Diagnostics.Process.Start(pi);
- pr.WaitForExit();
-
- if (pr.ExitCode != 0)
- throw new Exception("Linker failure");
- }
-
- }
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Resources/Batchjob.bat.txt b/BuildTools/LocalizationTool/LocalizationTool/Resources/Batchjob.bat.txt
deleted file mode 100644
index 3c41bda52..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Resources/Batchjob.bat.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-@echo off
-
-echo Processing updates, please wait ...
-
-set FOLDERNAME=
-for /f "tokens=*" %%a in ("%CD%") do set FOLDERNAME=%%~na
-
-..\LocalizationTool.exe update %FOLDERNAME%
-..\LocalizationTool.exe guiupdate %FOLDERNAME% \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/Resources/Empty_resx.txt b/BuildTools/LocalizationTool/LocalizationTool/Resources/Empty_resx.txt
deleted file mode 100644
index ff31a6db5..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/Resources/Empty_resx.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.Designer.cs b/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.Designer.cs
deleted file mode 100644
index 876605a2b..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.Designer.cs
+++ /dev/null
@@ -1,311 +0,0 @@
-namespace LocalizationTool
-{
- partial class UpdateGUI
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.panel1 = new System.Windows.Forms.Panel();
- this.panel2 = new System.Windows.Forms.Panel();
- this.splitContainer1 = new System.Windows.Forms.SplitContainer();
- this.treeView1 = new System.Windows.Forms.TreeView();
- this.label1 = new System.Windows.Forms.Label();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.panel3 = new System.Windows.Forms.Panel();
- this.label7 = new System.Windows.Forms.Label();
- this.panel4 = new System.Windows.Forms.Panel();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.label8 = new System.Windows.Forms.Label();
- this.panel1.SuspendLayout();
- this.panel2.SuspendLayout();
- this.splitContainer1.Panel1.SuspendLayout();
- this.splitContainer1.Panel2.SuspendLayout();
- this.splitContainer1.SuspendLayout();
- this.panel3.SuspendLayout();
- this.panel4.SuspendLayout();
- this.SuspendLayout();
- //
- // panel1
- //
- this.panel1.Controls.Add(this.button3);
- this.panel1.Controls.Add(this.button2);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panel1.Location = new System.Drawing.Point(0, 264);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(459, 45);
- this.panel1.TabIndex = 0;
- //
- // panel2
- //
- this.panel2.Controls.Add(this.label6);
- this.panel2.Controls.Add(this.label5);
- this.panel2.Controls.Add(this.label4);
- this.panel2.Controls.Add(this.label3);
- this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
- this.panel2.Location = new System.Drawing.Point(0, 0);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(459, 32);
- this.panel2.TabIndex = 1;
- //
- // splitContainer1
- //
- this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.splitContainer1.Location = new System.Drawing.Point(0, 32);
- this.splitContainer1.Name = "splitContainer1";
- //
- // splitContainer1.Panel1
- //
- this.splitContainer1.Panel1.Controls.Add(this.treeView1);
- this.splitContainer1.Panel1.Controls.Add(this.panel4);
- //
- // splitContainer1.Panel2
- //
- this.splitContainer1.Panel2.Controls.Add(this.panel3);
- this.splitContainer1.Panel2.Controls.Add(this.label7);
- this.splitContainer1.Size = new System.Drawing.Size(459, 232);
- this.splitContainer1.SplitterDistance = 227;
- this.splitContainer1.TabIndex = 2;
- //
- // treeView1
- //
- this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.treeView1.HideSelection = false;
- this.treeView1.Location = new System.Drawing.Point(0, 0);
- this.treeView1.Name = "treeView1";
- this.treeView1.Size = new System.Drawing.Size(227, 200);
- this.treeView1.TabIndex = 0;
- this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(16, 8);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(25, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "Key";
- //
- // textBox1
- //
- this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBox1.Location = new System.Drawing.Point(56, 8);
- this.textBox1.Name = "textBox1";
- this.textBox1.ReadOnly = true;
- this.textBox1.Size = new System.Drawing.Size(42, 20);
- this.textBox1.TabIndex = 1;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(16, 40);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(34, 13);
- this.label2.TabIndex = 2;
- this.label2.Text = "Value";
- //
- // textBox2
- //
- this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBox2.Location = new System.Drawing.Point(16, 56);
- this.textBox2.Multiline = true;
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(82, 136);
- this.textBox2.TabIndex = 3;
- this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(8, 8);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(83, 13);
- this.label3.TabIndex = 0;
- this.label3.Text = "Items remaining:";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(96, 8);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(37, 13);
- this.label4.TabIndex = 1;
- this.label4.Text = "12345";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(152, 8);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(36, 13);
- this.label5.TabIndex = 2;
- this.label5.Text = "Folder";
- //
- // label6
- //
- this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.label6.AutoEllipsis = true;
- this.label6.Location = new System.Drawing.Point(200, 8);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(256, 16);
- this.label6.TabIndex = 3;
- this.label6.Text = "label6";
- //
- // panel3
- //
- this.panel3.Controls.Add(this.textBox2);
- this.panel3.Controls.Add(this.label2);
- this.panel3.Controls.Add(this.label1);
- this.panel3.Controls.Add(this.textBox1);
- this.panel3.Location = new System.Drawing.Point(8, 0);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(104, 208);
- this.panel3.TabIndex = 4;
- this.panel3.Visible = false;
- //
- // label7
- //
- this.label7.Anchor = System.Windows.Forms.AnchorStyles.None;
- this.label7.Location = new System.Drawing.Point(67, 92);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(100, 16);
- this.label7.TabIndex = 5;
- this.label7.Text = "Click on an entry";
- this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // panel4
- //
- this.panel4.Controls.Add(this.label8);
- this.panel4.Controls.Add(this.button1);
- this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panel4.Location = new System.Drawing.Point(0, 200);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(227, 32);
- this.panel4.TabIndex = 6;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(5, 8);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 6;
- this.button1.Text = "&Next";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button2
- //
- this.button2.Anchor = System.Windows.Forms.AnchorStyles.Top;
- this.button2.Location = new System.Drawing.Point(144, 8);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 0;
- this.button2.Text = "&OK";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button3
- //
- this.button3.Anchor = System.Windows.Forms.AnchorStyles.Top;
- this.button3.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.button3.Location = new System.Drawing.Point(240, 8);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 1;
- this.button3.Text = "&Cancel";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(96, 16);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(134, 13);
- this.label8.TabIndex = 2;
- this.label8.Text = "Press ALT+N for next entry";
- //
- // UpdateGUI
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.button3;
- this.ClientSize = new System.Drawing.Size(459, 309);
- this.Controls.Add(this.splitContainer1);
- this.Controls.Add(this.panel2);
- this.Controls.Add(this.panel1);
- this.Name = "UpdateGUI";
- this.Text = "Localization updater";
- this.Load += new System.EventHandler(this.UpdateGUI_Load);
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdateGUI_FormClosing);
- this.panel1.ResumeLayout(false);
- this.panel2.ResumeLayout(false);
- this.panel2.PerformLayout();
- this.splitContainer1.Panel1.ResumeLayout(false);
- this.splitContainer1.Panel2.ResumeLayout(false);
- this.splitContainer1.ResumeLayout(false);
- this.panel3.ResumeLayout(false);
- this.panel3.PerformLayout();
- this.panel4.ResumeLayout(false);
- this.panel4.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.SplitContainer splitContainer1;
- private System.Windows.Forms.TreeView treeView1;
- private System.Windows.Forms.TextBox textBox2;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Panel panel3;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.Panel panel4;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Label label8;
- }
-} \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.cs b/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.cs
deleted file mode 100644
index 5973d66bd..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.cs
+++ /dev/null
@@ -1,233 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2015, The Duplicati Team
-// http://www.duplicati.com, info@duplicati.com
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Windows.Forms;
-using System.Xml.Linq;
-
-namespace LocalizationTool
-{
- public partial class UpdateGUI : Form
- {
- private string m_reportfile;
- private int m_totalcount;
- private Dictionary<string, XElement> m_updates = new Dictionary<string, XElement>();
-
- public UpdateGUI(string reportfile)
- {
- InitializeComponent();
- m_reportfile = reportfile;
- }
-
- private void UpdateGUI_Load(object sender, EventArgs e)
- {
- panel3.Dock = DockStyle.Fill;
- string culturename = System.IO.Path.GetExtension(System.IO.Path.GetFileNameWithoutExtension(m_reportfile)).Substring(1);
- this.Text = "Localizing culture " + culturename;
-
- var files = XDocument.Load(m_reportfile).Element("root").Elements("file").Where(n =>
- (n.Element("missing") != null && n.Element("missing").Elements().Count() > 0)
- ||
- (n.Element("not-updated") != null && n.Element("not-updated").Elements().Count() > 0)
- );
-
- string rootfolder = Duplicati.Library.Utility.Utility.AppendDirSeparator(System.IO.Path.Combine(Application.StartupPath, culturename));
-
- treeView1.BeginUpdate();
- treeView1.Nodes.Clear();
- foreach (XElement x in files)
- {
- TreeNodeCollection cl = treeView1.Nodes;
- string relpath = x.Attribute("filename").Value.Substring(rootfolder.Length);
- foreach (string s in relpath.Split(System.IO.Path.DirectorySeparatorChar))
- {
- bool found = false;
- foreach (TreeNode n in cl)
- if (n.Text == s)
- {
- cl = n.Nodes;
- found = true;
- break;
- }
-
- if (!found)
- {
- TreeNode nn = new TreeNode(s);
- nn.ForeColor = Color.DarkBlue;
- cl.Add(nn);
- cl = nn.Nodes;
- }
- }
-
- foreach (XElement el in x.Element("missing").Elements("item").Union(x.Element("not-updated").Elements("item")))
- {
- //These show up occasionally, but mut not be translated
- if (
- el.Attribute("name").Value.EndsWith(".Name")
- ||
- el.Attribute("name").Value.EndsWith(".MappingName")
- )
- continue;
-
- string val = el.Value;
- if (val.Length > 100)
- val = val.Substring(0, 97) + "...";
- TreeNode tn = new TreeNode(el.Attribute("name").Value + ": " + val);
- tn.ForeColor = Color.DarkRed;
- tn.Tag = el;
- cl.Add(tn);
- m_totalcount++;
- }
- }
- treeView1.EndUpdate();
- treeView1.ExpandAll();
- if (treeView1.Nodes.Count > 0)
- {
- TreeNode top = treeView1.Nodes[0];
- while (top.Nodes.Count > 0)
- top = top.Nodes[0];
- treeView1.SelectedNode = top;
- }
- label4.Text = m_totalcount.ToString();
- label6.Text = System.IO.Path.Combine(Application.StartupPath, culturename);
- this.WindowState = FormWindowState.Maximized;
- }
-
- private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
- {
- if (treeView1.SelectedNode == null || treeView1.SelectedNode.Tag as XElement == null)
- panel3.Visible = false;
- else
- {
- panel3.Visible = true;
- XElement el = treeView1.SelectedNode.Tag as XElement;
- panel3.Tag = null;
- textBox1.Text = el.Attribute("name").Value;
- textBox2.Text = el.Value.Replace(Environment.NewLine, "\n").Replace("\n", Environment.NewLine);
- try
- {
- textBox2.Focus();
- textBox2.SelectAll();
- }
- catch { }
- panel3.Tag = el;
- }
-
- }
-
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- if (panel3.Tag as XElement == null)
- return;
-
- XElement el = panel3.Tag as XElement;
- el.Value = textBox2.Text;
- string dictkey = el.Parent.Parent.Attribute("filename").Value + "@" + el.Attribute("name").Value;
- m_updates[dictkey] = el;
- label4.Text = (m_totalcount - m_updates.Count).ToString();
-
- if (treeView1.SelectedNode != null && treeView1.SelectedNode.Tag == el)
- treeView1.SelectedNode.ForeColor = Color.DarkGreen;
- }
-
- private void button3_Click(object sender, EventArgs e)
- {
- if (m_updates.Count > 0)
- if (MessageBox.Show(this, "Close and loose all changes?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3) != DialogResult.Yes)
- return;
-
- this.DialogResult = DialogResult.Cancel;
- this.Close();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- TreeNode t = treeView1.SelectedNode;
- if (t == null)
- return;
-
- List<TreeNode> visited = new List<TreeNode>();
-
- while (t != null)
- {
- if (t.Nodes.Count > 0 && !visited.Contains(t))
- t = t.Nodes[0];
- else if (t.NextNode != null)
- t = t.NextNode;
- else
- {
- if (t.Parent != null && !visited.Contains(t.Parent))
- visited.Add(t.Parent);
- t = t.Parent;
- }
-
- if (t != null && t.ForeColor == Color.DarkRed)
- {
- treeView1.SelectedNode = t;
- return;
- }
- }
-
- MessageBox.Show(this, "No more items", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- foreach (XElement el in m_updates.Values)
- {
- XDocument file = XDocument.Load(el.Parent.Parent.Attribute("filename").Value);
- var insertEl = file.Element("root").Elements("data").Where(c => c.Attribute("name").Value == el.Attribute("name").Value).FirstOrDefault();
- if (insertEl != null)
- insertEl.Element("value").Value = el.Value;
- else
- file.Element("root").Elements().Last().AddAfterSelf(
- new XElement("data",
- new XAttribute("name", el.Attribute("name").Value),
- new XAttribute(XNamespace.Xml + "space", "preserve"),
- new XElement("value", el.Value)
- )
- );
-
- file.Save(el.Parent.Parent.Attribute("filename").Value);
- }
-
- m_updates.Clear();
- this.DialogResult = DialogResult.OK;
- this.Close();
- }
-
- private void UpdateGUI_FormClosing(object sender, FormClosingEventArgs e)
- {
- if (e.CloseReason == CloseReason.UserClosing || e.CloseReason == CloseReason.FormOwnerClosing)
- if (m_updates.Count > 0)
- if (MessageBox.Show(this, "Close and loose all changes?", Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3) != DialogResult.Yes)
- {
- e.Cancel = true;
- return;
- }
-
- }
- }
-}
diff --git a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.resx b/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.resx
deleted file mode 100644
index ff31a6db5..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/UpdateGUI.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool/LocalizationTool/app.config b/BuildTools/LocalizationTool/LocalizationTool/app.config
deleted file mode 100644
index f180140e6..000000000
--- a/BuildTools/LocalizationTool/LocalizationTool/app.config
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<configuration>
- <configSections>
- </configSections>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
diff --git a/BuildTools/LocalizationTool2/LocalizationEntry.cs b/BuildTools/LocalizationTool2/LocalizationEntry.cs
deleted file mode 100644
index dea40d9f9..000000000
--- a/BuildTools/LocalizationTool2/LocalizationEntry.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace LocalizationTool2
-{
- public class LocalizationEntry
- {
- public LocalizationEntry()
- {
- SourceLocations = new List<string>();
- }
-
- public LocalizationEntry(string text, string file, int position)
- : this()
- {
- SourceString = text;
- AddSource(file, position);
- }
-
- internal void AddSource(string file, int linepos)
- {
- SourceLocations.Add(string.Format("{0}:{1}", file, linepos));
- }
-
- public string SourceString { get; set; }
- public List<string> SourceLocations { get; set; }
-
-}
-}
diff --git a/BuildTools/LocalizationTool2/LocalizationTool2.csproj b/BuildTools/LocalizationTool2/LocalizationTool2.csproj
deleted file mode 100644
index 181674f76..000000000
--- a/BuildTools/LocalizationTool2/LocalizationTool2.csproj
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProjectGuid>{6795DFBA-B494-4D6F-A79C-9118EF1CC109}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>LocalizationTool2</RootNamespace>
- <AssemblyName>LocalizationTool2</AssemblyName>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG;</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ExternalConsole>true</ExternalConsole>
- <PlatformTarget>x86</PlatformTarget>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ExternalConsole>true</ExternalConsole>
- <PlatformTarget>x86</PlatformTarget>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="Newtonsoft.Json">
- <HintPath>packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="LocalizationEntry.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="packages.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project> \ No newline at end of file
diff --git a/BuildTools/LocalizationTool2/LocalizationTool2.sln b/BuildTools/LocalizationTool2/LocalizationTool2.sln
deleted file mode 100644
index 6bde3c715..000000000
--- a/BuildTools/LocalizationTool2/LocalizationTool2.sln
+++ /dev/null
@@ -1,46 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LocalizationTool2", "LocalizationTool2.csproj", "{6795DFBA-B494-4D6F-A79C-9118EF1CC109}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x86 = Debug|x86
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6795DFBA-B494-4D6F-A79C-9118EF1CC109}.Debug|x86.ActiveCfg = Debug|x86
- {6795DFBA-B494-4D6F-A79C-9118EF1CC109}.Debug|x86.Build.0 = Debug|x86
- {6795DFBA-B494-4D6F-A79C-9118EF1CC109}.Release|x86.ActiveCfg = Release|x86
- {6795DFBA-B494-4D6F-A79C-9118EF1CC109}.Release|x86.Build.0 = Release|x86
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- Policies = $0
- $0.TextStylePolicy = $1
- $1.inheritsSet = VisualStudio
- $1.scope = text/plain
- $1.FileWidth = 120
- $1.EolMarker = Windows
- $1.inheritsScope = text/plain
- $0.CSharpFormattingPolicy = $2
- $2.NewLinesForBracesInProperties = True
- $2.NewLinesForBracesInAccessors = True
- $2.NewLinesForBracesInAnonymousMethods = True
- $2.NewLinesForBracesInControlBlocks = True
- $2.NewLinesForBracesInAnonymousTypes = True
- $2.NewLinesForBracesInObjectCollectionArrayInitializers = True
- $2.NewLinesForBracesInLambdaExpressionBody = True
- $2.NewLineForElse = True
- $2.NewLineForCatch = True
- $2.NewLineForFinally = True
- $2.NewLineForMembersInObjectInit = True
- $2.NewLineForMembersInAnonymousTypes = True
- $2.NewLineForClausesInQuery = True
- $2.SpacingAfterMethodDeclarationName = False
- $2.SpaceAfterMethodCallName = False
- $2.SpaceBeforeOpenSquareBracket = False
- $2.inheritsSet = Mono
- $2.inheritsScope = text/x-csharp
- $2.scope = text/x-csharp
- EndGlobalSection
-EndGlobal
diff --git a/BuildTools/LocalizationTool2/Program.cs b/BuildTools/LocalizationTool2/Program.cs
deleted file mode 100644
index 506a2127a..000000000
--- a/BuildTools/LocalizationTool2/Program.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text.RegularExpressions;
-
-namespace LocalizationTool2
-{
- class MainClass
- {
- public static int Main(string[] args)
- {
- var sourcefolder = Environment.CurrentDirectory;
- if (args == null || args.Length != 0)
- sourcefolder = args[0];
-
- sourcefolder = Path.GetFullPath(sourcefolder.Replace("~", Environment.GetEnvironmentVariable("HOME")));
-
- var targetfolder = sourcefolder;
- if (args == null || args.Length > 1)
- targetfolder = Path.GetFullPath(args[1].Replace("~", Environment.GetEnvironmentVariable("HOME")));
-
-
- if (!Directory.Exists(sourcefolder))
- {
- Console.WriteLine("No such directory: {0}", sourcefolder);
- return 1;
- }
-
- sourcefolder = Path.GetFullPath(sourcefolder);
- Console.WriteLine("Using directory {0}, scanning ....", sourcefolder);
-
-
- var searchlist = new Dictionary<string, Regex>();
- searchlist.Add("html", new Regex("((\\{\\{)|(ng-bind-html\\s*=\\s*\"))\\s*\\'(?<sourcestring>(\\\\\\'|[^\\'])+)\\'\\s*\\|\\s*localize(\\s|\\:|\\})", RegexOptions.Multiline | RegexOptions.IgnoreCase));
- searchlist.Add("js", new Regex("Localization\\.localize\\(\\s*((\\'(?<sourcestring>(\\\\\\'|[^\\'])+)\\')|(\\\"(?<sourcestring>(\\\\\\\"|[^\\\"])+)\\\"))", RegexOptions.Multiline | RegexOptions.IgnoreCase));
- searchlist.Add("cs", new Regex("LC.L\\s*\\(((@\\s*\"(?<sourcestring>(\"\"|[^\"])+))|(\"(?<sourcestring>(\\\\\"|[^\"])+)))\"\\s*(\\)|,)", RegexOptions.Multiline | RegexOptions.IgnoreCase));
-
- var map = new Dictionary<string, LocalizationEntry>();
-
- if (!sourcefolder.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal))
- sourcefolder += Path.DirectorySeparatorChar;
-
- foreach (var ext in searchlist.Keys)
- {
- var re = searchlist[ext];
- foreach (var f in Directory.GetFiles(sourcefolder, "*." + ext, SearchOption.AllDirectories))
- {
- var txt = File.ReadAllText(f);
- foreach (Match match in re.Matches(txt))
- {
- var linepos = txt.Substring(0, match.Index).Count(x => x == '\n') + 1;
- var str = match.Groups["sourcestring"].Value.Replace("\\'", "'");
- str = Regex.Replace(str, "(\\\\+)([^rn])", "$1$1$2").Replace("\"", "\\\"").Replace("\n", "\\n").Replace("\r", "\\r");
- LocalizationEntry le;
- if (!map.TryGetValue(str, out le))
- map[str] = new LocalizationEntry(str, f.Substring(sourcefolder.Length), linepos);
- else
- le.AddSource(Path.GetFileName(f), linepos);
- }
- }
- }
-
- //File.WriteAllText(Path.Combine(sourcefolder, "translations.json"), Newtonsoft.Json.JsonConvert.SerializeObject(map.Values.OrderBy(x => x.SourceLocations.FirstOrDefault()).ToArray(), Newtonsoft.Json.Formatting.Indented));
- //File.WriteAllText(Path.Combine(sourcefolder, "translations-list.json"), Newtonsoft.Json.JsonConvert.SerializeObject(map.Select(x => x.Key).OrderBy(x => x).ToArray(), Newtonsoft.Json.Formatting.Indented));
-
- File.WriteAllLines(
- Path.Combine(targetfolder, "localization.po"),
- map.OrderBy(x => x.Key).Select(x => x.Value).SelectMany(x => new string[] {
- "#: " + x.SourceLocations.FirstOrDefault().Replace("\\", "/"),
- string.Format("msgid \"{0}\"", (x.SourceString ?? "")),
- string.Format("msgstr \"{0}\"", (x.SourceString ?? "")),
- ""
- }),
- new System.Text.UTF8Encoding(false)
- );
-
- Console.WriteLine("Wrote {0} strings to {1}", map.Count, Path.Combine(targetfolder, "localization.po"));
-
- /*File.WriteAllLines(
- Path.Combine(sourcefolder, "localization-by-file.po"),
- map.OrderBy(x => x.Value.SourceLocations.FirstOrDefault()).Select(x => x.Value).SelectMany(x => new string[] {
- "#: " + x.SourceLocations.FirstOrDefault().Replace("\\", "/"),
- string.Format("msgid \"{0}\"", (x.SourceString ?? "")),
- string.Format("msgstr \"{0}\"", (x.SourceString ?? "")),
- ""
- }),
- new System.Text.UTF8Encoding(false)
- );*/
-
- return 0;
-
- }
- }
-}
diff --git a/BuildTools/LocalizationTool2/Properties/AssemblyInfo.cs b/BuildTools/LocalizationTool2/Properties/AssemblyInfo.cs
deleted file mode 100644
index 477ec7720..000000000
--- a/BuildTools/LocalizationTool2/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("LocalizationTool2")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("kenneth")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("2.0.0.7")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
diff --git a/BuildTools/LocalizationTool2/packages.config b/BuildTools/LocalizationTool2/packages.config
deleted file mode 100644
index e1fae9c6a..000000000
--- a/BuildTools/LocalizationTool2/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<packages>
- <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
-</packages> \ No newline at end of file