From 4cfcb4599daddeab23caed0812cac5fd3a0afbaa Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 6 Feb 2019 14:25:59 -0600 Subject: [PATCH 01/12] Adjust for mono 5 Mono 5 uses the Roslyn compiler (which is the same as on Windows) which doesn't define __MonoCS__. This change modifies the code to check at runtime whether we're running on Mono. --- .gitignore | 3 +- environ | 2 +- src/L10NSharp/LocalizationManager.cs | 13 +++--- src/L10NSharp/UI/HowToDistributeDialog.cs | 26 ++++++------ src/L10NSharp/UI/Utils.cs | 48 ++++++++++++++++------- 5 files changed, 58 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index fe913bf..1e520e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ _ReSharper* +.idea/ output/ obj/ *.suo @@ -11,5 +12,5 @@ bin/ *.bak packages/ -build/NuGet.exe /.vs/ +build/nuget.exe diff --git a/environ b/environ index 85c5fb1..f16cdb6 100644 --- a/environ +++ b/environ @@ -1,5 +1,5 @@ #!/bin/bash -MONO_PREFIX=/opt/mono4-sil +MONO_PREFIX=/opt/mono5-sil export DYLD_LIBRARY_FALLBACK_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH export C_INCLUDE_PATH=$MONO_PREFIX/include diff --git a/src/L10NSharp/LocalizationManager.cs b/src/L10NSharp/LocalizationManager.cs index 99a2077..ec7b622 100644 --- a/src/L10NSharp/LocalizationManager.cs +++ b/src/L10NSharp/LocalizationManager.cs @@ -657,13 +657,14 @@ public static string UILanguageId if (s_uiLangId == null) { s_uiLangId = Thread.CurrentThread.CurrentUICulture.Name; -#if __MonoCS__ - // The current version of Mono does not define a CultureInfo for "zh", so - // it tends to throw exceptions when we try to use just plain "zh". - if (s_uiLangId == "zh-CN") - return s_uiLangId; + if (Utils.IsMono) + { + // The current version of Mono does not define a CultureInfo for "zh", so + // it tends to throw exceptions when we try to use just plain "zh". + if (s_uiLangId == "zh-CN") + return s_uiLangId; + } // Otherwise, we want the culture.neutral version. -#endif int i = s_uiLangId.IndexOf('-'); if (i >= 0) s_uiLangId = s_uiLangId.Substring(0, i); diff --git a/src/L10NSharp/UI/HowToDistributeDialog.cs b/src/L10NSharp/UI/HowToDistributeDialog.cs index c89dfa7..0581ee1 100644 --- a/src/L10NSharp/UI/HowToDistributeDialog.cs +++ b/src/L10NSharp/UI/HowToDistributeDialog.cs @@ -13,18 +13,20 @@ public HowToDistributeDialog(string emailForSubmissions, string targetXliffFileP _targetXliffFilePath = targetXliffFilePath; InitializeComponent(); -#if __MonoCS__ - // In Mono, Label.AutoSize=true sets Size to PreferredSize (which is always - // one line high) even if the Size has already been explicitly set. In Windows, - // Label.AutoSize=false makes the labels disappear. So we need to turn off - // AutoSize here and set the multiline labels explicitly to their largest - // possible sizes for this fixed-size dialog. (That allows all the available - // space for localizations that may need more space.) - label1.AutoSize = label2.AutoSize = label4.AutoSize = false; - label4.Size = new System.Drawing.Size(300, 142); // top message - label2.Size = new System.Drawing.Size(300, 56); // middle message - label1.Size = new System.Drawing.Size(300, 112); // bottom message -#endif + if (Utils.IsMono) + { + // In Mono, Label.AutoSize=true sets Size to PreferredSize (which is always + // one line high) even if the Size has already been explicitly set. In Windows, + // Label.AutoSize=false makes the labels disappear. So we need to turn off + // AutoSize here and set the multiline labels explicitly to their largest + // possible sizes for this fixed-size dialog. (That allows all the available + // space for localizations that may need more space.) + label1.AutoSize = label2.AutoSize = label4.AutoSize = false; + label4.Size = new System.Drawing.Size(300, 142); // top message + label2.Size = new System.Drawing.Size(300, 56); // middle message + label1.Size = new System.Drawing.Size(300, 112); // bottom message + } + _emailLabel.Text=emailForSubmissions; } diff --git a/src/L10NSharp/UI/Utils.cs b/src/L10NSharp/UI/Utils.cs index 5413ab6..9515bc0 100644 --- a/src/L10NSharp/UI/Utils.cs +++ b/src/L10NSharp/UI/Utils.cs @@ -8,17 +8,33 @@ namespace L10NSharp.UI /// ---------------------------------------------------------------------------------------- internal static class Utils { + private static bool? _isMono; + + public static bool IsMono + { + get + { + if (_isMono == null) + _isMono = Type.GetType("Mono.Runtime") + != null; + + return (bool)_isMono; + } + } + + + [DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint = "SendMessage")] + private static extern void SendMessageWindows(IntPtr hWnd, int msg, int wParam, int lParam); -#if !__MonoCS__ - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, int lParam); -#else public static void SendMessage(IntPtr hWnd, int msg, int wParam, int lParam) { - Console.WriteLine("Warning--using unimplemented method SendMessage"); // FIXME Linux - return; + if (IsMono) + Console.WriteLine("Warning--using unimplemented method SendMessage"); // FIXME Linux + else + { + SendMessageWindows(hWnd, msg, wParam, lParam); + } } -#endif private const int WM_SETREDRAW = 0xB; @@ -39,14 +55,18 @@ public static void SetWindowRedraw(Control ctrl, bool turnOn, { if (ctrl != null && !ctrl.IsDisposed && ctrl.IsHandleCreated) { -#if !__MonoCS__ - SendMessage(ctrl.Handle, WM_SETREDRAW, (turnOn ? 1 : 0), 0); -#else - if (turnOn) - ctrl.ResumeLayout(invalidateAfterTurningOn); + if (IsMono) + { + if (turnOn) + ctrl.ResumeLayout(invalidateAfterTurningOn); + else + ctrl.SuspendLayout(); + } else - ctrl.SuspendLayout(); -#endif + { + SendMessage(ctrl.Handle, WM_SETREDRAW, (turnOn ? 1 : 0), 0); + } + if (turnOn && invalidateAfterTurningOn) ctrl.Invalidate(true); } From 01b5a970c555edb9f8cc8390f5f598f5c2e2b693 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 6 Feb 2019 15:38:20 -0600 Subject: [PATCH 02/12] Convert to sdk based csproj format This change converts the .csproj file to the sdk based format which is a lot smaller and allows to define various properties in the csproj file. The downside is that I'm not sure if the forms can still be opened in the designer from the project view, and the designer files are disconnected from their other files. --- .editorconfig | 7 +- .gitignore | 1 + build/L10NSharp.proj | 10 +- src/L10NSharp/L10NSharp.csproj | 332 ++--------------------- src/L10NSharp/Properties/AssemblyInfo.cs | 33 --- 5 files changed, 36 insertions(+), 347 deletions(-) diff --git a/.editorconfig b/.editorconfig index 958aa2f..6a3a123 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,9 +7,14 @@ insert_final_newline = true charset = utf-8 indent_size = 4 -[*.{cs,csproj,sln}] +[*.cs] indent_style = tab +# Settings Visual Studio uses for generated files +[*.{csproj,resx,settings,vcxproj*,vdproj,xml}] +indent_style = space +indent_size = 2 + [*.pug] indent_style = tab diff --git a/.gitignore b/.gitignore index 1e520e5..b45455f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ _ReSharper* .idea/ +.vs/ output/ obj/ *.suo diff --git a/build/L10NSharp.proj b/build/L10NSharp.proj index ddd3fb2..2cc3283 100644 --- a/build/L10NSharp.proj +++ b/build/L10NSharp.proj @@ -1,4 +1,4 @@ - + $(MSBuildProjectDirectory)\.. $(teamcity_build_checkoutDir) @@ -18,7 +18,13 @@ + + + + diff --git a/src/L10NSharp/L10NSharp.csproj b/src/L10NSharp/L10NSharp.csproj index d0e6ca5..29dff56 100644 --- a/src/L10NSharp/L10NSharp.csproj +++ b/src/L10NSharp/L10NSharp.csproj @@ -1,320 +1,30 @@ - - + - Debug - AnyCPU - 9.0.30729 - 2.0 - {8EE0895A-7B9D-4B49-8F73-9F1270F1E583} - Library - Properties + net461 L10NSharp - L10NSharp - v4.6.1 - 512 - - - - - 3.5 - - - - - - - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - ..\..\output\Debug\L10NSharp.xml - 1591 - AllRules.ruleset - AnyCPU - false - 6 - - - pdbonly - true - ..\..\..\output\Release\ - TRACE + L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which needs localization when your application first runs and saves them in a Translation Memory eXchange (TMX) file. It can also dynamically collect strings at runtime. + L10NSharp + SIL + L10NSharp + Copyright © 2010-2019 SIL International prompt 4 - ..\..\..\output\Release\L10NSharp.xml - AllRules.ruleset - false + false + false + false + false + false + false + SIL International + ../../output/$(Configuration) + L10NSharp.tmx + MIT + https://github.com/sillsdev/l10nsharp + false + ../../output - - - 3.5 - - - - 3.0 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - Component - - - DontShowThisAgainButton.cs - - - Form - - - HowToDistributeDialog.cs - - - Form - - - LanguageChoosingDialog.cs - - - Form - - - LanguageChoosingSimpleDialog.cs - - - Form - - - TipDialog.cs - - - Component - - - - - - - - - True - True - Resources.resx - - - True - True - Settings.settings - - - True - True - Reference.svcmap - - - - - UserControl - - - CustomDropDownComboBox.cs - - - Form - - - EditSourceBeforeTranslatingDlg.cs - - - Form - - - FallbackLanguagesDlg.cs - - - Component - - - Form - - - LocalizeItemDlg.cs - - - - - - Form - - - InitializationProgressDlg.cs - - - UserControl - - - UserControl - - - ShortcutKeysEditor.cs - - - UserControl - - - PopupControl.cs - - - - - Component - - - Component - - - Component - - - - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - CustomDropDownComboBox.cs - - - EditSourceBeforeTranslatingDlg.cs - - - FallbackLanguagesDlg.cs - - - HowToDistributeDialog.cs - Designer - - - LanguageChoosingDialog.cs - - - LanguageChoosingSimpleDialog.cs - - - L10NExtender.cs - - - LocalizeItemDlg.cs - - - InitializationProgressDlg.cs - - - TipDialog.cs - - - ShortcutKeysEditor.cs - - - PopupControl.cs - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WCF Proxy Generator - Reference.cs - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/src/L10NSharp/Properties/AssemblyInfo.cs b/src/L10NSharp/Properties/AssemblyInfo.cs index ef6188f..13a922e 100644 --- a/src/L10NSharp/Properties/AssemblyInfo.cs +++ b/src/L10NSharp/Properties/AssemblyInfo.cs @@ -1,38 +1,5 @@ -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("L10NSharp")] -[assembly: AssemblyDescription("Localization For .net")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("L10NSharp")] -[assembly: AssemblyCopyright("Copyright © SIL 2010-2014")] -[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("9c902b01-6007-4554-b0aa-1ea40ab35a6d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.*")] -[assembly: AssemblyFileVersion("2.0.0.0")] [assembly: InternalsVisibleTo("L10NSharpTests")] [assembly: InternalsVisibleTo("ExtractXliff")] [assembly: InternalsVisibleTo("CheckOrFixXliff")] From 675cc15761fb09b3eda4f08b6feb105c950193fd Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 6 Feb 2019 15:40:55 -0600 Subject: [PATCH 03/12] Add GitVersionTask --- .editorconfig | 2 +- .gitattributes | 1 + GitVersion.yml | 21 +++++++++++++++++++++ L10NSharp.sln | 9 +++++++++ src/L10NSharp/L10NSharp.csproj | 5 +++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 GitVersion.yml diff --git a/.editorconfig b/.editorconfig index 6a3a123..48ee240 100644 --- a/.editorconfig +++ b/.editorconfig @@ -21,7 +21,7 @@ indent_style = tab [*.{ts,json,js,md,jsx,css,less}] indent_style = space -[*.tmx] +[*.{tmx,yml}] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index a45e954..35c6bee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,4 +18,5 @@ *.patch -whitespace *.svg -whitespace *.xml -whitespace +*.yml -whitespace changelog -whitespace diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..478bdbe --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,21 @@ +assembly-versioning-scheme: MajorMinor +mode: ContinuousDeployment +next-version: 3.1.0 +tag-prefix: xliff- +branches: + master: + tag: beta + regex: (origin/)?(master|xliff) + hotfix: + tag: beta + regex: (origin/)?hotfix[/-] + increment: Patch + prevent-increment-of-merged-branch-version: false + track-merge-target: false + tracks-release-branches: false + is-release-branch: false + pull-request: + mode: ContinuousDeployment + tag: PR +ignore: + sha: [] diff --git a/L10NSharp.sln b/L10NSharp.sln index dc99238..4162977 100644 --- a/L10NSharp.sln +++ b/L10NSharp.sln @@ -12,6 +12,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExtractXliff", "src\Extract EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckOrFixXliff", "src\CheckOrFixXliff\CheckOrFixXliff.csproj", "{E4BB984D-DFB8-42EF-860D-5A038FF85B1C}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{7BE95674-0B77-4BA4-9A8A-57718D2B196C}" +ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + GitVersion.yml = GitVersion.yml + .gitattributes = .gitattributes + .gitignore = .gitignore + README.md = README.md +EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/L10NSharp/L10NSharp.csproj b/src/L10NSharp/L10NSharp.csproj index 29dff56..77c7806 100644 --- a/src/L10NSharp/L10NSharp.csproj +++ b/src/L10NSharp/L10NSharp.csproj @@ -27,4 +27,9 @@ + + + all + + From cb43fa2e1a77f992916a05ce390193915f8b803c Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 6 Feb 2019 19:15:48 -0600 Subject: [PATCH 04/12] Add changelog file Also add SIL.ReleaseTasks package to automatically add release notes to nuget package. +semver: minor --- CHANGELOG.md | 21 +++++++++++++++++++++ L10NSharp.sln | 1 + src/L10NSharp/L10NSharp.csproj | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..93ebaa8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + + + +## [Unreleased] + +### Changed + +- Create nuget package diff --git a/L10NSharp.sln b/L10NSharp.sln index 4162977..24cb264 100644 --- a/L10NSharp.sln +++ b/L10NSharp.sln @@ -14,6 +14,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckOrFixXliff", "src\Chec EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{7BE95674-0B77-4BA4-9A8A-57718D2B196C}" ProjectSection(SolutionItems) = preProject + CHANGELOG.md = CHANGELOG.md .editorconfig = .editorconfig GitVersion.yml = GitVersion.yml .gitattributes = .gitattributes diff --git a/src/L10NSharp/L10NSharp.csproj b/src/L10NSharp/L10NSharp.csproj index 77c7806..c96c60c 100644 --- a/src/L10NSharp/L10NSharp.csproj +++ b/src/L10NSharp/L10NSharp.csproj @@ -22,6 +22,7 @@ https://github.com/sillsdev/l10nsharp false ../../output + ../../CHANGELOG.md @@ -31,5 +32,8 @@ all + + all + From 69ceaf6d060b795d9820668559b14f1e15e6cad6 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 12 Feb 2019 16:22:23 +0100 Subject: [PATCH 05/12] Strong-name assembly --- .gitignore | 1 + CHANGELOG.md | 1 + L10NSharp.snk | Bin 0 -> 596 bytes src/L10NSharp/L10NSharp.csproj | 2 ++ src/L10NSharp/Properties/AssemblyInfo.cs | 13 ++++++++++--- src/L10NSharpTests/L10NSharpTests.csproj | 7 +++++++ 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 L10NSharp.snk diff --git a/.gitignore b/.gitignore index b45455f..758be78 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ L10NSharp.userprefs bin/ *.ncrunchsolution *Copy*.bat +*.userprefs *.bak packages/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 93ebaa8..2efc17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,3 +19,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Create nuget package +- Strong-name assembly diff --git a/L10NSharp.snk b/L10NSharp.snk new file mode 100755 index 0000000000000000000000000000000000000000..76d3966648231d534eb5833540756bf1b245455e GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096Q%H)i0R|A2KvmeZ%dxrro?>OI;2U%i-d-JbxHOP>;UW@00hGAB1Bgbj)W5t&Y<<6Ts>*C-^+9&vK0Qj z=HP6D&P^%CFE*$BRb=TRGmL-(a;5AEV}^0G+aI$$%dy-@*b*=P4KUi<`|~CCR5!9; z;UcqIeFbEyS;!*fib_nAsi-zWCddpG4ilT0!3%Z6qA-CIYA1R zLgpg~6cM;rgBD$8=nk!oM*BtkNfS>DES|CzBpUlqDiAB6yWh9l4%03XNB<`6xdvf7 iVi?^icQodW)82Y!-}Xi`+RxpG%E7?HE8nDv)*zOJ2pm%Y literal 0 HcmV?d00001 diff --git a/src/L10NSharp/L10NSharp.csproj b/src/L10NSharp/L10NSharp.csproj index c96c60c..c1d5d70 100644 --- a/src/L10NSharp/L10NSharp.csproj +++ b/src/L10NSharp/L10NSharp.csproj @@ -23,6 +23,8 @@ false ../../output ../../CHANGELOG.md + true + ../../L10NSharp.snk diff --git a/src/L10NSharp/Properties/AssemblyInfo.cs b/src/L10NSharp/Properties/AssemblyInfo.cs index 13a922e..bc3790c 100644 --- a/src/L10NSharp/Properties/AssemblyInfo.cs +++ b/src/L10NSharp/Properties/AssemblyInfo.cs @@ -1,5 +1,12 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("L10NSharpTests")] -[assembly: InternalsVisibleTo("ExtractXliff")] -[assembly: InternalsVisibleTo("CheckOrFixXliff")] +// to get the public key, run: +// 1. extract the public key from the keyfile with +// sn –p +// 2. show the public key with +// sn -tp +// (use the full public key, not the public key token!) + +[assembly: InternalsVisibleTo("L10NSharpTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] +[assembly: InternalsVisibleTo("ExtractXliff" PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] +[assembly: InternalsVisibleTo("CheckOrFixXliff" PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] diff --git a/src/L10NSharpTests/L10NSharpTests.csproj b/src/L10NSharpTests/L10NSharpTests.csproj index 92d772b..24ad4f2 100644 --- a/src/L10NSharpTests/L10NSharpTests.csproj +++ b/src/L10NSharpTests/L10NSharpTests.csproj @@ -50,6 +50,12 @@ false + + true + + + L10NSharp.snk + ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll @@ -92,6 +98,7 @@ + From 6cf0cec952ee5c9778ac6cb732f5411e21112c27 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 12 Feb 2019 17:13:36 +0100 Subject: [PATCH 06/12] Convert tests project to sdk based csproj format --- src/CheckOrFixXliff/CheckOrFixXliff.csproj | 120 ++++----------- .../Properties/AssemblyInfo.cs | 36 ----- src/ExtractXliff/ExtractXliff.csproj | 90 ++++------- src/ExtractXliff/Properties/AssemblyInfo.cs | 38 ----- src/L10NSharp/L10NSharp.csproj | 6 +- src/L10NSharp/Properties/AssemblyInfo.cs | 4 +- .../ILocalizableComponentTests.cs | 2 +- src/L10NSharpTests/L10NSharpTests.csproj | 142 ++++-------------- src/L10NSharpTests/Properties/AssemblyInfo.cs | 36 ----- src/L10NSharpTests/SchemaValidationTests.cs | 4 +- src/L10NSharpTests/XLiffUtilsTests.cs | 1 + src/L10NSharpTests/packages.config | 5 - 12 files changed, 102 insertions(+), 382 deletions(-) delete mode 100644 src/CheckOrFixXliff/Properties/AssemblyInfo.cs delete mode 100644 src/ExtractXliff/Properties/AssemblyInfo.cs delete mode 100644 src/L10NSharpTests/Properties/AssemblyInfo.cs delete mode 100644 src/L10NSharpTests/packages.config diff --git a/src/CheckOrFixXliff/CheckOrFixXliff.csproj b/src/CheckOrFixXliff/CheckOrFixXliff.csproj index 5359208..3421537 100644 --- a/src/CheckOrFixXliff/CheckOrFixXliff.csproj +++ b/src/CheckOrFixXliff/CheckOrFixXliff.csproj @@ -1,98 +1,44 @@ - - - + - Debug - AnyCPU - {E4BB984D-DFB8-42EF-860D-5A038FF85B1C} - Exe - Properties + net461 CheckOrFixXliff - CheckOrFixXliff - v4.6.1 - 512 - true - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - AnyCPU - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - ..\..\output\Release\ - TRACE + + CheckOrFixXliff + SIL + L10NSharp + Copyright © 2010-2019 SIL International prompt 4 + false + false + false + false + false + false + SIL International + ../../output/$(Configuration) + L10NSharp.CheckOrFixXliff + MIT + https://github.com/sillsdev/l10nsharp + false + ../../output + ../../CHANGELOG.md + true + ../../L10NSharp.snk - - - - - - - - - - - - - - - - - Designer - Always - + + - - False - Microsoft .NET Framework 4.6.1 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - + + all + + + all + - - {8ee0895a-7b9d-4b49-8f73-9f1270f1e583} - L10NSharp - + - - - \ No newline at end of file + diff --git a/src/CheckOrFixXliff/Properties/AssemblyInfo.cs b/src/CheckOrFixXliff/Properties/AssemblyInfo.cs deleted file mode 100644 index 1a6d572..0000000 --- a/src/CheckOrFixXliff/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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("CheckOrFixXliff")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SIL International")] -[assembly: AssemblyProduct("CheckOrFixXliff")] -[assembly: AssemblyCopyright("Copyright © SIL International 2018")] -[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("e4bb984d-dfb8-42ef-860d-5a038ff85b1c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ExtractXliff/ExtractXliff.csproj b/src/ExtractXliff/ExtractXliff.csproj index d39fcd2..834a9ac 100644 --- a/src/ExtractXliff/ExtractXliff.csproj +++ b/src/ExtractXliff/ExtractXliff.csproj @@ -1,70 +1,44 @@ - - - + - Debug - AnyCPU - {E0666C78-B8DC-4232-952C-753940D54921} - Exe - Properties + net461 ExtractXliff - ExtractXliff - v4.6.1 - 512 - true - - - - AnyCPU - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - true - -v -n Bloom -o Bloom.exe -p 3.1.000.0 -x /tmp/Bloom.xlf -b /d/github/BloomMaster/DistFiles/localization/en/Bloom.xlf /d/github/BloomMaster/output/Debug/Bloom.exe - - - AnyCPU - pdbonly - true - ..\..\output\Release\ - TRACE + + ExtractXliff + SIL + L10NSharp + Copyright © 2010-2019 SIL International prompt 4 + false + false + false + false + false + false + SIL International + ../../output/$(Configuration) + L10NSharp.ExtractXliff + MIT + https://github.com/sillsdev/l10nsharp + false + ../../output + ../../CHANGELOG.md + true + ../../L10NSharp.snk - - - - - - - - - - - - - + + - + + all + + + all + - - - - {8EE0895A-7B9D-4B49-8F73-9F1270F1E583} - L10NSharp - + diff --git a/src/ExtractXliff/Properties/AssemblyInfo.cs b/src/ExtractXliff/Properties/AssemblyInfo.cs deleted file mode 100644 index 2db5d1c..0000000 --- a/src/ExtractXliff/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2017 SIL International -// This software is licensed under the MIT License (http://opensource.org/licenses/MIT) -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("ExtractXliff")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("SIL International")] -[assembly: AssemblyProduct("ExtractXliff")] -[assembly: AssemblyCopyright("Copyright © 2017 SIL International")] -[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("e0666c78-b8dc-4232-952c-753940d54921")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/L10NSharp/L10NSharp.csproj b/src/L10NSharp/L10NSharp.csproj index c1d5d70..6bbc2dc 100644 --- a/src/L10NSharp/L10NSharp.csproj +++ b/src/L10NSharp/L10NSharp.csproj @@ -1,8 +1,8 @@ - + net461 L10NSharp - L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which needs localization when your application first runs and saves them in a Translation Memory eXchange (TMX) file. It can also dynamically collect strings at runtime. + L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which needs localization when your application first runs and saves them in a XLIFF file. It can also dynamically collect strings at runtime. L10NSharp SIL L10NSharp @@ -17,7 +17,7 @@ false SIL International ../../output/$(Configuration) - L10NSharp.tmx + L10NSharp.xliff MIT https://github.com/sillsdev/l10nsharp false diff --git a/src/L10NSharp/Properties/AssemblyInfo.cs b/src/L10NSharp/Properties/AssemblyInfo.cs index bc3790c..403480d 100644 --- a/src/L10NSharp/Properties/AssemblyInfo.cs +++ b/src/L10NSharp/Properties/AssemblyInfo.cs @@ -8,5 +8,5 @@ // (use the full public key, not the public key token!) [assembly: InternalsVisibleTo("L10NSharpTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] -[assembly: InternalsVisibleTo("ExtractXliff" PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] -[assembly: InternalsVisibleTo("CheckOrFixXliff" PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] +[assembly: InternalsVisibleTo("ExtractXliff, PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] +[assembly: InternalsVisibleTo("CheckOrFixXliff, PublicKey=002400000480000094000000060200000024000052534131000400000100010019cae48c6e5703818db31fcca17b87012eef38df95e3961c59b035190eace2c4ee5cfa1a258b84867c7549f60eec00ec1e0004c2ed224457128e841311cea0f5a05c3d69b3dfcb7422b214febce6e06c83ce4d29c62f36a7fd5564e922338c800372a5ec09638671b4db1fb33ccbb1dc48d8122ffe0d30dadbfbf325f65437b2")] diff --git a/src/L10NSharpTests/ILocalizableComponentTests.cs b/src/L10NSharpTests/ILocalizableComponentTests.cs index 9ff3fa1..3bf75f5 100644 --- a/src/L10NSharpTests/ILocalizableComponentTests.cs +++ b/src/L10NSharpTests/ILocalizableComponentTests.cs @@ -25,7 +25,7 @@ class ILocalizableComponentTests [SetUp] public void TestSetup() { - var installedXliffDir = "../../src/L10NSharpTests/TestXliff"; + var installedXliffDir = "../../../src/L10NSharpTests/TestXliff"; m_manager = LocalizationManager.Create("en", "Test", "Test", "1.0", installedXliffDir, "", null, ""); m_xliffPath = m_manager.GetXliffPathForLanguage("en", true); m_extender = new L10NSharpExtender(); diff --git a/src/L10NSharpTests/L10NSharpTests.csproj b/src/L10NSharpTests/L10NSharpTests.csproj index 24ad4f2..cc617e7 100644 --- a/src/L10NSharpTests/L10NSharpTests.csproj +++ b/src/L10NSharpTests/L10NSharpTests.csproj @@ -1,114 +1,28 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BCE5B569-057C-4D7E-832E-E44A2DA705AC} - Library - Properties - L10NSharp.Tests - L10NSharpTests - v4.6.1 - 512 - - - - - 3.5 - - - - - - - true - full - false - ..\..\output\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - - - false - 6 - - - pdbonly - true - ..\..\output\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - false - - - true - - - L10NSharp.snk - - - - ..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - - - - 3.5 - - - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - {8EE0895A-7B9D-4B49-8F73-9F1270F1E583} - L10NSharp - - - - - - - - - - - \ No newline at end of file + + + net461 + Debug;Release + Unit tests for L10NSharp + L10NSharp.Tests + L10NSharp.Tests + SIL + L10NSharp + Copyright © 2010-2019 SIL International + prompt + 4 + ../../output/$(Configuration) + SIL International + true + ../../L10NSharp.snk + + + + + + + + + + + + diff --git a/src/L10NSharpTests/Properties/AssemblyInfo.cs b/src/L10NSharpTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 043ba1a..0000000 --- a/src/L10NSharpTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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("LocalizationManagerTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Jaars, Inc.")] -[assembly: AssemblyProduct("LocalizationManagerTests")] -[assembly: AssemblyCopyright("Copyright © Jaars, Inc. 2009")] -[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("04e30df5-74fc-4474-83a8-d77bddbdf6de")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/L10NSharpTests/SchemaValidationTests.cs b/src/L10NSharpTests/SchemaValidationTests.cs index 3659cc7..3f8a0aa 100644 --- a/src/L10NSharpTests/SchemaValidationTests.cs +++ b/src/L10NSharpTests/SchemaValidationTests.cs @@ -27,7 +27,7 @@ public void ValidateInFoldersAgainstSchema() var folder = new TempFolder("FileLocation"); Directory.CreateDirectory(folder.Path); LocalizationManagerTests.SetupManager(folder); - var installedXliffDir = "../../src/L10NSharpTests/TestXliff"; + var installedXliffDir = "../../../src/L10NSharpTests/TestXliff"; var schemaLocation = Path.Combine(installedXliffDir, "xliff-core-1.2-transitional.xsd"); var schemas = new XmlSchemaSet(); @@ -67,7 +67,7 @@ public void ValidateFlatFilesAgainstSchema() var folder = new TempFolder("FileLocation"); Directory.CreateDirectory(folder.Path); LocalizationManagerTests.SetupManager(folder); - var installedXliffDir = "../../src/L10NSharpTests/TestXliff"; + var installedXliffDir = "../../../src/L10NSharpTests/TestXliff"; var schemaLocation = Path.Combine(installedXliffDir, "xliff-core-1.2-transitional.xsd"); var schemas = new XmlSchemaSet(); diff --git a/src/L10NSharpTests/XLiffUtilsTests.cs b/src/L10NSharpTests/XLiffUtilsTests.cs index addd9fd..16788f2 100644 --- a/src/L10NSharpTests/XLiffUtilsTests.cs +++ b/src/L10NSharpTests/XLiffUtilsTests.cs @@ -20,6 +20,7 @@ public XLiffUtilsTests() var folder = Path.GetDirectoryName(asmFile); // will be something like /output/Debug folder = Path.GetDirectoryName(folder); folder = Path.GetDirectoryName(folder); + folder = Path.GetDirectoryName(folder); _testFolder = Path.Combine(folder, "src", "L10NSharpTests", "TestXliff"); } diff --git a/src/L10NSharpTests/packages.config b/src/L10NSharpTests/packages.config deleted file mode 100644 index 9a3b9f0..0000000 --- a/src/L10NSharpTests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file From 5b43d36c68c372d34ab20378177c1aeb52570aa5 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 7 Mar 2019 14:20:14 +0100 Subject: [PATCH 07/12] Allow to run tests with msbuild msbuild /t:Test build/L10NSharp.proj --- build/L10NSharp.proj | 59 +++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/build/L10NSharp.proj b/build/L10NSharp.proj index 2cc3283..81b3be4 100644 --- a/build/L10NSharp.proj +++ b/build/L10NSharp.proj @@ -3,25 +3,40 @@ $(MSBuildProjectDirectory)\.. $(teamcity_build_checkoutDir) L10NSharp.sln - Release - /var/lib/TeamCity/agent + Release + true + false + true + false + KnownMonoIssue, + SkipOnTeamCity,$(ExtraExcludeCategories) - - + - + + + + + + + + + + + + + - + + + + + 2.6.4 + $(RootDir)/packages/NUnit.Runners.Net4.$(NUnitVersion) + - + - + + From 6b7f192275720fecd5b6ae6d79c24e7678c62653 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 7 Mar 2019 14:24:10 +0100 Subject: [PATCH 08/12] Update readme --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e63630b..68badca 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ L10NSharp is a .NET localization library for Windows Forms applications. It coll ## L10NSharpExtender -To localize a Windows Forms form or control, simply add the L10NSharpExtender. It will automatically collect all the localizable strings on your form or control and its children. +To localize a Windows Forms form or control, simply add the `L10NSharpExtender`. It will automatically collect all the localizable strings on your form or control and its children. ## Localizing Within the Application @@ -14,18 +14,18 @@ L10NSharp provides a dialog for translating terms while running the application. Just download the repository and build the solution (L10NSharp.sln). -For Linux, the build command would look something like this: +The command line build command would look something like this: - /opt/mono4-sil/bin/xbuild build/L10NSharp.proj /t:Build /p:Configuration=Debug + msbuild /t:Build /p:Configuration=Debug build/L10NSharp.proj -Note that building L10NSharp requires at least version 4.6 of Mono, which mono4-sil provides. +Note that on Linux building L10NSharp requires at least version 5 of Mono, which mono5-sil provides. The mono 5 version that the Mono project provides also works (if mono is at least version 5.16). ## Running Unit Tests We use NUnit to run our unit tests. NUnit is downloaded via NuGet. There may be a few tests that do not run, but all tests that run should pass. -For Linux, the command to run the tests would look something like this: +The tests can be run from the command line like this: - /opt/mono4-sil/bin/mono packages/NUnit.Runners.Net4.2.6.4/tools/nunit-console.exe output/Debug/L10NSharpTests.dll + msbuild /t:Test build/L10NSharp.proj -It is also possible to run the tests from inside MonoDevelop, at least if mono4-sil is installed and made the default Mono runtime. +It is also possible to run the tests from inside Visual Studio, Rider or MonoDevelop (if mono5-sil is installed and made the default Mono runtime). From e14a08c248ecaeb118c47108f3e8b5106fe7b1af Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 7 Mar 2019 14:42:48 +0100 Subject: [PATCH 09/12] Add L10NSharp-Designer.csproj file This project file can be used to edit files in the designer in Visual Studio 2017. --- L10NSharp.sln | 35 ++- README.md | 6 + src/L10NSharp/L10NSharp-Designer.csproj | 319 ++++++++++++++++++++++++ 3 files changed, 348 insertions(+), 12 deletions(-) create mode 100644 src/L10NSharp/L10NSharp-Designer.csproj diff --git a/L10NSharp.sln b/L10NSharp.sln index 24cb264..c44a12a 100644 --- a/L10NSharp.sln +++ b/L10NSharp.sln @@ -1,10 +1,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.438 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "L10NSharp", "src\L10NSharp\L10NSharp.csproj", "{8EE0895A-7B9D-4B49-8F73-9F1270F1E583}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "L10NSharp", "src\L10NSharp\L10NSharp.csproj", "{8EE0895A-7B9D-4B49-8F73-9F1270F1E583}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "L10NSharpTests", "src\L10NSharpTests\L10NSharpTests.csproj", "{BCE5B569-057C-4D7E-832E-E44A2DA705AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "L10NSharpTests", "src\L10NSharpTests\L10NSharpTests.csproj", "{BCE5B569-057C-4D7E-832E-E44A2DA705AC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "src\SampleApp\SampleApp.csproj", "{58923B30-FD84-4BCC-85E0-607DCA7E7C95}" EndProject @@ -13,14 +13,16 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckOrFixXliff", "src\CheckOrFixXliff\CheckOrFixXliff.csproj", "{E4BB984D-DFB8-42EF-860D-5A038FF85B1C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{7BE95674-0B77-4BA4-9A8A-57718D2B196C}" -ProjectSection(SolutionItems) = preProject - CHANGELOG.md = CHANGELOG.md - .editorconfig = .editorconfig - GitVersion.yml = GitVersion.yml - .gitattributes = .gitattributes - .gitignore = .gitignore - README.md = README.md -EndProjectSection + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitattributes = .gitattributes + .gitignore = .gitignore + CHANGELOG.md = CHANGELOG.md + GitVersion.yml = GitVersion.yml + README.md = README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "L10NSharp-Designer", "src\L10NSharp\L10NSharp-Designer.csproj", "{91806E96-1F40-46DF-AEC9-0095D695E5EE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -86,8 +88,17 @@ Global {E4BB984D-DFB8-42EF-860D-5A038FF85B1C}.Release|Mixed Platforms.Build.0 = Release|Any CPU {E4BB984D-DFB8-42EF-860D-5A038FF85B1C}.Release|x86.ActiveCfg = Release|Any CPU {E4BB984D-DFB8-42EF-860D-5A038FF85B1C}.Release|x86.Build.0 = Release|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Debug|x86.ActiveCfg = Debug|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {91806E96-1F40-46DF-AEC9-0095D695E5EE}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C94DFCDA-FC93-4E55-BA2C-E15D8057AC7A} + EndGlobalSection EndGlobal diff --git a/README.md b/README.md index 68badca..002e8db 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,9 @@ The tests can be run from the command line like this: msbuild /t:Test build/L10NSharp.proj It is also possible to run the tests from inside Visual Studio, Rider or MonoDevelop (if mono5-sil is installed and made the default Mono runtime). + +## Working on UI related files + +The L10NSharp project uses SDK style .csproj files which don't allow the Designer to be used in Visual Studio 2017. +There is a `src\L10NSharp\L10NSharp-Designer.csproj` file which uses the old .csproj style and thus allows the +programmer to edit the files with the Designer in Visual Studio 2017. diff --git a/src/L10NSharp/L10NSharp-Designer.csproj b/src/L10NSharp/L10NSharp-Designer.csproj new file mode 100644 index 0000000..f89df91 --- /dev/null +++ b/src/L10NSharp/L10NSharp-Designer.csproj @@ -0,0 +1,319 @@ + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {91806E96-1F40-46DF-AEC9-0095D695E5EE} + Library + Properties + L10NSharp + L10NSharp + v4.6.1 + 512 + + + + + 3.5 + + + + + + + true + full + false + DEBUG;TRACE + prompt + 4 + ..\..\output\Debug\L10NSharp.xml + 1591 + AllRules.ruleset + AnyCPU + false + 6 + + + pdbonly + true + TRACE + prompt + 4 + ..\..\..\output\Release\L10NSharp.xml + AllRules.ruleset + false + + + + + 3.5 + + + + 3.0 + + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + Component + + + DontShowThisAgainButton.cs + + + Form + + + HowToDistributeDialog.cs + + + Form + + + LanguageChoosingDialog.cs + + + Form + + + LanguageChoosingSimpleDialog.cs + + + Form + + + TipDialog.cs + + + Component + + + + + + + + + True + True + Resources.resx + + + True + True + Settings.settings + + + True + True + Reference.svcmap + + + + + UserControl + + + CustomDropDownComboBox.cs + + + Form + + + EditSourceBeforeTranslatingDlg.cs + + + Form + + + FallbackLanguagesDlg.cs + + + Component + + + Form + + + LocalizeItemDlg.cs + + + + + + Form + + + InitializationProgressDlg.cs + + + UserControl + + + UserControl + + + ShortcutKeysEditor.cs + + + UserControl + + + PopupControl.cs + + + + + Component + + + Component + + + Component + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + CustomDropDownComboBox.cs + + + EditSourceBeforeTranslatingDlg.cs + + + FallbackLanguagesDlg.cs + + + HowToDistributeDialog.cs + + + LanguageChoosingDialog.cs + + + LanguageChoosingSimpleDialog.cs + + + L10NExtender.cs + + + LocalizeItemDlg.cs + + + InitializationProgressDlg.cs + + + TipDialog.cs + + + ShortcutKeysEditor.cs + + + PopupControl.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WCF Proxy Generator + Reference.cs + + + + + + + + + + + + + + + + + \ No newline at end of file From 15ddb782848cdc7abbaa076fb09c6c8a0e548e23 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Fri, 8 Mar 2019 09:39:12 +0100 Subject: [PATCH 10/12] Clarify branches in Readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 002e8db..eacb0c5 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ L10NSharp is a .NET localization library for Windows Forms applications. It collects strings which needs localization when your application first runs and saves them in a Translation Memory eXchange (TMX) file. It can also dynamically collect strings at runtime. +The `master` branch works with TMX files, the `xliff` branch with XLIFF files as translation memory. + ## L10NSharpExtender To localize a Windows Forms form or control, simply add the `L10NSharpExtender`. It will automatically collect all the localizable strings on your form or control and its children. From 1a8f6b7f840abf990bf2fe1d9dfd945b567220cf Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Mon, 8 Apr 2019 14:46:03 +0200 Subject: [PATCH 11/12] Change to newer nuget version --- build/NuGet.targets | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/build/NuGet.targets b/build/NuGet.targets index 0bc8409..6929546 100644 --- a/build/NuGet.targets +++ b/build/NuGet.targets @@ -14,23 +14,25 @@ - + - + $(MSBuildThisFileDirectory) - $(ProjectDir)packages.config + $(ProjectDir)packages.config + $(ProjectDir)/packages.config - $(NuGetToolsPath)/NuGet.exe + $(NuGetToolsPath)/nuget.exe @(PackageSource) "$(NuGetExePath)" mono --runtime=v4.0.30319 $(NuGetExePath) + https://dist.nuget.org/win-x86-commandline/latest/nuget.exe @@ -49,7 +51,7 @@ - @@ -59,10 +61,7 @@ - - + Date: Mon, 8 Apr 2019 15:47:37 +0200 Subject: [PATCH 12/12] Small refactoring --- src/ExtractXliff/Program.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ExtractXliff/Program.cs b/src/ExtractXliff/Program.cs index 4887849..703f6ea 100644 --- a/src/ExtractXliff/Program.cs +++ b/src/ExtractXliff/Program.cs @@ -2,15 +2,7 @@ // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; -using System.Drawing; -using System.Text; -using System.Threading.Tasks; using System.Reflection; -using System.Linq; -using System.Diagnostics; -using System.Resources; -using System.Globalization; -using System.Collections; using L10NSharp; using L10NSharp.CodeReader; using L10NSharp.XLiffUtils;