diff --git a/GreenshotLanguageEditor.sln b/GreenshotLanguageEditor.sln new file mode 100644 index 000000000..6ff21c175 --- /dev/null +++ b/GreenshotLanguageEditor.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +# SharpDevelop 4.2.0.8528-beta +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotLanguageEditor", "GreenshotLanguageEditor\GreenshotLanguageEditor.csproj", "{3938F7B8-BAA1-48A3-B910-5FA6A5AA2506}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3938F7B8-BAA1-48A3-B910-5FA6A5AA2506}.Debug|x86.Build.0 = Debug|x86 + {3938F7B8-BAA1-48A3-B910-5FA6A5AA2506}.Debug|x86.ActiveCfg = Debug|x86 + {3938F7B8-BAA1-48A3-B910-5FA6A5AA2506}.Release|x86.Build.0 = Release|x86 + {3938F7B8-BAA1-48A3-B910-5FA6A5AA2506}.Release|x86.ActiveCfg = Release|x86 + EndGlobalSection +EndGlobal diff --git a/GreenshotLanguageEditor.suo b/GreenshotLanguageEditor.suo new file mode 100644 index 000000000..a20d58dd0 Binary files /dev/null and b/GreenshotLanguageEditor.suo differ diff --git a/GreenshotLanguageEditor/App.xaml b/GreenshotLanguageEditor/App.xaml new file mode 100644 index 000000000..f0730339c --- /dev/null +++ b/GreenshotLanguageEditor/App.xaml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/GreenshotLanguageEditor/App.xaml.cs b/GreenshotLanguageEditor/App.xaml.cs new file mode 100644 index 000000000..fd4d50b9c --- /dev/null +++ b/GreenshotLanguageEditor/App.xaml.cs @@ -0,0 +1,15 @@ +using System; +using System.Windows; +using System.Data; +using System.Xml; +using System.Configuration; + +namespace GreenshotLanguageEditor +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} \ No newline at end of file diff --git a/GreenshotLanguageEditor/GreenshotLanguageEditor.csproj b/GreenshotLanguageEditor/GreenshotLanguageEditor.csproj new file mode 100644 index 000000000..946ba526a --- /dev/null +++ b/GreenshotLanguageEditor/GreenshotLanguageEditor.csproj @@ -0,0 +1,83 @@ + + + + {3938F7B8-BAA1-48A3-B910-5FA6A5AA2506} + Debug + x86 + WinExe + GreenshotLanguageEditor + GreenshotLanguageEditor + v4.0 + Client + Properties + + + x86 + + + bin\Debug\ + True + Full + False + True + DEBUG;TRACE + + + bin\Release\ + False + None + True + False + TRACE + + + + 3.0 + + + 3.0 + + + + 3.5 + + + + 3.5 + + + + 4.0 + + + + 3.5 + + + 3.0 + + + + + + + + Code + App.xaml + + + + + + Code + Window1.xaml + + + + + + + + + + \ No newline at end of file diff --git a/GreenshotLanguageEditor/Language.cs b/GreenshotLanguageEditor/Language.cs new file mode 100644 index 000000000..b8c7c5b73 --- /dev/null +++ b/GreenshotLanguageEditor/Language.cs @@ -0,0 +1,80 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml.Linq; + +namespace GreenshotLanguageEditor { + public class LanguageFile { + public string FilePath { + get; + set; + } + public string IETF { + get; + set; + } + public string Version { + get; + set; + } + public string Languagegroup { + get; + set; + } + public string Description { + get; + set; + } + } + /// + /// Description of Language. + /// + public static class GreenshotLanguage { + public static IEnumerable GetLanguageFiles(string languageFilePath, string languageFilePattern) { + var languageFiles = from languageFile in Directory.GetFiles(languageFilePath, languageFilePattern, SearchOption.AllDirectories).ToList() + from language in XDocument.Load(languageFile).Descendants("language") + select new LanguageFile { + FilePath = languageFile, + Description = (string)language.Attribute("description"), + IETF = (string)language.Attribute("ietf"), + Version = (string)language.Attribute("version"), + Languagegroup = (string)language.Attribute("languagegroup") + }; + + foreach (LanguageFile languageFile in languageFiles) { + yield return languageFile; + } + } + + public static IDictionary ReadLanguageFile(LanguageFile languageFile) { + return (from resource in XDocument.Load(languageFile.FilePath).Descendants("resource") + where !string.IsNullOrEmpty(resource.Value) + select new { + Name = (string)resource.Attribute("name"), + Text = resource.Value.Trim() + } + ).ToDictionary(item => item.Name, item => item.Text); + } + } +} diff --git a/GreenshotLanguageEditor/Properties/AssemblyInfo.cs b/GreenshotLanguageEditor/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..64c89ceb6 --- /dev/null +++ b/GreenshotLanguageEditor/Properties/AssemblyInfo.cs @@ -0,0 +1,31 @@ +#region Using directives + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// 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("GreenshotLanguageEditor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GreenshotLanguageEditor")] +[assembly: AssemblyCopyright("Copyright 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all the values or you can use the default the Revision and +// Build Numbers by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] diff --git a/GreenshotLanguageEditor/Properties/WPFAssemblyInfo.cs b/GreenshotLanguageEditor/Properties/WPFAssemblyInfo.cs new file mode 100644 index 000000000..94903a373 --- /dev/null +++ b/GreenshotLanguageEditor/Properties/WPFAssemblyInfo.cs @@ -0,0 +1,27 @@ +#region Using directives + +using System.Resources; +using System.Windows; + +#endregion + + + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/GreenshotLanguageEditor/Window1.xaml b/GreenshotLanguageEditor/Window1.xaml new file mode 100644 index 000000000..90d1f8bda --- /dev/null +++ b/GreenshotLanguageEditor/Window1.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +