diff --git a/Directory.Build.props b/Directory.Build.props index 264f8f660..d0cf1ae2b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - net461 + net462 Debug;Release End-user collaboration library via 3-way xml merging and hg dvcs under the hood. SIL International diff --git a/src/Chorus/Chorus.csproj b/src/Chorus/Chorus.csproj index 354bd746e..7f79acb3c 100644 --- a/src/Chorus/Chorus.csproj +++ b/src/Chorus/Chorus.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Chorus/ChorusSystem.cs b/src/Chorus/ChorusSystem.cs index fe6c79c75..9df704e3b 100644 --- a/src/Chorus/ChorusSystem.cs +++ b/src/Chorus/ChorusSystem.cs @@ -123,11 +123,11 @@ public static void SetUpLocalization(string desiredUiLangId, var versionObj = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; // We don't need to reload strings for every "revision" (that might be every time we build). var version = "" + versionObj.Major + "." + versionObj.Minor + "." + versionObj.Build; - LocalizationManager.Create(TranslationMemory.XLiff, desiredUiLangId, "Chorus", + LocalizationManager.Create(desiredUiLangId, "Chorus", Application.ProductName, version, directoryOfInstalledXlfFiles, directoryOfUserModifiedXlfFiles, Icon.FromHandle(Properties.Resources.chorus32x32.GetHicon()), // should call DestroyIcon, but when? - "issues@chorus.palaso.org", "Chorus"); + "issues@chorus.palaso.org", new [] {"Chorus"}); } [Obsolete("Only one kind of TranslationMemory is supported: XLF; there is no need for the kind parameter.")] diff --git a/src/ChorusHubApp/ChorusHubApp.csproj b/src/ChorusHubApp/ChorusHubApp.csproj index 177232fec..cfa7ea2fb 100644 --- a/src/ChorusHubApp/ChorusHubApp.csproj +++ b/src/ChorusHubApp/ChorusHubApp.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj index 05545f266..9bcddba46 100644 --- a/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj +++ b/src/ChorusMerge.Tests/ChorusMerge.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/ChorusMerge/ChorusMerge.csproj b/src/ChorusMerge/ChorusMerge.csproj index 562d4a4a1..6199d653c 100644 --- a/src/ChorusMerge/ChorusMerge.csproj +++ b/src/ChorusMerge/ChorusMerge.csproj @@ -5,7 +5,7 @@ ChorusMerge SIL.Chorus.ChorusMerge Exe - net461;net6.0;net8.0 + net462;net8.0 https://github.com/sillsdev/chorus.git true diff --git a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj index a6ca46956..f050c927a 100644 --- a/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj +++ b/src/LibChorus.TestUtilities/LibChorus.TestUtilities.csproj @@ -10,9 +10,9 @@ - + - + diff --git a/src/LibChorus/LibChorus.csproj b/src/LibChorus/LibChorus.csproj index 330dbd98a..0ed94c10a 100644 --- a/src/LibChorus/LibChorus.csproj +++ b/src/LibChorus/LibChorus.csproj @@ -4,21 +4,21 @@ Chorus LibChorus SIL.Chorus.LibChorus - net461;netstandard2.0 + net462;netstandard2.0 https://github.com/sillsdev/chorus.git - + - + - - + + diff --git a/src/LibChorusTests/LibChorus.Tests.csproj b/src/LibChorusTests/LibChorus.Tests.csproj index 1654a1ba0..8163b52da 100644 --- a/src/LibChorusTests/LibChorus.Tests.csproj +++ b/src/LibChorusTests/LibChorus.Tests.csproj @@ -4,7 +4,7 @@ LibChorus.Tests LibChorus.Tests Unit tests for LibChorus.dll - net461;net6.0;net8.0 + net462;net8.0 true false @@ -17,9 +17,9 @@ - - - + + + diff --git a/src/LibChorusTests/MiscTests.cs b/src/LibChorusTests/MiscTests.cs index 939b4c9e0..055c58693 100644 --- a/src/LibChorusTests/MiscTests.cs +++ b/src/LibChorusTests/MiscTests.cs @@ -1,3 +1,4 @@ +using L10NSharp; using LibChorus.TestUtilities; using NUnit.Framework; @@ -18,4 +19,14 @@ public void AllSettingsUseCrossPlatformProvider() } } } + + [SetUpFixture] + public class SetupFixture + { + [OneTimeSetUp] + public void RunBeforeAnyTests() + { + LocalizationManager.StrictInitializationMode = false; + } + } } \ No newline at end of file diff --git a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs index 5c78a6b80..a5e65e1db 100644 --- a/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs +++ b/src/LibChorusTests/merge/xml/lift/MultiTextMergingTests.cs @@ -7,7 +7,7 @@ using NUnit.Framework; -namespace LiftIO.Tests.Merging +namespace LibChorus.Tests.merge.xml.lift { [TestFixture] public class MultiTextMergingTests @@ -84,163 +84,5 @@ public void SkipConvertingElementToTextElementInAnotherFile() Assert.That(doc.DocumentElement.OuterXml, Does.Not.Contain("myStuff"), "Converted element to , but should not have."); Assert.That(doc.DocumentElement.OuterXml, Does.Contain("myStuff"), "Element went away, but should have been present."); } -/* - [Test] - public void MergeMultiTextNodes_OneAddedNewMultiTextElement() - { - string red = @""; - string ancestor = red; - - string blue = @" -
- first -
-
"; - - CheckBothWays(red, blue, ancestor, "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - // private void CheckBothWays(string red, string blue, string ancestor, string xpath) - // { - // XmlNode result= LiftSavvyMergeStrategy.MergeMultiTextPieces(red, blue, ancestor); - // XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - // result= LiftSavvyMergeStrategy.MergeMultiTextPieces(blue, red, ancestor); - // XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - // } - - private void CheckBothWays(string red, string blue, string ancestor, params string[] xpaths) - { - CheckOneWay(red, blue, ancestor, xpaths); - CheckOneWay(blue, red, ancestor, xpaths); - } - - private void CheckOneWay(string ours, string theirs, string ancestor, params string[] xpaths) - { - XmlNode result = MultiTextMerger.MergeMultiTextPieces(ours, theirs, ancestor); - foreach (string xpath in xpaths) - { - XmlTestHelper.AssertXPathMatchesExactlyOne(result.OuterXml, xpath); - } - } - - [Test] - public void MergeMultiTextNodes_EachAddedDifferentAlternatives_GetBoth() - { - - string ancestor = @" - "; - - - string red = @" -
- first -
-
"; - - string blue = @" -
- second -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']", - "lexical-unit/form[@lang='two']/text[text()='second']"); - } - - [Test] - public void MergeMultiTextNodes_OneAddedAnAlternatives_GetBoth() - { - string red = @" -
- first -
-
"; - - string ancestor = red; - - string blue = @" -
- first -
-
- second -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']", - "lexical-unit/form[@lang='two']/text[text()='second']"); - } - - [Test] - public void MergeMultiTextNodes_OnePutSomethingInPreviouslyEmptyForm() - { - string red = @" -
- "; - - string ancestor = red; - - string blue = @" - - first - -
"; - - Assert.That(Utilities.AreXmlElementsEqual(red, blue), Is.False); - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - [Test] - public void MergeMultiTextNodes_OnePutSomethingInPreviouslyEmptyFormText() - { - string red = @" -
-
"; - - string ancestor = red; - - - string blue = @" -
- first -
-
"; - - CheckBothWays(red, blue, ancestor, - "lexical-unit/form[@lang='one']/text[text()='first']"); - } - - [Test] - public void WeDeletedAForm_FormRemoved() - { - string red = @""; - string blue = @" -
- first -
-
"; - string ancestor = blue; - - CheckOneWay(blue, red, ancestor, "lexical-unit[ not(form)]"); - } - - [Test] - public void TheyDeleteAForm_FormRemoved() - { - string red = @""; - string blue = @" -
- first -
-
"; - string ancestor = blue; - - CheckOneWay(blue, red, ancestor, "lexical-unit[ not(form)]"); - } -*/ } }