From fb9f45f3df6863f78c38234180455f2a28562a01 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 2 May 2012 15:12:13 +0000 Subject: [PATCH] Initial version of the Language editor (is standalone solution) git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1825 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotLanguageEditor.sln | 18 ++ GreenshotLanguageEditor.suo | Bin 0 -> 24064 bytes GreenshotLanguageEditor/App.xaml | 8 + GreenshotLanguageEditor/App.xaml.cs | 15 ++ .../GreenshotLanguageEditor.csproj | 83 +++++++ GreenshotLanguageEditor/Language.cs | 80 +++++++ .../Properties/AssemblyInfo.cs | 31 +++ .../Properties/WPFAssemblyInfo.cs | 27 +++ GreenshotLanguageEditor/Window1.xaml | 48 ++++ GreenshotLanguageEditor/Window1.xaml.cs | 209 ++++++++++++++++++ GreenshotLanguageEditor/app.config | 6 + 11 files changed, 525 insertions(+) create mode 100644 GreenshotLanguageEditor.sln create mode 100644 GreenshotLanguageEditor.suo create mode 100644 GreenshotLanguageEditor/App.xaml create mode 100644 GreenshotLanguageEditor/App.xaml.cs create mode 100644 GreenshotLanguageEditor/GreenshotLanguageEditor.csproj create mode 100644 GreenshotLanguageEditor/Language.cs create mode 100644 GreenshotLanguageEditor/Properties/AssemblyInfo.cs create mode 100644 GreenshotLanguageEditor/Properties/WPFAssemblyInfo.cs create mode 100644 GreenshotLanguageEditor/Window1.xaml create mode 100644 GreenshotLanguageEditor/Window1.xaml.cs create mode 100644 GreenshotLanguageEditor/app.config 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 0000000000000000000000000000000000000000..a20d58dd08f4287dad4b99af119ff32a20f0a283 GIT binary patch literal 24064 zcmeHPdu$xV8DBr+!~v2fqyf^@KzIe;`OeR?Ljw1*V{l?8=h%Tb9P9Ji+4y{G?vdEU zfj)sh03n2EMTJz_KqXpLQ1M4WDx#+rT*2bf=Z|=MODQ=h4lBE-SzFg_Z$}| z=Zy93&h5_5H}lQ+nr~+O{@IOxdH$8F|0-prJyMPI`MI@Hz2$io@&u7KNK!R2gwM~N zJEuRCBxEn8i--cBp{=zTyjuWufHeS)c>`cAU>%?lupV#);4;AFfQI3kxHJzc+fQ4-HD(7nrp40B!AI{(T>D;C4GO)>Csk7N$CR4U}=QHX6 z=BWqr=>Svy&F_fY%x^|MTmJcu@^6+YB>&VO+44V#XVgp70n`taf9e<~patLpxB;xY z&A4~q-f84L#=QskU4YvFy8(Luw*&3~cmY0u9}oac0D1v^fCYfr?z@cqKHT>k`61j7 z01g5|fMLKPzzARza2Rkm;2yvcz!=~t;9fu&a34Shi~}M7;^K%;0;T}R04m@(U>Xnw z%m88l4KNG19}owSPm_QY-~`|#fRaRMegJR^!1_<){vhBXz}EmDpLzIi$?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|mGo{=KPn}~=4PR*V7b=7fg}6U=R#}J= zCn|&znH*vIFkBys;j~x2-kVGGBLs2Lh^Uw&gi1v3N?Mz78DnLY3WP$p?eM{h_^s z!vo&^eTTe#!C;_&c<|s@U;gJ#Z2mepc;|xkf9K>cS*V7w(f<8`!BMyKuy^0UTAn(0#FV0b57hp||R9Dy7 zkPlbCd0=8k9@_Tj)c=nIp4-{%b?ex+wc^4J(i@oL0Mzq<)0WUI&SH$H%1LMFn08Y9 zN-FVsZY;CB!+!&b@c#f!DbBm=>6%@c{%$a?n*SoGo<8j6^sAw`I)fuI!}54N&+_N5 z@bCsUi!ExXs%l{6x3A^t=e6Qr$~3+jdwI`#o<<%ux^4cmmR>DBlURl$HFZSRl&^B9 zrE64bYXozL!%_p=!&J*QHX7gdrPK*Fzd9^ehsUeKk?Qb7by%qmPgaMgs>8>s!)kT- zcy)N1UmB@l&6;X6{pi4n59)uj@rhqZ-~aU$H-5ybmX=EYPm^-@k6B~*xqE_imH&jX zcJW2;ZOh$T!?QTw0O`I7VE)^leGR#NWT8SPHKsE8B$SoO6u+9@+t(%vttY~=10q2H0egq0p#Q%pn1AB3xD w((2N^awt&h{7YMjuA1jBH=!IgRf*!_HP_C5W~ZRdGFA;~^OI#Qb}{4sAGLU%egFUf literal 0 HcmV?d00001 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +