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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GreenshotLanguageEditor/Window1.xaml.cs b/GreenshotLanguageEditor/Window1.xaml.cs
new file mode 100644
index 000000000..3513f4010
--- /dev/null
+++ b/GreenshotLanguageEditor/Window1.xaml.cs
@@ -0,0 +1,209 @@
+/*
+ * 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.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.ComponentModel;
+using System.Xml;
+
+namespace GreenshotLanguageEditor {
+ ///
+ /// Interaction logic for Window1.xaml
+ ///
+ public partial class Window1 : Window {
+ public ICollectionView View {
+ get;
+ set;
+ }
+
+ public Window1() {
+ var dialog = new System.Windows.Forms.FolderBrowserDialog();
+ dialog.ShowNewFolderButton = false;
+ System.Windows.Forms.DialogResult result = dialog.ShowDialog();
+ string languagePath;
+ if (result == System.Windows.Forms.DialogResult.OK) {
+ languagePath = dialog.SelectedPath;
+ } else {
+ this.Close();
+ return;
+ }
+
+ InitializeComponent();
+ View = CollectionViewSource.GetDefaultView(LoadResources(languagePath));
+ DataContext = this;
+ this.Activate();
+ }
+
+ private IList LoadResources(string languagePath) {
+ IDictionary languageResources = new SortedDictionary();
+
+ foreach (LanguageFile languageFile in GreenshotLanguage.GetLanguageFiles(languagePath, "language*.xml")) {
+ if ("en-US".Equals(languageFile.IETF)) {
+ IDictionary enResources = GreenshotLanguage.ReadLanguageFile(languageFile);
+ foreach(string key in enResources.Keys) {
+ LanguageEntry entry;
+ if (languageResources.ContainsKey(key)) {
+ entry = languageResources[key];
+ } else {
+ entry = new LanguageEntry();
+ entry.Key = key;
+ languageResources.Add(key, entry);
+ }
+ entry.Entry1 = enResources[key];
+ }
+ }
+ if ("de-DE".Equals(languageFile.IETF)) {
+ IDictionary deResources = GreenshotLanguage.ReadLanguageFile(languageFile);
+ foreach(string key in deResources.Keys) {
+ LanguageEntry entry;
+ if (languageResources.ContainsKey(key)) {
+ entry = languageResources[key];
+ } else {
+ entry = new LanguageEntry();
+ entry.Key = key;
+ languageResources.Add(key, entry);
+ }
+ entry.Entry2 = deResources[key];
+ }
+ }
+ }
+ return new List(languageResources.Values);
+ }
+
+ public void CreateXML(string savePath) {
+
+ ICollectionView view = (ICollectionView)LanguageGrid.ItemsSource;
+ IList entries = (IList)view.SourceCollection;
+
+ using (XmlTextWriter xmlWriter = new XmlTextWriter(savePath, Encoding.UTF8)) {
+ xmlWriter.Formatting = Formatting.Indented;
+ xmlWriter.Indentation = 1;
+ xmlWriter.IndentChar = '\t';
+ xmlWriter.WriteStartDocument();
+ xmlWriter.WriteStartElement("language");
+ xmlWriter.WriteAttributeString("description", "testdescription");
+ xmlWriter.WriteAttributeString("ietf", "testietf");
+ xmlWriter.WriteAttributeString("version", "testversion");
+ xmlWriter.WriteAttributeString("languagegroup", "testlanguagegroup");
+ xmlWriter.WriteStartElement("resources");
+ foreach(LanguageEntry entry in entries) {
+ xmlWriter.WriteStartElement("resource");
+ xmlWriter.WriteAttributeString("name", entry.Key);
+ xmlWriter.WriteString(entry.Entry1);
+ xmlWriter.WriteEndElement();
+ }
+ xmlWriter.WriteEndElement();
+ xmlWriter.WriteEndElement();
+ xmlWriter.WriteEndDocument();
+ }
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e) {
+ var dialog = new System.Windows.Forms.SaveFileDialog();
+ dialog.AutoUpgradeEnabled = true;
+ dialog.DefaultExt = ".xml";
+ System.Windows.Forms.DialogResult result = dialog.ShowDialog();
+ if (result == System.Windows.Forms.DialogResult.OK) {
+ CreateXML(dialog.FileName);
+ } else {
+ this.Close();
+ return;
+ }
+
+ }
+ }
+
+ public class LanguageEntry : IEditableObject, INotifyPropertyChanged {
+ private string key;
+ private string entry1;
+ private string entry2;
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private void NotifyPropertyChanged(String info) {
+ if (PropertyChanged != null) {
+ PropertyChanged(this, new PropertyChangedEventArgs(info));
+ }
+ }
+
+ public Brush Background {
+ get {
+ if (Entry1 == null) {
+ return Brushes.Red;
+ }
+ if (Entry2 == null) {
+ return Brushes.Red;
+ }
+ return Brushes.Green;
+ }
+ }
+ public string Key {
+ get {
+ return key;
+ }
+ set {
+ key = value;
+ NotifyPropertyChanged("Key");
+ }
+ }
+
+ public string Entry1 {
+ get {
+ return entry1;
+ }
+ set {
+ entry1 = value;
+ NotifyPropertyChanged("Entry1");
+ NotifyPropertyChanged("Background");
+
+ }
+ }
+
+ public string Entry2 {
+ get {
+ return entry2;
+ }
+ set {
+ entry2 = value;
+ NotifyPropertyChanged("Entry2");
+ NotifyPropertyChanged("Background");
+ }
+ }
+
+ public void BeginEdit() {
+
+ }
+
+ public void EndEdit() {
+
+ }
+
+ public void CancelEdit() {
+
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/GreenshotLanguageEditor/app.config b/GreenshotLanguageEditor/app.config
new file mode 100644
index 000000000..0d6966093
--- /dev/null
+++ b/GreenshotLanguageEditor/app.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file