diff --git a/Directory.Build.props b/Directory.Build.props index 6f36b4e..3f023ea 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,8 +2,8 @@ <PropertyGroup> <ApplicationName>SILConverters</ApplicationName> <SafeApplicationName>SILConverters</SafeApplicationName> - <TruncatedVersion>5.1</TruncatedVersion> - <VersionNumber>5.1.3.0</VersionNumber> + <TruncatedVersion>5.2</TruncatedVersion> + <VersionNumber>5.2.0.0</VersionNumber> <UpgradeCode>8A50226C-84D0-4CAF-AF8F-B0284643C415</UpgradeCode> <Year>2023</Year> <Manufacturer>SIL International</Manufacturer> diff --git a/Installer/Converter Packages/IndicConverters/IndicConverters.wixproj b/Installer/Converter Packages/IndicConverters/IndicConverters.wixproj index 648421a..0ad9664 100644 --- a/Installer/Converter Packages/IndicConverters/IndicConverters.wixproj +++ b/Installer/Converter Packages/IndicConverters/IndicConverters.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -82,7 +82,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/Converter Packages/IndicConverters/packages.config b/Installer/Converter Packages/IndicConverters/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/Converter Packages/IndicConverters/packages.config +++ b/Installer/Converter Packages/IndicConverters/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/Converter Packages/IndicConverters64bit/IndicConverters64bit.wixproj b/Installer/Converter Packages/IndicConverters64bit/IndicConverters64bit.wixproj index 78ce5be..1f92681 100644 --- a/Installer/Converter Packages/IndicConverters64bit/IndicConverters64bit.wixproj +++ b/Installer/Converter Packages/IndicConverters64bit/IndicConverters64bit.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> @@ -40,7 +40,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/Converter Packages/IndicConverters64bit/packages.config b/Installer/Converter Packages/IndicConverters64bit/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/Converter Packages/IndicConverters64bit/packages.config +++ b/Installer/Converter Packages/IndicConverters64bit/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/SEC Setup 64bit/EcFeatures.wxs b/Installer/SEC Setup 64bit/EcFeatures.wxs index c9111be..1d222e5 100644 --- a/Installer/SEC Setup 64bit/EcFeatures.wxs +++ b/Installer/SEC Setup 64bit/EcFeatures.wxs @@ -105,7 +105,7 @@ <MergeRef Id="DChartHelper"/> <MergeRef Id="AIGuesser"/> </Feature> - <Feature Id="Paratext_BackTranslation_Helper_Plugin" Title="Paratext Back Translation Helper Plugin" Description="The Ptx BT Helper can be launched from the Paratext, Tools menu (newer than 9.2.102.17). Allows you to use Bing/DeepL to prepare a back translation of 1 project into another. It requires an internet connection to run." Display="expand" Level="4" AllowAdvertise="no"> + <Feature Id="Paratext_BackTranslation_Helper_Plugin" Title="Paratext Back Translation Helper Plugin" Description="The Ptx BT Helper can be launched from the Paratext, Tools menu (newer than 9.2.102.17). Allows you to use Bing/DeepL/Google Translate to prepare a back translation of 1 project into another. It requires an internet connection to run." Display="expand" Level="4" AllowAdvertise="no"> <Condition Level="3"><![CDATA[COMPONENTEXISTS_PARATEXT_9 AND NOT REMOVE]]></Condition> <MergeRef Id="SEC_EC"/> <MergeRef Id="ParatextBackTranslationHelperPlugin"/> @@ -115,7 +115,7 @@ </Feature> </Feature> <Feature Id="Transduction_Engines" Title="Transduction Engines" Description="Expand this node to select or deselect individual transduction engines" Level="3" AllowAdvertise="no"> - <Feature Id="BingTranslator" Title="Bing/DeepL Translators" Description="Use the Bing or DeepL Translator for text translation. Requires an internet connection." Display="expand" Level="3" AllowAdvertise="no"> + <Feature Id="BingTranslator" Title="Bing/DeepL/Google Translate" Description="Use Bing, DeepL, or Google Translate for text translation. Requires an internet connection." Display="expand" Level="3" AllowAdvertise="no"> <MergeRef Id="EcTranslators" /> </Feature> <Feature Id="TECkit_DLLs" Title="TECkit" Description="Contains the TECkit conversion and compiling engines (DLLs). Select this component if you intend to use TECkit for encoding conversion or other transduction processing." Display="expand" Level="3" AllowAdvertise="no"> diff --git a/Installer/SEC Setup 64bit/Product.wxs b/Installer/SEC Setup 64bit/Product.wxs index cc7589e..8e4acba 100644 --- a/Installer/SEC Setup 64bit/Product.wxs +++ b/Installer/SEC Setup 64bit/Product.wxs @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"> - <Product Id="*" UpgradeCode="{0F7D5D72-E9F3-40BB-9748-D388C70096CD}" Name="SIL Converters 5.1 (x64)" Manufacturer="SIL International" - Language="1033" Version="5.1" > + <Product Id="*" UpgradeCode="{0F7D5D72-E9F3-40BB-9748-D388C70096CD}" Name="SIL Converters 5.2 (x64)" Manufacturer="SIL International" + Language="1033" Version="5.2" > <Package InstallerVersion="500" Compressed='yes' InstallScope="perMachine" Platform="x64" /> diff --git a/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj b/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj index c1bf8c7..be423d2 100644 --- a/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj +++ b/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> @@ -59,7 +59,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/SEC Setup 64bit/packages.config b/Installer/SEC Setup 64bit/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/SEC Setup 64bit/packages.config +++ b/Installer/SEC Setup 64bit/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/SEC Setup/EcFeatures.wxs b/Installer/SEC Setup/EcFeatures.wxs index f9dd366..cfcde8e 100644 --- a/Installer/SEC Setup/EcFeatures.wxs +++ b/Installer/SEC Setup/EcFeatures.wxs @@ -137,7 +137,7 @@ </Feature> </Feature> <Feature Id="Transduction_Engines" Title="Transduction Engines" Description="Expand this node to select or deselect individual transduction engines" Level="3" AllowAdvertise="no"> - <Feature Id="BingTranslator" Title="Bing/DeepL Translators" Description="Use the Bing or DeepL Translator for text translation. Requires an internet connection." Display="expand" Level="3" AllowAdvertise="no"> + <Feature Id="BingTranslator" Title="Bing/DeepL/Google Translate" Description="Use Bing, DeepL, or Google Translate for text translation. Requires an internet connection." Display="expand" Level="3" AllowAdvertise="no"> <MergeRef Id="EcTranslators" /> </Feature> <Feature Id="TECkit_DLLs" Title="TECkit" Description="Contains the TECkit conversion and compiling engines (DLLs). Select this component if you intend to use TECkit for encoding conversion or other transduction processing." Display="expand" Level="3" AllowAdvertise="no"> diff --git a/Installer/SEC Setup/Product.wxs b/Installer/SEC Setup/Product.wxs index 2d84e28..1d69ed0 100644 --- a/Installer/SEC Setup/Product.wxs +++ b/Installer/SEC Setup/Product.wxs @@ -4,8 +4,8 @@ xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"> - <Product Id="*" UpgradeCode="8A50226C-84D0-4CAF-AF8F-B0284643C415" Name="SIL Converters 5.1" Manufacturer="SIL International" - Language="1033" Version="5.1"> + <Product Id="*" UpgradeCode="8A50226C-84D0-4CAF-AF8F-B0284643C415" Name="SIL Converters 5.2" Manufacturer="SIL International" + Language="1033" Version="5.2"> <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" /> <Condition Message="You need to be an administrator to install this product.">Privileged</Condition> diff --git a/Installer/SEC Setup/SEC Setup.wixproj b/Installer/SEC Setup/SEC Setup.wixproj index 1b9a3b5..2301ab3 100644 --- a/Installer/SEC Setup/SEC Setup.wixproj +++ b/Installer/SEC Setup/SEC Setup.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> @@ -67,7 +67,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/SEC Setup/packages.config b/Installer/SEC Setup/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/SEC Setup/packages.config +++ b/Installer/SEC Setup/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/ScHelpMM/ScHelpMM.wixproj b/Installer/ScHelpMM/ScHelpMM.wixproj index ecf2e1e..f1bdab5 100644 --- a/Installer/ScHelpMM/ScHelpMM.wixproj +++ b/Installer/ScHelpMM/ScHelpMM.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -48,7 +48,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/ScHelpMM/packages.config b/Installer/ScHelpMM/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/ScHelpMM/packages.config +++ b/Installer/ScHelpMM/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/SetupSILConverters/SetupSILConverters.wixproj b/Installer/SetupSILConverters/SetupSILConverters.wixproj index 5be7713..d052d50 100644 --- a/Installer/SetupSILConverters/SetupSILConverters.wixproj +++ b/Installer/SetupSILConverters/SetupSILConverters.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="$([MSBuild]::GetPathOfFileAbove(directory.build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(directory.build.props))')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> @@ -17,10 +17,10 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath> - <DefineConstants>ApplicationName=SILConverters;SafeApplicationName=SILConverters;TruncatedVersion=5.1;VersionNumber=5.1.3.0;UpgradeCode=8A50226C-84D0-4CAF-AF8F-B0284643C415;Year=2023;Manufacturer=SIL International;EcDistFilesPath=$(EcDistFilesPath)</DefineConstants> + <DefineConstants>ApplicationName=SILConverters;SafeApplicationName=SILConverters;TruncatedVersion=5.2;VersionNumber=5.2.0.0;UpgradeCode=8A50226C-84D0-4CAF-AF8F-B0284643C415;Year=2023;Manufacturer=SIL International;EcDistFilesPath=$(EcDistFilesPath)</DefineConstants> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> - <DefineConstants>ApplicationName=SILConverters;SafeApplicationName=SILConverters;TruncatedVersion=5.1;VersionNumber=5.1.3.0;UpgradeCode=0F7D5D72-E9F3-40BB-9748-D388C70096CD;Year=2023;Manufacturer=SIL International;EcDistFilesPath=$(EcDistFilesPath)</DefineConstants> + <DefineConstants>ApplicationName=SILConverters;SafeApplicationName=SILConverters;TruncatedVersion=5.2;VersionNumber=5.2.0.0;UpgradeCode=0F7D5D72-E9F3-40BB-9748-D388C70096CD;Year=2023;Manufacturer=SIL International;EcDistFilesPath=$(EcDistFilesPath)</DefineConstants> <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath> <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath> </PropertyGroup> @@ -66,7 +66,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <Target Name="PostBuildCopy" AfterTargets="Build"> <PropertyGroup> diff --git a/Installer/SetupSILConverters/packages.config b/Installer/SetupSILConverters/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/SetupSILConverters/packages.config +++ b/Installer/SetupSILConverters/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/TECkitPackage64bitMM/TECkitPackageMM64bit.wixproj b/Installer/TECkitPackage64bitMM/TECkitPackageMM64bit.wixproj index 576e9e6..cc15a58 100644 --- a/Installer/TECkitPackage64bitMM/TECkitPackageMM64bit.wixproj +++ b/Installer/TECkitPackage64bitMM/TECkitPackageMM64bit.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -39,7 +39,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/TECkitPackage64bitMM/packages.config b/Installer/TECkitPackage64bitMM/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/TECkitPackage64bitMM/packages.config +++ b/Installer/TECkitPackage64bitMM/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/Installer/TECkitPackageMM/TECkitPackageMM.wixproj b/Installer/TECkitPackageMM/TECkitPackageMM.wixproj index 986b8b4..3d52681 100644 --- a/Installer/TECkitPackageMM/TECkitPackageMM.wixproj +++ b/Installer/TECkitPackageMM/TECkitPackageMM.wixproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\..\packages\WiX.3.11.2\build\wix.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -39,7 +39,7 @@ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WiX.3.11.2\build\wix.props'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. diff --git a/Installer/TECkitPackageMM/packages.config b/Installer/TECkitPackageMM/packages.config index 6cf2c2d..6d26307 100644 --- a/Installer/TECkitPackageMM/packages.config +++ b/Installer/TECkitPackageMM/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" /> + <package id="Encoding-Converters-Core" version="0.7.0" /> <package id="WiX" version="3.11.2" /> </packages> \ No newline at end of file diff --git a/src/AdaptIt2Unicode/AdaptIt2Unicode.csproj b/src/AdaptIt2Unicode/AdaptIt2Unicode.csproj index 10b3b0f..f9d3754 100644 --- a/src/AdaptIt2Unicode/AdaptIt2Unicode.csproj +++ b/src/AdaptIt2Unicode/AdaptIt2Unicode.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -204,6 +204,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/AdaptIt2Unicode/packages.config b/src/AdaptIt2Unicode/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/AdaptIt2Unicode/packages.config +++ b/src/AdaptIt2Unicode/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/BulkSFMConverter/SFMConv.csproj b/src/BulkSFMConverter/SFMConv.csproj index e9bf75b..09bb893 100644 --- a/src/BulkSFMConverter/SFMConv.csproj +++ b/src/BulkSFMConverter/SFMConv.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -207,6 +207,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/BulkSFMConverter/app.config b/src/BulkSFMConverter/app.config index e17519a..9e6a6c5 100644 --- a/src/BulkSFMConverter/app.config +++ b/src/BulkSFMConverter/app.config @@ -1,5 +1,78 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="utf-8"?> <configuration> - <configSections> - </configSections> -<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration> diff --git a/src/BulkSFMConverter/packages.config b/src/BulkSFMConverter/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/BulkSFMConverter/packages.config +++ b/src/BulkSFMConverter/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/ClipboardEC/ClipboardEC.csproj b/src/ClipboardEC/ClipboardEC.csproj index 1422be3..369d22d 100644 --- a/src/ClipboardEC/ClipboardEC.csproj +++ b/src/ClipboardEC/ClipboardEC.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <ProjectType>Local</ProjectType> <ProductVersion>9.0.30729</ProductVersion> @@ -198,6 +198,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/ClipboardEC/ClipboardEncConverter.cs b/src/ClipboardEC/ClipboardEncConverter.cs index b19c7dd..4226a35 100644 --- a/src/ClipboardEC/ClipboardEncConverter.cs +++ b/src/ClipboardEC/ClipboardEncConverter.cs @@ -936,12 +936,14 @@ private void DirectionForwardClick(Object sender, EventArgs e) this.forwardToolStripMenuItem.Checked = !this.forwardToolStripMenuItem.Checked; } + private IEncConverter _lastEncConverterUsed; + private void ConverterClick(Object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; string strConverterName = item.Text; - IEncConverter aEC = GetEncConverters[strConverterName]; + _lastEncConverterUsed = GetEncConverters[strConverterName]; // now convert the contents of the clipboard (using the correct code page, etc.) IDataObject iData = Clipboard.GetDataObject(); @@ -950,7 +952,7 @@ private void ConverterClick(Object sender, EventArgs e) if( iData.GetDataPresent(DataFormats.UnicodeText) ) { string strInput = (string)iData.GetData(DataFormats.UnicodeText); - string strOutput = ConvertDataWithProps(aEC, strInput, DebugState); + string strOutput = ConvertDataWithProps(_lastEncConverterUsed, strInput, DebugState); if( strOutput != null ) Clipboard.SetDataObject(strOutput); } @@ -958,6 +960,9 @@ private void ConverterClick(Object sender, EventArgs e) private string ConvertDataWithProps(IEncConverter aEC, string strInput, bool bDebugState) { + if (aEC == null) + return strInput; + aEC.Debug = bDebugState; if( this.noneToolStripMenuItem.Checked ) @@ -1457,58 +1462,49 @@ protected void UpdateIconText() // if a spell fixer project is selected, then make that the left-click behavior if (IsSpellFixerProject) { - this.notifyIconClipboardEC.Text = "Left-click: SpellFixer shortcut; Right-click: system converters"; + this.notifyIconClipboardEC.Text = "L-click: Add Substitution; R-click: preview converters"; MessageBox.Show(String.Format("Now you can click on the ClipboardEncConverter icon with the left mouse button to add a spelling correction to the{0}'{1}' SpellFixer project. The right mouse button still provides normal ClipboardEncConverter functionality.", Environment.NewLine, m_aSpellFixer.SpellFixerEncConverterName), cstrCaption); } else - this.notifyIconClipboardEC.Text = "Convert clipboard data with a system converter (right-click)"; + this.notifyIconClipboardEC.Text = "L-Click: Repeat last conversion; R-click: preview converters"; } private void DealWithLeftClick() { - // if the SpellFixer isn't installed... then just skip this. - if (SpellFixerByReflection.IsSpellFixerAvailable) + // new behavior (2023-07-31): if there's a spell-fixer project loaded, then left-click means bring up the + // Add correction dialog and then process what's on the clipboard thru the updated spellfixer project. Otherwise, + // left click means process the data on the clipboard with the last converter used (so my repeated uses of the + // ClearOutSfmMarkers perl expression can just be a single click. + + // ... go ahead and try to convert what's on the clipboard + IDataObject iData = Clipboard.GetDataObject(); + + // Determines whether the data is in a format you can use. + if (iData.GetDataPresent(DataFormats.UnicodeText)) { - /* Kent thought we should turn this off... so turn it off unless the user has enabled a project - // okay, it's installed, but the user may not realize that the 'Click' event defaults - // to be for SpellFixer so make sure this is what they intended. - if (m_aSpellFixer == null) - { - DialogResult res = MessageBox.Show(String.Format("Turn on 'one-click SpellFixer' mode? {0}{0}[otherwise, if you were just trying to convert the text on the clipboard, then right-click the icon instead]", Environment.NewLine), cstrCaption, MessageBoxButtons.YesNoCancel); - if (res == DialogResult.Yes) - TryLoginProject(); - } - */ - // if it's now available... - if (IsSpellFixerProject) + string strInput = (string)iData.GetData(DataFormats.UnicodeText); + if (strInput.Length > 0) { - // ... go ahead and try to convert what's on the clipboard - IDataObject iData = Clipboard.GetDataObject(); - - // Determines whether the data is in a format you can use. - if (iData.GetDataPresent(DataFormats.UnicodeText)) + // if the SpellFixer isn't installed... then just skip this. + IEncConverter aEC = null; + if (SpellFixerByReflection.IsSpellFixerAvailable && IsSpellFixerProject) { - string strInput = (string)iData.GetData(DataFormats.UnicodeText); - if (strInput.Length > 0) - { - m_aSpellFixer.AssignCorrectSpelling(strInput); + m_aSpellFixer.AssignCorrectSpelling(strInput); - // when the ACS method returns, the couplet has been (probably) added - IEncConverter aEC = m_aSpellFixer.SpellFixerEncConverter; - string strOutput = aEC.Convert(strInput); - if (strOutput != null) - Clipboard.SetDataObject(strOutput); - } + // when the ACS method returns, the couplet has been (probably) added + aEC = m_aSpellFixer.SpellFixerEncConverter; } + else if (_lastEncConverterUsed != null) + { + aEC = _lastEncConverterUsed; + } + + var strOutput = aEC?.Convert(strInput); + if (strOutput != null) + Clipboard.SetDataObject(strOutput); } } - /* do nothing if it isn't installed or if SpellFixer isn't enabled... - else - { - MessageBox.Show("Use the right-mouse button to bring up the list of converters to choose from", cstrCaption); - } - */ } private void displaySpellingFixToolStripMenuItem_Click(object sender, EventArgs e) diff --git a/src/ClipboardEC/app.config b/src/ClipboardEC/app.config index 8204e7f..b0a590c 100644 --- a/src/ClipboardEC/app.config +++ b/src/ClipboardEC/app.config @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <configuration> - <startup> - <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> - </startup> - <runtime> - <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <startup> + <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> + </startup> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> @@ -21,21 +21,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -53,22 +49,34 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> - </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> - </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> + </dependentAssembly> </assemblyBinding> - </runtime> + </runtime> </configuration> diff --git a/src/ClipboardEC/packages.config b/src/ClipboardEC/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/ClipboardEC/packages.config +++ b/src/ClipboardEC/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/DChartHelper/DChartHelper.csproj b/src/DChartHelper/DChartHelper.csproj index e9474f5..7ff4fae 100644 --- a/src/DChartHelper/DChartHelper.csproj +++ b/src/DChartHelper/DChartHelper.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -255,6 +255,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/DChartHelper/packages.config b/src/DChartHelper/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/DChartHelper/packages.config +++ b/src/DChartHelper/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.Designer.cs b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.Designer.cs index 5eda869..5954f1c 100644 --- a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.Designer.cs +++ b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.Designer.cs @@ -29,8 +29,10 @@ protected override void Dispose(bool disposing) /// </summary> private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.backTranslationHelperCtrl = new BackTranslationHelper.BackTranslationHelperCtrl(); this.textBoxStatus = new System.Windows.Forms.TextBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.SuspendLayout(); // // backTranslationHelperCtrl @@ -81,5 +83,6 @@ private void InitializeComponent() private BackTranslationHelper.BackTranslationHelperCtrl backTranslationHelperCtrl; private System.Windows.Forms.TextBox textBoxStatus; + private System.Windows.Forms.ToolTip toolTip; } } \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.cs b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.cs index 9a05748..49c2b2f 100644 --- a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.cs +++ b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.cs @@ -12,8 +12,11 @@ using System.Linq; using System.Windows.Forms; using Newtonsoft.Json; -using System.Windows; -using System.Security.Policy; +using System.Collections.Specialized; +using System.Threading.Tasks; +using ECInterfaces; +using System.Threading; +using System.Runtime.InteropServices; namespace SIL.ParatextBackTranslationHelperPlugin { @@ -22,11 +25,11 @@ public partial class BackTranslationHelperForm : Form, IBackTranslationHelperDat private const string FrameTextFormat = "Back Translating from {0} in verse: {1}"; private const string ProjectNameFormat = "{0} - {1}"; - private readonly IProject _projectSource; - private readonly IProject _projectTarget; - private readonly IProjectLanguage _languageSource; - private readonly IProjectLanguage _languageTarget; - private readonly IKeyboard _keyboardTarget; + private IProject _projectSource; + private IProject _projectTarget; + private IProjectLanguage _languageSource; + private IProjectLanguage _languageTarget; + private IKeyboard _keyboardTarget; private readonly IPluginHost _host; private readonly ParatextBackTranslationHelperPlugin _plugin; private Action<BackTranslationHelperModel> _updateControls; @@ -68,7 +71,7 @@ public partial class BackTranslationHelperForm : Form, IBackTranslationHelperDat /// <summary> /// This contains the list of marker tokens immediately preceding the text tokens in the source data /// </summary> - private List<IUSFMMarkerToken> TextTokenMarkersSource { get; set; } = new List<IUSFMMarkerToken>(); + private TextTokenMarkers TextTokenMarkersSource { get; set; } /// <summary> /// this contains the tokens from the target project, for all the verses in the current chapter (we need the @@ -81,50 +84,259 @@ public partial class BackTranslationHelperForm : Form, IBackTranslationHelperDat private Dictionary<string, SortedDictionary<string, List<IUSFMToken>>> UsfmTokensTarget { get; set; } = new Dictionary<string, SortedDictionary<string, List<IUSFMToken>>>(); public BackTranslationHelperForm(IPluginHost host, ParatextBackTranslationHelperPlugin plugin, Action<IVerseRef> setSyncReferenceGroup, - IVerseRef initialVerseReference, IProject projectSource, IProject projectTarget, IProjectLanguage languageSource, IProjectLanguage languageTarget) + IVerseRef initialVerseReference) { InitializeComponent(); + InitializeSettings(true); + _host = host; _plugin = plugin; _versesReference = _verseReferenceLast = _verseReference = initialVerseReference; _setSyncReferenceGroup = setSyncReferenceGroup; - _projectSource = projectSource; - _projectTarget = projectTarget; - _languageSource = languageSource; - _languageTarget = languageTarget; - _keyboardTarget = _projectTarget.VernacularKeyboard; + + InitializeProjects(_host); // this form is the implementation of the way to get get data backTranslationHelperCtrl.BackTranslationHelperDataSource = this; backTranslationHelperCtrl.RegisterForNotification(BackTranslationHelperCtrl.SubscribeableEventKeyTargetBackTranslationTextChanged, TargetBackTranslationTextChanged); + AddToSettingsMenu(backTranslationHelperCtrl); _host.VerseRefChanged += Host_VerseRefChanged; - _projectSource.ScriptureDataChanged += ScriptureDataChangedHandlerSource; + } + + /// <summary> + /// If Ptx is upgraded, then we lose the settings. This should upgrade them, if we reinstall (bkz + /// UpgradeSettings will be true 1st time after install). + /// Settings if user wants to adjust something are stored in: \AppData\Local\United_Bible_Societies\Paratext.exe_[guid]\[version #]\user.config file + /// e.g. C:\Users\pete_\AppData\Local\United_Bible_Societies\Paratext.exe_Url_10vizzham1xunpacgy3t1em4g1uelorz\9.3.103.14 + /// </summary> + /// <param name="bDoUpgrade"></param> + private void InitializeSettings(bool bDoUpgrade) + { + if (bDoUpgrade && Properties.Settings.Default.UpgradeSettings) + { + Properties.Settings.Default.Upgrade(); + Properties.Settings.Default.UpgradeSettings = false; + Properties.Settings.Default.Save(); + } + } + + private System.Windows.Forms.ToolStripMenuItem translateNothingButPublishableScriptureTextMenuItem; + + private void AddToSettingsMenu(BackTranslationHelperCtrl backTranslationHelperCtrl) + { + // add a menu to allow the user to choose a new source project + var chooseSourceProjectMenuItem = new System.Windows.Forms.ToolStripMenuItem + { + Name = "chooseSourceProjectMenuItem", + Size = new System.Drawing.Size(247, 22), + Text = "&Select New Source Project", + ToolTipText = "Click to bring up a dialog to select a different Paratext project to be the source text for the Translation(s).", + }; + chooseSourceProjectMenuItem.Click += new System.EventHandler(this.ChangeSourceProject_Click); + backTranslationHelperCtrl.AddToSettingsMenu(chooseSourceProjectMenuItem); + + translateNothingButPublishableScriptureTextMenuItem = new System.Windows.Forms.ToolStripMenuItem + { + CheckOnClick = true, + Name = "translateNothingButPublishableScriptureTextMenuItem", + Size = new System.Drawing.Size(247, 22), + Text = "&Translate only verse text", + ToolTipText = "Check this option to have the source text translated without interruption by inline footnotes or \\va or \\vp verse numbering (should generate a better translation)", + }; + translateNothingButPublishableScriptureTextMenuItem.Checked = Properties.Settings.Default.TranslateOnlyText; + translateNothingButPublishableScriptureTextMenuItem.CheckStateChanged += new System.EventHandler(this.TranslateNothingButPublishableScriptureTextMenuItem_CheckStateChanged); + backTranslationHelperCtrl.AddToSettingsMenu(translateNothingButPublishableScriptureTextMenuItem); + } + + private void TranslateNothingButPublishableScriptureTextMenuItem_CheckStateChanged(object sender, EventArgs e) + { + var newCheckState = translateNothingButPublishableScriptureTextMenuItem.Checked; + if (newCheckState != Properties.Settings.Default.TranslateOnlyText) + { + Properties.Settings.Default.TranslateOnlyText = newCheckState; + Properties.Settings.Default.Save(); + } + + UsfmTokensSource.Clear(); // so we requery from the new source project + GetNewReference(_verseReference); + } + + private void ChangeSourceProject_Click(object sender, EventArgs e) + { + var mapProjectNameToSourceProjectOverride = BackTranslationHelperCtrl.SettingToDictionary(Properties.Settings.Default.MapProjectNameToSourceProjectOverride); + + var projectName = _projectTarget.ShortName; + if (mapProjectNameToSourceProjectOverride.ContainsKey(projectName)) + { + // remove any previous ones in case the user just cancels the QueryForProject to remove the override + mapProjectNameToSourceProjectOverride.Remove(projectName); + } + + var projectSource = QueryForProject("Source"); + if ((projectSource != null) && (projectSource != _projectSource)) + { + _projectSource = projectSource; + var lstSourceProjects = new List<string> { _projectSource.ShortName }; + mapProjectNameToSourceProjectOverride[projectName] = lstSourceProjects; + + InitializeSourceProjectCorrelates(_projectSource); + UsfmTokensSource.Clear(); // so we requery from the new source project + GetNewReference(_verseReference); + } + + Properties.Settings.Default.MapProjectNameToSourceProjectOverride = BackTranslationHelperCtrl.SettingFromDictionary(mapProjectNameToSourceProjectOverride); + Properties.Settings.Default.Save(); + } + + private void InitializeProjects(IPluginHost host) + { + var projects = host.GetAllProjects(); + var selectedProject = host.ActiveWindowState?.Project; + + var projectName = selectedProject.ShortName; + + if (Properties.Settings.Default.MapProjectNameToSourceProjectOverride == null) + Properties.Settings.Default.MapProjectNameToSourceProjectOverride = new StringCollection(); + var mapProjectNameToSourceProjectOverride = BackTranslationHelperCtrl.SettingToDictionary(Properties.Settings.Default.MapProjectNameToSourceProjectOverride); + + if (mapProjectNameToSourceProjectOverride.TryGetValue(projectName, out List<string> lstSourceProjects)) + { + _projectSource = projects.FirstOrDefault(p => p.ShortName == lstSourceProjects[0]); + _projectTarget = projects.FirstOrDefault(p => p.ShortName == selectedProject.ShortName); + } + + // if the user selects the daughter/target project, let's assume that's the intended target from it's base project + else if ((selectedProject != null) && (selectedProject.BaseProject != null)) + { + _projectSource = projects.FirstOrDefault(p => p.ShortName == selectedProject.BaseProject.ShortName); + _projectTarget = projects.FirstOrDefault(p => p.ShortName == selectedProject.ShortName); + } + else + { + // otherwise, make them choose + _projectSource ??= QueryForProject("Source"); + _projectTarget ??= QueryForProject("Target"); + } + + if ((_projectSource == null) || (_projectTarget == null)) + throw new ApplicationException($"Source ('{_projectSource}') or Target ('{_projectTarget}') project not selected. Can't continue!"); + + InitializeSourceProjectCorrelates(_projectSource); + + _languageTarget = _projectTarget.Language; + _keyboardTarget = _projectTarget.VernacularKeyboard; _projectTarget.ScriptureDataChanged += ScriptureDataChangedHandlerTarget; } - private void TargetBackTranslationTextChanged(string value) + private void InitializeSourceProjectCorrelates(IProject projectSource) + { + _languageSource = projectSource.Language; + projectSource.ScriptureDataChanged += ScriptureDataChangedHandlerSource; + } + + private IProject QueryForProject(string projectType) { - var translatedCount = GetTranslatedLines(value).Count; - System.Diagnostics.Debug.WriteLine($"PtxBTH: TargetBackTranslationTextChanged: SourceDataLineCount = '{SourceDataLineCount}', translatedCount = '{translatedCount}'"); - var statusText = String.Empty; - if (SourceDataLineCount != translatedCount) + var projects = _host.GetAllProjects(); + var dlg = new ProjectListForm(projects, projectType); + if (dlg.ShowDialog() == DialogResult.OK) { - statusText = String.Format("There {0} currently {1} line{2} of text in the Target Translation box vs. {3} text line{4} in the source verse ({5}: {6})", - (translatedCount > 1) ? "are" : "is", - translatedCount, - (translatedCount > 1) ? "s" : string.Empty, - SourceDataLineCount, - (SourceDataLineCount > 1) ? "s" : string.Empty, - (TextTokenMarkersSource.Count > 1) ? "one for each of these markers" : "for this marker", - String.Join(",", TextTokenMarkersSource.Select(m => $"\\{m.Marker}"))); + return projects.FirstOrDefault(p => p.ShortName == dlg.SelectedDisplayName); } - textBoxStatus.Text = statusText; + return null; + } + + private CancellationTokenSource cancellationTokenSource; + private Task<BackgroundWorkerResult> backgroundTask = null; + + /// <summary> + /// This method is called by the BackTranslationHelperCtrl, since we registered for any changes + /// to the translated text. We use it to verify that the number of paragraphs of text in the target + /// translation text matches how many are needed for the source text markers that will be used for them. + /// I've created this processing as an asynchronous task (since it can take some time) in the hopes of + /// getting rid of the occasional error whereby the status text box and/or the tooltip stops updating. + /// If we get multiple calls w/in a second, then the earlier executions will end up being canceled + /// before completion, and the text box and tooltip will only be updated for the final one of a series. + /// </summary> + /// <param name="value"></param> + private async void TargetBackTranslationTextChanged(string value) + { + // cancel any previous execution + cancellationTokenSource?.Cancel(); + + // Create a CancellationTokenSource to support cancellation + cancellationTokenSource = new CancellationTokenSource(); + var token = cancellationTokenSource.Token; + + backgroundTask = CreateBackgroundTask(value, token); + + try + { + var backgroundWorkerResult = await backgroundTask; - Application.DoEvents(); // this says we need to do this for when it won't display the change: https://social.msdn.microsoft.com/Forums/vstudio/en-US/983d2e3b-9bcb-4c9c-9e85-59f8b2051b3e/program-updating-a-textbox-does-not-work?forum=csharpgeneral + if ((backgroundTask.Status == TaskStatus.RanToCompletion) && (backgroundWorkerResult != null)) + { + textBoxStatus.Text = backgroundWorkerResult?.TextBoxText; + textBoxStatus.Tag = backgroundWorkerResult?.TextBoxTag; + toolTip.SetToolTip(textBoxStatus, backgroundWorkerResult?.TextBoxTooltip); + } + } + catch (Exception ex) + { + LogExceptionMessage("TargetBackTranslationTextChanged", ex); + } + } + + private Task<BackgroundWorkerResult> CreateBackgroundTask(string value, CancellationToken cancelToken) + { + return Task.Factory.StartNew<BackgroundWorkerResult>(() => + { + try + { + Task.Delay(TimeSpan.FromMilliseconds(1000), cancelToken).Wait(); + cancelToken.ThrowIfCancellationRequested(); + + var translatedLines = GetTranslatedLines(value); + var translatedCount = translatedLines.Count; + System.Diagnostics.Debug.WriteLine($"PtxBTH: TargetBackTranslationTextChanged: cancelToken: {cancelToken.IsCancellationRequested}, SourceDataLineCount = '{SourceDataLineCount}', translatedCount = '{translatedCount}'"); + var statusText = String.Empty; + if (SourceDataLineCount != translatedCount) + { + statusText = String.Format("There {0} currently {1} line{2} of text in the Target Translation box vs. {3} text line{4} in the source verse ({5}: {6}). Click (or hover your cursor here) to see the correspondence.", + (translatedCount > 1) ? "are" : "is", + translatedCount, + (translatedCount > 1) ? "s" : string.Empty, + SourceDataLineCount, + (SourceDataLineCount > 1) ? "s" : string.Empty, + (TextTokenMarkersSource.CountTextTokenMarkers > 1) ? "one for each of these markers" : "for this marker", + String.Join(",", TextTokenMarkersSource.Where(m => !m.IsParagraphMarkerWithoutText).Select(m => $"\\{m.USFMMarkerToken.Marker}"))); + } + + var preview = GetPreview(translatedLines, cancelToken); + var result = new BackgroundWorkerResult + { + TextBoxText = statusText, + TextBoxTag = translatedLines, + TextBoxTooltip = preview + }; + return result; + } + catch (AggregateException ex) + { + if ((ex.InnerExceptions.Count == 1) && (ex.InnerException is TaskCanceledException)) + System.Diagnostics.Debug.WriteLine("CreateBackgroundTask: canceled task"); + else + LogExceptionMessage("CreateBackgroundTask", ex); + } + catch (Exception ex) + { + LogExceptionMessage("CreateBackgroundTask", ex); + } + return null; + }, cancelToken); } private static string GetFrameText(IProject projectSource, IProject projectTarget, IVerseRef versesReference) @@ -196,11 +408,91 @@ private void Host_VerseRefChanged(IPluginHost sender, IVerseRef newReference, Sy private void TextBoxStatus_Click(object sender, System.EventArgs e) { - if (textBoxStatus.Tag != null) + if (textBoxStatus.Tag == null) + return; + + if (textBoxStatus.Tag is IVerseRef newReference) { - backTranslationHelperCtrl.IsModified = false; - var newReference = (IVerseRef)textBoxStatus.Tag; + // allow the user to decide whether to overwrite the edits (but only if he's back on the same verse we paused on. If not, then + // we have to update) + var hasVerseChanged = newReference?.ToString() != _verseReference?.ToString(); + var overwriteEdits = hasVerseChanged || + (MessageBox.Show("Would you like to keep the edited text here (click, 'Yes'), or refresh the target text from Paratext (click, 'No')?", + ParatextBackTranslationHelperPlugin.PluginName, MessageBoxButtons.YesNo) == DialogResult.No); + if (overwriteEdits) + backTranslationHelperCtrl.IsModified = false; // putting this before GetNewReference causes us to refresh the editable box also + GetNewReference(newReference); + + // if we didn't do it above, reset it to be not modified here (unless the verse didn’t change), + // so it's the new beginning text and more easily overwritable. But if the verse didn't change + // then we don't want to mark it as not modified or a subsequent clicking around in Ptx could clobber it. + if (hasVerseChanged && !overwriteEdits) + backTranslationHelperCtrl.IsModified = false; + + textBoxStatus.Clear(); + textBoxStatus.Tag = null; + backTranslationHelperCtrl.Focus(); // so it doesn’t leave the cursor in the status textBox + } + else if ((textBoxStatus.Tag is List<string> textLines) && (TextTokenMarkersSource != null) && TextTokenMarkersSource.Any()) + { + var preview = GetPreview(textLines); + MessageBox.Show(preview, ParatextBackTranslationHelperPlugin.PluginName); + backTranslationHelperCtrl.Focus(); // so it doesn’t leave the cursor in the status textBox + } + } + + private static readonly List<string> _previewInlineMarkersToIgnore = Properties.Settings.Default.GetPreviewInlineMarkersToIgnore.Cast<string>().ToList(); + + private string GetPreview(List<string> textLines, CancellationToken? cancelToken = null) + { + string preview = null; + var translatedLineCount = textLines.Count; + var markerCount = TextTokenMarkersSource.Count; + string lastNonInlineMarker = _processingQs ? @"\q1" : @"\p"; // occasionally correct... see note where _processingQs is defined + int i = 0, j = 0; + for (; i < markerCount; i++) + { + cancelToken?.ThrowIfCancellationRequested(); + var line = (translatedLineCount > j) ? textLines[j++] : String.Empty; + bool isNoText = !String.IsNullOrEmpty(line.Trim()); + var token = TextTokenMarkersSource[i]; + var nextToken = (TextTokenMarkersSource.Count > i + 1) ? TextTokenMarkersSource[i + 1] : null; + var tokenText = token.ToString(); // .Replace(Environment.NewLine, null); + bool isInLine = IsInline(token.USFMMarkerToken); + + if (token.IsParagraphMarkerWithoutText) + { + // write out '\p's and '\m's if they're followed by some inline marker, but don't write the empty text segment + lastNonInlineMarker = tokenText.Replace(Environment.NewLine, null); + preview += $"{tokenText} "; + j--; // since we're not going past the current text one + continue; + } + if (tokenText.Contains("*")) + { + if (isNoText) + tokenText = $"{Environment.NewLine}({lastNonInlineMarker} cont)"; + else + continue; + } + else if (!isInLine) + lastNonInlineMarker = tokenText.Replace(Environment.NewLine, null); + + var suffix = isInLine ? " " : String.Empty; // Environment.NewLine; + preview += $"{tokenText} {line}{suffix}"; + } + + while (translatedLineCount > i) + preview += $"(adding as new \\p) {textLines[i++]}{Environment.NewLine}"; + return preview; + + static bool IsInline(IUSFMMarkerToken token) + { + return (token.IsFootnoteOrCrossReference || + token.IsMetadata || + !String.IsNullOrEmpty(token.EndMarker) || // e.g. \rq ... \rq* + _previewInlineMarkersToIgnore.Any(s => token.ToString().Contains(s))); // e.g. \va that comes immediately after initial post-\p \v } } @@ -218,13 +510,7 @@ private void GetNewReference(IVerseRef newReference) } catch (Exception ex) { - var error = ex.Message; - while (ex.InnerException != null) - { - error += Environment.NewLine + Environment.NewLine + ex.InnerException.Message; - ex = ex.InnerException; - } - + var error = LogExceptionMessage("GetNewReference", ex); MessageBox.Show(error, ParatextBackTranslationHelperPlugin.PluginName); } finally @@ -233,11 +519,27 @@ private void GetNewReference(IVerseRef newReference) } } + public static string LogExceptionMessage(string className, Exception ex) + { + string msg = "Error occurred: " + ex.Message; + while (ex.InnerException != null) + { + ex = ex.InnerException; + msg += $"{Environment.NewLine}because: (InnerException): {ex.Message}"; + } + + Util.DebugWriteLine(className, msg); + return msg; + } + private void UpdateData(BackTranslationHelperModel model) { Text = GetFrameText(_projectSource, _projectTarget, _versesReference); _model = model; - backTranslationHelperCtrl.Initialize(true); + var bookNum = _verseReference.BookNum; + var chapterNum = _verseReference.ChapterNum; + _model.IsTargetTranslationEditable = _projectTarget.CanEdit(_plugin, bookNum, chapterNum); + backTranslationHelperCtrl.Initialize(_model); _updateControls(_model); } @@ -267,18 +569,32 @@ BackTranslationHelperModel IBackTranslationHelperDataSource.Model get { var currentTargetData = CurrentTargetData; + var (sourceData, sourceDataAlternate) = CurrentSourceData; var model = new BackTranslationHelperModel { - SourceData = CurrentSourceData ?? "<source data empty>", + SourceData = sourceData ?? "<source data empty>", + SourceDataAlternate = sourceDataAlternate, TargetData = currentTargetData, TargetDataPreExisting = currentTargetData, - TargetsPossible = new List<TargetPossible>() + TargetsPossible = new List<TargetPossible>(), + DisplayExistingTargetTranslation = true, }; return model; } } - private string CurrentSourceData + /// <summary> + /// This field returns one or two flavors of the source data. For Paratext, the 'sourceData' + /// return value represents the segments of scripture text in a marker, which could be a whole + /// paragraph (e.g. after a \v marker and before another paragraph-breaking marker), or just a + /// portion of text (e.g. after a \v marker and before an inline, say, footnote marker, which + /// interrupts the full paragraph). The user may want to translate the entire paragraph as a + /// unit to get a better translation rather than shorter snippets of text, in which case, they + /// can check the translateNothingButPublishableScriptureTextMenuItem menu and we will combine + /// all scripture text together, followed separately by all footnote text to be converted, which + /// is returned in the sourceDataAlternate return. + /// </summary> + private (string sourceData, string sourceDataAlternate) CurrentSourceData { get { @@ -286,45 +602,133 @@ private string CurrentSourceData if (!UsfmTokensSource.TryGetValue(keyBookChapterVerse, out List<IUSFMToken> tokens)) { System.Diagnostics.Debug.WriteLine($"PtxBTH: Loading UsfmTokensSource for {keyBookChapterVerse}"); - tokens = _projectSource.GetUSFMTokens(_verseReference.BookNum, _verseReference.ChapterNum, _verseReference.VerseNum).ToList(); - UsfmTokensSource.Add(keyBookChapterVerse, tokens); + tokens = _projectSource.GetUSFMTokens(_verseReference.BookNum, _verseReference.ChapterNum, _verseReference.VerseNum)?.ToList(); + UsfmTokensSource[keyBookChapterVerse] = tokens; } else { System.Diagnostics.Debug.WriteLine($"PtxBTH: Already have UsfmTokensSource for {keyBookChapterVerse}"); } - var data = tokens.OfType<IUSFMTextToken>() - .Where(t => IsPublishableVernacular(t, tokens) && IsMatchingVerse(t.VerseRef, _verseReference)) - .ToDictionary(ta => ta, ta => ta.VerseRef); + var data = tokens?.OfType<IUSFMTextToken>() + .Where(t => IsPublishableVernacular(t, tokens) && IsMatchingVerse(t.VerseRef, _verseReference)) + .ToDictionary(ta => ta, ta => ta.VerseRef); - if (!data.Any()) - return null; + if ((data == null) || !data.Any()) + return (null, null); - TextTokenMarkersSource = GetTextTokenMarkers(tokens, data.Keys.ToList()); + TextTokenMarkersSource = TextTokenMarkers.GetTextTokenMarkers(tokens, data.Keys.ToList()); var textValues = data.Select(t => t.Key.Text); SourceDataLineCount = textValues.Count(); - var sourceString = string.Join(Environment.NewLine, textValues); + // if the user is requesting, grab all the scripture text first and then the footnotes, as separate + // stuff to translate (not interspersed, so as not to break up the translatable chunks) + var sourceStringAlternate = GetSourceAlternate(tokens, data.Keys.ToList()); + // set the verse reference to the last of a combined set of verses (which we can only get from the USFM markers) _versesReference = data.Values.First(); _verseReferenceLast = (_versesReference.RepresentsMultipleVerses) ? _versesReference.AllVerses.Last() : _verseReference; - return sourceString; + return (sourceString, sourceStringAlternate); + } + } + + // when generating the 'alternate' source translation (i.e. ignoring, or rather, moving inline markers w/ text to the end), + // treat the \q1-4 markers special, so their text segments get combined even though they're in different paragraphs (leads to better translation). + // NB: BUT there is one glitch: if a \q1 paragraph marker is immediately followed by a \v marker, then technically, + // the \q1 is in the preceding verse reference; not this one. So though we'd want to say that we're 'processingQs' in this case, + // we can't, so the text on that line will be translated separately from the \q2, etc., that follows it. + // By making this a global member, it will remember going from verse-to-verse. But one place this would not work: + // if the user processes a verse that ends with a \q1-4 marker, but rather than clicking 'Next', goes to some other, non-sequential verse, + // we'd be mistaken that we're processingQs... (but since this is just a preview and not something substantive, let's just ignore this + // hopefully unusual case. + private bool _processingQs = false; + + private string GetSourceAlternate(List<IUSFMToken> tokens, List<IUSFMTextToken> textTokens) + { + string sourceStringAlternate = null; + if (translateNothingButPublishableScriptureTextMenuItem.Checked) + { + string textValuesAlternate = null; + List<string> textValuesAlternateFootnotes = new(); + foreach (var token in tokens) + { + // if the token is a paragraph break token (\i.e. \p and \q{digit}), then put a new line in the running text + if (IsParagraphToken(token)) + { + // but not for \q1-\q4, bkz we want those to be combined into a single run of text + _processingQs = (token is IUSFMMarkerToken markerToken) && (markerToken.Marker.Contains("q")); + if (!_processingQs) + { + textValuesAlternate += Environment.NewLine + Environment.NewLine; // use 2 so it's more visible (since we're removing the 'va' and 'vp' verse numbering) + continue; + } + } + + // if it's not something we want to translate (e.g. not a text marker or a va or vp verse numbers (which are text markers))... + if (!textTokens.Contains(token) || + (AsTextToken(token, out IUSFMTextToken textToken) && !IsTranslatable(textToken, tokens))) + continue; // skip it + + // if it's scripture text (i.e. the translatable stuff)... + if (IsScriptureText(textToken)) + { + textValuesAlternate += textToken.Text; // add it to the running accumulation + } + else + { + // must be a footnote + textValuesAlternateFootnotes.Add(textToken.Text); + } + } + + // combine the text fragments of inline markers too, but add them after the main, regular text of the verse, + // so they don't interfere with the translation of the main text + sourceStringAlternate = textValuesAlternateFootnotes.Aggregate(textValuesAlternate.Replace(" ", " ") + Environment.NewLine, + (curr, next) => curr + Environment.NewLine + next); + } + + return sourceStringAlternate; + + static bool AsTextToken(IUSFMToken token, out IUSFMTextToken textToken) + { + if (token is IUSFMTextToken) + { + textToken = token as IUSFMTextToken; + return true; + } + textToken = null; + return false; } } + private static readonly List<string> _additionalMarkersToTranslate = Properties.Settings.Default.AdditionalMarkersToTranslate.Cast<string>().ToList(); + + // this would return true for both regular scripture text (i.e. text after any of these markers: + // \v, \q[1-3], \m, \pc, etc) and footnote text that is translatable (i.e. \ft) + private static bool IsTranslatable(IUSFMTextToken token, List<IUSFMToken> tokens) + { + PreviousToken(token, tokens, out IUSFMMarkerToken mt); + return (IsScriptureText(token) && (mt.Marker != "va")) || + _additionalMarkersToTranslate.Contains(mt.Marker); + } + + private static bool IsScriptureText(IUSFMTextToken token) + { + return (token.IsPublishableVernacular && token.IsScripture); + } + // normally, text tokens are publishable, but there are some that aren't (e.g. the text content of an \id marker). // And there's one case that seems like a bug to me, but which I've been told has worked that way forever and so // there's no changing it now... vis-a-vis: // the \va...\va* inline marker is defined differently depending on whether it comes immediately after a \v [num(s)] // marker than if it comes elsewhere in a verse. The relevant difference is that when it comes immediately after a \v // marker, it's value for IsPublishableVernacular (false) and IsMetadata (true) are opposite from the other case. - // So... if IsPubliableVernacular is false, at least check if this is that case, and return true, so we'll try to + // So... if IsPublishableVernacular is false, at least check if this is that case, and return true, so we'll try to // translate it as the others are (bkz we only send IsPub text segments for translation) private static bool IsPublishableVernacular(IUSFMTextToken t, List<IUSFMToken> tokens) { @@ -345,35 +749,60 @@ private static bool PreviousToken(IUSFMTextToken t, List<IUSFMToken> tokens, out return false; } - private List<IUSFMMarkerToken> GetTextTokenMarkers(List<IUSFMToken> tokens, List<IUSFMTextToken> textTokens) + public class TextMarkerToken { - IUSFMMarkerToken lastMarkerToken = null; - var textTokenMarkers = new List<IUSFMMarkerToken>(); - foreach (var token in tokens) + public IUSFMMarkerToken USFMMarkerToken { get; set; } + + public bool IsParagraphMarkerWithoutText { get; set; } + + public TextMarkerToken(IUSFMMarkerToken iUsfmMarkerToken, bool isParagraphMarkerWithoutText) { - if (token is IUSFMMarkerToken) - { - lastMarkerToken = token as IUSFMMarkerToken; - } - else if (textTokens.Contains(token) && (lastMarkerToken != null)) + USFMMarkerToken = iUsfmMarkerToken; + IsParagraphMarkerWithoutText = isParagraphMarkerWithoutText; + } + + public override string ToString() + { + return USFMMarkerToken.ToString(); + } + } + + public class TextTokenMarkers : List<TextMarkerToken> + { + public int CountTextTokenMarkers + { + get { return this.Count(i => !i.IsParagraphMarkerWithoutText); } + } + + public static TextTokenMarkers GetTextTokenMarkers(List<IUSFMToken> tokens, List<IUSFMTextToken> textTokens) + { + IUSFMMarkerToken lastMarkerToken = null; + var textTokenMarkers = new TextTokenMarkers(); + foreach (var token in tokens) { - textTokenMarkers.Add(lastMarkerToken); + if (token is IUSFMMarkerToken) + { + if (IsParagraphToken(lastMarkerToken)) + { + textTokenMarkers.Add(new TextMarkerToken(lastMarkerToken, true)); + lastMarkerToken = null; + } + lastMarkerToken = token as IUSFMMarkerToken; + } + else if (textTokens.Contains(token) && (lastMarkerToken != null)) + { + textTokenMarkers.Add(new TextMarkerToken(lastMarkerToken, false)); + lastMarkerToken = null; + } } + return textTokenMarkers; } - return textTokenMarkers; } private string CurrentTargetData { get { - _writeLock = _projectTarget.RequestWriteLock(_plugin, ReleaseRequested, _verseReference.BookNum, _verseReference.ChapterNum); - if (_writeLock == null) - { - // if this fails to return something, it means we can't edit it - MessageBox.Show($"You don't have edit privilege on this chapter: {_verseReference}"); - } - var bookChapterKey = GetBookChapterKey(_verseReference); if (!UsfmTokensTarget.TryGetValue(bookChapterKey, out SortedDictionary<string, List<IUSFMToken>> vrefTokens)) { @@ -382,7 +811,7 @@ private string CurrentTargetData var dict = chapterTokens.GroupBy(t => t.VerseRef, t => t, (key, g) => new { VerseRef = key, USFMTokens = g.ToList() }) .ToDictionary(t => GetBookChapterVerseRangeKey(t.VerseRef), t => t.USFMTokens); vrefTokens = new SortedDictionary<string, List<IUSFMToken>>(dict); - UsfmTokensTarget.Add(bookChapterKey, vrefTokens); + UsfmTokensTarget[bookChapterKey] = vrefTokens; } else { @@ -535,7 +964,16 @@ bool IBackTranslationHelperDataSource.WriteToTarget(string text) } AreWeChangingTheTarget = true; - _writeLock ??= _projectTarget.RequestWriteLock(_plugin, ReleaseRequested, _verseReference.BookNum, _verseReference.ChapterNum); + if (_writeLock == null) + { + _writeLock = _projectTarget.RequestWriteLock(_plugin, ReleaseRequested, _verseReference.BookNum, _verseReference.ChapterNum); + + if (_writeLock == null) // if it still is, we should warn the user that it isn't going to work + { + MessageBox.Show($"You don't have edit privilege on this chapter: {_verseReference}"); + return false; + } + } var tokens = vrefTokensTarget.SelectMany(d => d.Value).ToList(); @@ -545,7 +983,8 @@ bool IBackTranslationHelperDataSource.WriteToTarget(string text) } catch (Exception ex) { - MessageBox.Show($"Exception caught:\n{ex.Message}"); + var error = LogExceptionMessage("WriteToTarget", ex); + MessageBox.Show($"Exception caught:\n{error}"); } finally { @@ -628,10 +1067,7 @@ public static SortedDictionary<string, List<IUSFMToken>> CalculateTargetTokens(I var matchingTokensInTarget = vrefTokensTarget.Where(kvp => kvp.Value.Any(t => IsMatchingVerse(t.VerseRef, verseReference))).ToList(); matchingTokensInTarget.ForEach(kvp => vrefTokensTarget.Remove(kvp.Key)); - if (vrefTokensTarget.ContainsKey(keyBookChapterVerses)) - vrefTokensTarget[keyBookChapterVerses] = tokensSource; - else - vrefTokensTarget.Add(keyBookChapterVerses, tokensSource); + vrefTokensTarget[keyBookChapterVerses] = tokensSource; // go thru all the ones we had and put the translated text into the text ones and transfer the non-text ones in order into the list to Put var i = 0; @@ -698,29 +1134,11 @@ private static string ToJson(object obj) } #endif - public static IUSFMToken ParagraphToken(Dictionary<string, List<IUSFMToken>> usfmTokensSource, - Dictionary<string, SortedDictionary<string, List<IUSFMToken>>> usfmTokensTarget, TextToken previousTextToken) - { - // see if we can find a list that has one (check the source first, since target is likely to be lacking) - var tokens = usfmTokensSource.Values.FirstOrDefault(l => l.Any(t => IsParagraphToken(t))) ?? - usfmTokensTarget.Values.SelectMany(d => d.Values) - .FirstOrDefault(l => l.Any(t => IsParagraphToken(t))); - - var paragraphToken = (IUSFMMarkerToken)tokens?.FirstOrDefault(t => IsParagraphToken(t)) ?? - new MarkerToken(previousTextToken.VerseRef, true, true, previousTextToken.VerseOffset + previousTextToken.Text.Length) - { - Type = MarkerType.Paragraph, - Marker = "p" - }; - - return new MarkerToken(paragraphToken, previousTextToken.VerseOffset + previousTextToken.Text.Length, previousTextToken.VerseRef); - } - private static readonly List<string> _paragraphMarkers = new() { "p", "m" }; private static bool IsParagraphToken(IUSFMToken token) { - return (token is IUSFMMarkerToken markerToken) && (markerToken.Type == MarkerType.Paragraph) && _paragraphMarkers.Contains(markerToken.Marker); + return (token is IUSFMMarkerToken markerToken) && (markerToken.Type == MarkerType.Paragraph); // not needed? if so, initialize list from a setting: && _paragraphMarkers.Contains(markerToken.Marker); } protected override void OnShown(EventArgs e) @@ -754,7 +1172,13 @@ private void BackTranslationHelperForm_FormClosing(object sender, FormClosingEve Properties.Settings.Default.DefaultWindowState = WindowState; Properties.Settings.Default.WindowLocation = Location; - Properties.Settings.Default.WindowSize = Size; + + // someone had it disappear except for the frame... probably bkz Size was 0,0 somehow at this point + if (Size.Height >= MinimumSize.Height && + Size.Width >= MinimumSize.Width) + { + Properties.Settings.Default.WindowSize = Size; + } Properties.Settings.Default.Save(); _host.VerseRefChanged -= Host_VerseRefChanged; @@ -808,5 +1232,16 @@ private void BackTranslationHelperForm_Activated(object sender, EventArgs e) GetNewReference(_verseReference); } + + public class BackgroundWorkerResult + { + public string TextBoxText { get; set; } + public List<string> TextBoxTag { get; set; } + public string TextBoxTooltip { get; set; } + public override string ToString() + { + return $"Text: {TextBoxText}, Tag: {String.Join(",", TextBoxTag)}, Tooltip: {TextBoxTooltip}"; + } + } } } diff --git a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.resx b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.resx index 1af7de1..8766f29 100644 --- a/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.resx +++ b/src/ParatextPluginBackTranslationHelper/BackTranslationHelperForm.resx @@ -117,4 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/ParatextBackTranslationHelperPlugin.cs b/src/ParatextPluginBackTranslationHelper/ParatextBackTranslationHelperPlugin.cs index 114b6fd..86279a7 100644 --- a/src/ParatextPluginBackTranslationHelper/ParatextBackTranslationHelperPlugin.cs +++ b/src/ParatextPluginBackTranslationHelper/ParatextBackTranslationHelperPlugin.cs @@ -113,16 +113,10 @@ public string GetDescription(string locale) /// </summary> private static void Run(IPluginHost host, IParatextChildState state) { -#if true Application.EnableVisualStyles(); _host = host; _state = state; - InitializeProjects(host, ref _projectNameParent, ref _projectNameDaughter); - - if ((_projectNameParent == null) || (_projectNameDaughter == null)) - throw new ApplicationException($"Source ('{_projectNameParent}') or Target ('{_projectNameDaughter}') project not selected. Can't continue!"); - _host.Log(_this, "Starting " + PluginName); var initialVerseReference = state.VerseRef; @@ -132,349 +126,8 @@ private static void Run(IPluginHost host, IParatextChildState state) _host.SetReferenceForSyncGroup(verseReference, state.SyncReferenceGroup); }; - var formToShow = _mainWindow = new BackTranslationHelperForm(_host, _this, syncReferenceGroup, initialVerseReference, - _projectNameParent, _projectNameDaughter, _projectNameParent.Language, _projectNameDaughter.Language); + var formToShow = _mainWindow = new BackTranslationHelperForm(_host, _this, syncReferenceGroup, initialVerseReference); formToShow.Show(); -#else - lock (_this) - { - if (_host != null) - { - // This should never happen, but just in case Host does something wrong... - host.Log(_this, "Run called more than once!"); - return; - } - } - - try - { - Application.EnableVisualStyles(); - - _host = host; - _state = state; - - InitializeProjects(host, ref _projectNameParent, ref _projectNameDaughter); - - if ((_projectNameParent == null) || (_projectNameDaughter == null)) - throw new ApplicationException($"Source ('{_projectNameParent}') or Target ('{_projectNameDaughter}') project not selected. Can't continue!"); - -#if DEBUG - MessageBox.Show("Attach debugger now (if you want to)", pluginName); -#endif - _host.Log(_this, "Starting " + pluginName); - - string preferredUiLocale = "en"; - try - { - preferredUiLocale = _host.UserSettings.UiLocale; - if (String.IsNullOrWhiteSpace(preferredUiLocale)) - preferredUiLocale = "en"; - } - catch (Exception) - { - } - - // SetUpLocalization(preferredUiLocale); - - var initialVerseReference = state.VerseRef; - - Action<IVerseRef> syncReferenceGroup = verseReference => - { - _host.SetReferenceForSyncGroup(verseReference, state.SyncReferenceGroup); - }; - - var mainUIThread = new Thread(() => - { - // InitializeErrorHandling(); - -#if UseWebForm // can be used to switch to using a web-browser based display (if your OS doesn't support WinForm controls) - BackTranslationHelperWebForm formToShow; -#else - BackTranslationHelperForm formToShow; -#endif - lock (_this) - { - // KeyboardController.Initialize(); - - Action<bool> activateKeyboard = vern => - { - if (vern) - { - try - { - host.ActiveWindowState?.Project?.VernacularKeyboard?.Activate(); - } - catch (ApplicationException e) - { - // For some reason, the very first time this gets called it throws a COM exception, wrapped as - // an ApplicationException. Mysteriously, it seems to work just fine anyway, and then all subsequent - // calls work with no exception. Paratext seems to make this same call without any exceptions. The - // documentation for ITfInputProcessorProfiles.ChangeCurrentLanguage (which is the method call - // in SIL.Windows.Forms.Keyboarding.Windows that throws the COM exception says that an E_FAIL is an - // unspecified error, so that's fairly helpful. - if (!(e.InnerException is COMException)) - throw; - } - } - else - host.DefaultKeyboard?.Activate(); - }; - - //var fileAccessor = new ParatextDataFileAccessor(fileId => _host.GetPlugInData(_this, m_projectName, fileId), - // (fileId, reader) => _host.PutPlugInData(_this, m_projectName, fileId, reader), - // fileId => _host.GetPlugInDataLastModifiedTime(_this, m_projectName, fileId)); - - //bool fEnableDragDrop = true; - //try - //{ - // string dragDropSetting = _host.GetApplicationSetting("EnableDragAndDrop"); - // if (dragDropSetting != null) - // fEnableDragDrop = bool.Parse(dragDropSetting); - //} - //catch (Exception) - //{ - //} - - formToShow = _mainWindow = -#if UseWebForm // can be used to switch to using a web-browser based display (if your OS doesn't support WinForm controls) - new BackTranslationHelperWebForm -#else - new BackTranslationHelperForm -#endif - (_host, _this, state, syncReferenceGroup, initialVerseReference, _projectNameParent, - _projectNameDaughter, _projectNameParent.Language, _projectNameDaughter.Language); - } - -#if DEBUG - // Always track if this is a debug build, but track to a different segment.io project - const bool allowTracking = true; - const string key = "0mtsix4obm"; -#else - // If this is a release build, then allow an environment variable to be set to false - // so that testers aren't generating false analytics - string feedbackSetting = Environment.GetEnvironmentVariable("FEEDBACK"); - - var allowTracking = string.IsNullOrEmpty(feedbackSetting) || feedbackSetting.ToLower() == "yes" || feedbackSetting.ToLower() == "true"; - - const string key = "3iuv313n8t"; -#endif -#if false - using (new Analytics(key, GetUserInfo(_host.UserInfo), allowTracking)) - { - Analytics.Track("Startup", new Dictionary<string, string> - {{"Specific version", Assembly.GetExecutingAssembly().GetName().Version.ToString()}}); - - formToShow.ShowDialog(); - } -#else - formToShow.ShowDialog(); -#endif - _host.Log(_this, "Closing " + pluginName); - Environment.Exit(0); - }); - mainUIThread.Name = pluginName; - mainUIThread.IsBackground = false; - mainUIThread.SetApartmentState(ApartmentState.STA); - mainUIThread.Start(); - // Avoid putting any code after this line. Any exceptions thrown will not be able to be reported via the - // "green screen" because we are not running in STA. - } - catch (Exception e) - { - MessageBox.Show(string.Format("General.ErrorStarting: Error occurred attempting to start {0}: ", - "Param is \"ParatextBackTranslationHelper\" (plugin name)"), pluginName + e.Message); - _host = null; // so we can be called again, but not twice (i.e. two dialogs) - // not sure why we'd want to throw... - // throw; - } -#endif - } - - private static void LoadEncConverterClassesFromLocalFolder(string asdg) - { - Assembly asm = null; - Type[] types = null; - string pathToPluginFolder = null; - try - { - pathToPluginFolder = Assembly.GetExecutingAssembly().Location; - pathToPluginFolder = Path.Combine(Path.GetDirectoryName(pathToPluginFolder), asdg); - asm = Assembly.LoadFrom(pathToPluginFolder); - types = asm.GetTypes(); - - foreach (var type in types) - { - try - { - Activator.CreateInstance(type); - } - catch // ignore errors - { - } - } - } - catch (Exception ex) - { - var msg = $"Unable to load add-in assembly: {Path.GetFileNameWithoutExtension(pathToPluginFolder)}: {ex.Message}"; - - _host.Log(_this, msg); - } - } - - private static void InitializeProjects(IPluginHost host, ref IProject projectNameSource, ref IProject projectNameTarget) - { - var projects = host.GetAllProjects(); - var selectedProject = host.ActiveWindowState?.Project; - - // if the user selects the daughter/target project, let's assume that's the intended target from it's base project - if ((selectedProject != null) && (selectedProject.BaseProject != null)) - { - projectNameSource = projects.FirstOrDefault(p => p.ShortName == selectedProject.BaseProject.ShortName); - projectNameTarget = projects.FirstOrDefault(p => p.ShortName == selectedProject.ShortName); - } - else - { - // otherwise, make them choose - projectNameSource = QueryForProject("Source"); - projectNameTarget = QueryForProject("Target"); - } - } - - private static IProject QueryForProject(string projectType) - { - var projects = _host.GetAllProjects(); - var dlg = new ProjectListForm(projects, projectType); - if (dlg.ShowDialog() == DialogResult.OK) - { - return projects.FirstOrDefault(p => p.ShortName == dlg.SelectedDisplayName); - } - - return null; - } - - /* - public static bool InvokeOnMainWindowIfNotNull(Action action) - { - lock (_this) - { - if (_mainWindow != null) - { - if (_mainWindow.InvokeRequired) - _mainWindow.Invoke(action); - else - action(); - return true; - } - } - return false; - } - */ - - //public void RequestShutdown() - //{ - // lock (this) - // { - // if (_mainWindow != null) - // { - // InvokeOnUiThread(delegate - // { - // _mainWindow.Activate(); - // _mainWindow.Close(); - // }); - // } - // else - // Environment.Exit(0); - // } - //} - - /* - public void Activate(string activeProjectName) - { - if (_mainWindow != null) - { - lock (this) - { - InvokeOnUiThread(delegate { _mainWindow.Activate(); }); - } - } - else - { - // Can't lock because the whole start-up sequence takes several seconds and the - // whole point of this code is to activate the splash screen so the user can see - // it's still starting up. But there is no harm in calling Activate on the splash - // screen if we happen to catch it between the time it is closed and the member - // variable is set to null, since in that case, the "real" splash screen is closed - // and Activate is a no-op. But we do need to use a temp variable because it could - // get set to null between the time we check for null and the call to Activate. - var _splashScreen = new SplashScreenForm(); - _splashScreen.Show(); - Application.DoEvents(); - } - } - - private static UserInfo GetUserInfo(IUserInfo userInfo) - { - string lastName = userInfo.Name; - string firstName = ""; - if (lastName != null) - { - var split = lastName.LastIndexOf(" ", StringComparison.Ordinal); - if (split <= 0) - split = lastName.LastIndexOf("_", StringComparison.Ordinal); - if (split > 0) - { - firstName = lastName.Substring(0, split); - lastName = lastName.Substring(split + 1); - } - } - - return new UserInfo { FirstName = firstName, LastName = lastName, UILanguageCode = "en" }; - } - - private void InvokeOnUiThread(Action action) - { - lock (this) - { - if (_mainWindow.InvokeRequired) - _mainWindow.Invoke(action); // _mainWindow is the thread my dialog was created/run on - else - action(); - } - } - */ - - /* - private static void InitializeErrorHandling() - { - ErrorReport.SetErrorReporter(new WinFormsErrorReporter()); - ErrorReport.EmailAddress = emailAddress; - ErrorReport.AddStandardProperties(); - // The version that gets added to the report by default is for the entry assembly, which is - // AddInProcess32.exe. Even if if reported a version (which it doesn't), it wouldn't be very - // useful. - ErrorReport.AddProperty("Plugin Name", pluginName); - Assembly assembly = Assembly.GetExecutingAssembly(); - ErrorReport.AddProperty("Version", string.Format("{0} (apparent build date: {1})", - assembly.GetName().Version, - File.GetLastWriteTime(assembly.Location).ToShortDateString())); - ErrorReport.AddProperty("Host Application", _host.ApplicationName + " " + _host.ApplicationVersion); - ErrorReport.AddProperty("Source Project Name", _projectNameParent.ShortName); - ErrorReport.AddProperty("Target Project Name", _projectNameDaughter.ShortName); - ExceptionHandler.Init(new WinFormsExceptionHandler()); - } - - private static void SetUpLocalization(string desiredUiLangId) - { - var assembly = Assembly.GetExecutingAssembly(); - var attributes = assembly.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - var company = attributes.Length == 0 ? "SIL" : ((AssemblyCompanyAttribute)attributes[0]).Company; - var installedStringFileFolder = FileLocationUtilities.GetDirectoryDistributedWithApplication("localization"); - var relativeSettingPathForLocalizationFolder = Path.Combine(company, pluginName); - var version = assembly.GetName().Version.ToString(); - LocalizationManager.Create(TranslationMemory.XLiff, desiredUiLangId, pluginName, pluginName, version, - installedStringFileFolder, relativeSettingPathForLocalizationFolder, new Icon(FileLocationUtilities.GetFileDistributedWithApplication("TXL no TXL.ico")), emailAddress, - "SIL.Transcelerator", "SIL.Utils"); } - */ } } diff --git a/src/ParatextPluginBackTranslationHelper/ParatextPluginBackTranslationHelper.csproj b/src/ParatextPluginBackTranslationHelper/ParatextPluginBackTranslationHelper.csproj index 7138e77..57b1f8a 100644 --- a/src/ParatextPluginBackTranslationHelper/ParatextPluginBackTranslationHelper.csproj +++ b/src/ParatextPluginBackTranslationHelper/ParatextPluginBackTranslationHelper.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> @@ -227,6 +227,6 @@ ren "%25ParatextInstallDir%25\plugins\$(ProjectName)\$(TargetFileName)" "$(Proje <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/Properties/Settings.Designer.cs b/src/ParatextPluginBackTranslationHelper/Properties/Settings.Designer.cs index e9592f5..4af34e0 100644 --- a/src/ParatextPluginBackTranslationHelper/Properties/Settings.Designer.cs +++ b/src/ParatextPluginBackTranslationHelper/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SIL.ParatextBackTranslationHelperPlugin.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -58,5 +58,74 @@ public static Settings Default { this["WindowSize"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool TranslateOnlyText { + get { + return ((bool)(this["TranslateOnlyText"])); + } + set { + this["TranslateOnlyText"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Collections.Specialized.StringCollection MapProjectNameToSourceProjectOverride { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["MapProjectNameToSourceProjectOverride"])); + } + set { + this["MapProjectNameToSourceProjectOverride"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<ArrayOfString xmlns:xsd=\"http://www.w3." + + "org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n <s" + + "tring>va</string>\r\n <string>vp</string>\r\n</ArrayOfString>")] + public global::System.Collections.Specialized.StringCollection GetPreviewInlineMarkersToIgnore { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["GetPreviewInlineMarkersToIgnore"])); + } + set { + this["GetPreviewInlineMarkersToIgnore"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute(@"<?xml version=""1.0"" encoding=""utf-16""?> +<ArrayOfString xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> + <string>fq</string> + <string>ft</string> + <string>fp</string> + <string>rq</string> + <string>s</string> + <string>ms1</string> +</ArrayOfString>")] + public global::System.Collections.Specialized.StringCollection AdditionalMarkersToTranslate { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["AdditionalMarkersToTranslate"])); + } + set { + this["AdditionalMarkersToTranslate"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool UpgradeSettings { + get { + return ((bool)(this["UpgradeSettings"])); + } + set { + this["UpgradeSettings"] = value; + } + } } } diff --git a/src/ParatextPluginBackTranslationHelper/Properties/Settings.settings b/src/ParatextPluginBackTranslationHelper/Properties/Settings.settings index 6abdd3d..c093f5e 100644 --- a/src/ParatextPluginBackTranslationHelper/Properties/Settings.settings +++ b/src/ParatextPluginBackTranslationHelper/Properties/Settings.settings @@ -11,5 +11,32 @@ <Setting Name="WindowSize" Type="System.Drawing.Size" Scope="User"> <Value Profile="(Default)">800, 450</Value> </Setting> + <Setting Name="TranslateOnlyText" Type="System.Boolean" Scope="User"> + <Value Profile="(Default)">False</Value> + </Setting> + <Setting Name="MapProjectNameToSourceProjectOverride" Type="System.Collections.Specialized.StringCollection" Scope="User"> + <Value Profile="(Default)" /> + </Setting> + <Setting Name="GetPreviewInlineMarkersToIgnore" Type="System.Collections.Specialized.StringCollection" Scope="User"> + <Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <string>va</string> + <string>vp</string> +</ArrayOfString></Value> + </Setting> + <Setting Name="AdditionalMarkersToTranslate" Type="System.Collections.Specialized.StringCollection" Scope="User"> + <Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <string>fq</string> + <string>ft</string> + <string>fp</string> + <string>rq</string> + <string>s</string> + <string>ms1</string> +</ArrayOfString></Value> + </Setting> + <Setting Name="UpgradeSettings" Type="System.Boolean" Scope="User"> + <Value Profile="(Default)">True</Value> + </Setting> </Settings> </SettingsFile> \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/app.config b/src/ParatextPluginBackTranslationHelper/app.config index e8acb2d..f9376ec 100644 --- a/src/ParatextPluginBackTranslationHelper/app.config +++ b/src/ParatextPluginBackTranslationHelper/app.config @@ -23,21 +23,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -59,21 +55,33 @@ <assemblyIdentity name="PluginInterfaces" publicKeyToken="583bede96b7c94a3" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.0.21.0" newVersion="2.0.21.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> @@ -88,6 +96,32 @@ <setting name="WindowSize" serializeAs="String"> <value>800, 450</value> </setting> + <setting name="TranslateOnlyText" serializeAs="String"> + <value>False</value> + </setting> + <setting name="GetPreviewInlineMarkersToIgnore" serializeAs="Xml"> + <value> + <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <string>va</string> + <string>vp</string> + </ArrayOfString> + </value> + </setting> + <setting name="AdditionalMarkersToTranslate" serializeAs="Xml"> + <value> + <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <string>fq</string> + <string>ft</string> + <string>fp</string> + <string>rq</string> + <string>s</string> + <string>ms1</string> + </ArrayOfString> + </value> + </setting> + <setting name="UpgradeSettings" serializeAs="String"> + <value>True</value> + </setting> </SIL.ParatextBackTranslationHelperPlugin.Properties.Settings> </userSettings> </configuration> \ No newline at end of file diff --git a/src/ParatextPluginBackTranslationHelper/packages.config b/src/ParatextPluginBackTranslationHelper/packages.config index b05064d..60f0d0f 100644 --- a/src/ParatextPluginBackTranslationHelper/packages.config +++ b/src/ParatextPluginBackTranslationHelper/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> <package id="Newtonsoft.Json" version="13.0.2" targetFramework="net48" /> <package id="ParatextEmbeddedUiPluginInterfaces" version="2.0.23" targetFramework="net48" /> <package id="ParatextPluginInterfaces" version="2.0.23" targetFramework="net48" /> diff --git a/src/SILConvertersInstaller/SILConvertersInstaller.vbproj b/src/SILConvertersInstaller/SILConvertersInstaller.vbproj index 5007b9e..374837f 100644 --- a/src/SILConvertersInstaller/SILConvertersInstaller.vbproj +++ b/src/SILConvertersInstaller/SILConvertersInstaller.vbproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <ProjectType>Local</ProjectType> <ProductVersion>9.0.30729</ProductVersion> @@ -244,6 +244,6 @@ xcopy /s /y "$(EcDistFilesPath)\redist\*.*" "$(SolutionDir)output\$(PlatformName <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersInstaller/packages.config b/src/SILConvertersInstaller/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersInstaller/packages.config +++ b/src/SILConvertersInstaller/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SILConvertersOffice/SILConvertersOffice.csproj b/src/SILConvertersOffice/SILConvertersOffice.csproj index 824a24d..f263401 100644 --- a/src/SILConvertersOffice/SILConvertersOffice.csproj +++ b/src/SILConvertersOffice/SILConvertersOffice.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -316,6 +316,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersOffice/TranslationHelperForm.cs b/src/SILConvertersOffice/TranslationHelperForm.cs index 4d5a790..cc96234 100644 --- a/src/SILConvertersOffice/TranslationHelperForm.cs +++ b/src/SILConvertersOffice/TranslationHelperForm.cs @@ -108,6 +108,8 @@ public FormButtons Show(FontConverter fontConverter, string sourceText, string t { new TargetPossible { TargetData = targetText, PossibleIndex = 0, TranslatorName = _theFontsAndEncConverter.DirectableEncConverter.Name } }, + DisplayExistingTargetTranslation = false, // the 'existing translation' *is* the source, so no need to repeat it in the existing target + IsTargetTranslationEditable = true, // I suppose this could be based on whether editing is enabled... }; // this form is the implementation of the way to get data @@ -115,7 +117,7 @@ public FormButtons Show(FontConverter fontConverter, string sourceText, string t if (!backTranslationHelperCtrl.TheTranslators.Any(t => t.Name == _theFontsAndEncConverter.DirectableEncConverter.GetEncConverter.Name)) backTranslationHelperCtrl.TheTranslators.Add(_theFontsAndEncConverter.DirectableEncConverter.GetEncConverter); - backTranslationHelperCtrl.Initialize(displayExistingTargetTranslation: false); + backTranslationHelperCtrl.Initialize(_model); // If Initialize sets the possible target boxes (more than the 1st one) to Visible, // for some reason, it's not changing its state... Try this: diff --git a/src/SILConvertersOffice/app.config b/src/SILConvertersOffice/app.config index 73978e0..c7a821a 100644 --- a/src/SILConvertersOffice/app.config +++ b/src/SILConvertersOffice/app.config @@ -23,21 +23,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -55,21 +51,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SILConvertersOffice/packages.config b/src/SILConvertersOffice/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersOffice/packages.config +++ b/src/SILConvertersOffice/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SILConvertersOffice07/SILConvertersOffice07.csproj b/src/SILConvertersOffice07/SILConvertersOffice07.csproj index 4c719dd..5c9cce5 100644 --- a/src/SILConvertersOffice07/SILConvertersOffice07.csproj +++ b/src/SILConvertersOffice07/SILConvertersOffice07.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -350,6 +350,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersOffice07/app.config b/src/SILConvertersOffice07/app.config index 4583899..3e09b35 100644 --- a/src/SILConvertersOffice07/app.config +++ b/src/SILConvertersOffice07/app.config @@ -23,21 +23,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -55,21 +51,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SILConvertersOffice07/packages.config b/src/SILConvertersOffice07/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersOffice07/packages.config +++ b/src/SILConvertersOffice07/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SILConvertersOffice10/SILConvertersOffice10.csproj b/src/SILConvertersOffice10/SILConvertersOffice10.csproj index 5abf4d8..86f79e3 100644 --- a/src/SILConvertersOffice10/SILConvertersOffice10.csproj +++ b/src/SILConvertersOffice10/SILConvertersOffice10.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -353,6 +353,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersOffice10/app.config b/src/SILConvertersOffice10/app.config index 7977aa4..6d9f439 100644 --- a/src/SILConvertersOffice10/app.config +++ b/src/SILConvertersOffice10/app.config @@ -23,21 +23,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -55,21 +51,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SILConvertersOffice10/packages.config b/src/SILConvertersOffice10/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersOffice10/packages.config +++ b/src/SILConvertersOffice10/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SILConvertersOffice13/SILConvertersOffice13.csproj b/src/SILConvertersOffice13/SILConvertersOffice13.csproj index a881a74..3596870 100644 --- a/src/SILConvertersOffice13/SILConvertersOffice13.csproj +++ b/src/SILConvertersOffice13/SILConvertersOffice13.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -358,6 +358,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersOffice13/app.config b/src/SILConvertersOffice13/app.config index e61e9a4..228d6e9 100644 --- a/src/SILConvertersOffice13/app.config +++ b/src/SILConvertersOffice13/app.config @@ -23,21 +23,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -55,21 +51,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SILConvertersOffice13/packages.config b/src/SILConvertersOffice13/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersOffice13/packages.config +++ b/src/SILConvertersOffice13/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SILConvertersWordML/SILConvertersWordML.csproj b/src/SILConvertersWordML/SILConvertersWordML.csproj index 355f410..05bcb8a 100644 --- a/src/SILConvertersWordML/SILConvertersWordML.csproj +++ b/src/SILConvertersWordML/SILConvertersWordML.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -248,6 +248,6 @@ <ErrorTextMissingPIA>This project references a Microsoft Office PIA file, which is required to be built against or it won't work for older versions of Word. The missing file needing to be restored is {0}.</ErrorTextMissingPIA> </PropertyGroup> <Error Condition="!Exists('..\SILConvertersOffice\DistFiles\Microsoft.Office.Interop.Word.dll')" Text="$([System.String]::Format('$(ErrorTextMissingPIA)', 'Microsoft.Office.Interop.Word, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c expected to be in ..\SILConvertersOffice\DistFiles\Microsoft.Office.Interop.Word.dll'))" /> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SILConvertersWordML/TestBwdc/TestBwdc.csproj b/src/SILConvertersWordML/TestBwdc/TestBwdc.csproj index e617bf8..44814bd 100644 --- a/src/SILConvertersWordML/TestBwdc/TestBwdc.csproj +++ b/src/SILConvertersWordML/TestBwdc/TestBwdc.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <Import Project="..\..\..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\..\..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props')" /> <Import Project="..\..\..\packages\NUnit.3.13.3\build\NUnit.props" Condition="Exists('..\..\..\packages\NUnit.3.13.3\build\NUnit.props')" /> <PropertyGroup> @@ -458,7 +458,7 @@ </PropertyGroup> <Error Condition="!Exists('..\..\..\packages\NUnit.3.13.3\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\NUnit.3.13.3\build\NUnit.props'))" /> <Error Condition="!Exists('..\..\..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\NUnit3TestAdapter.4.3.1\build\net35\NUnit3TestAdapter.props'))" /> - <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> <ProjectExtensions> <VisualStudio> diff --git a/src/SILConvertersWordML/TestBwdc/packages.config b/src/SILConvertersWordML/TestBwdc/packages.config index bf328b0..f61e40c 100644 --- a/src/SILConvertersWordML/TestBwdc/packages.config +++ b/src/SILConvertersWordML/TestBwdc/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> <package id="Microsoft.CSharp" version="4.7.0" targetFramework="net48" /> <package id="Newtonsoft.Json" version="13.0.2" targetFramework="net48" /> <package id="NUnit" version="3.13.3" targetFramework="net48" /> diff --git a/src/SILConvertersWordML/app.config b/src/SILConvertersWordML/app.config index 4cb3dd9..989cc1a 100644 --- a/src/SILConvertersWordML/app.config +++ b/src/SILConvertersWordML/app.config @@ -33,21 +33,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -65,21 +61,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SILConvertersWordML/packages.config b/src/SILConvertersWordML/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SILConvertersWordML/packages.config +++ b/src/SILConvertersWordML/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SilConvertersXML/SilConvertersXML.csproj b/src/SilConvertersXML/SilConvertersXML.csproj index 1ff0067..9d987c4 100644 --- a/src/SilConvertersXML/SilConvertersXML.csproj +++ b/src/SilConvertersXML/SilConvertersXML.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -236,6 +236,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SilConvertersXML/TranslationHelperForm.cs b/src/SilConvertersXML/TranslationHelperForm.cs index 738c095..10f1617 100644 --- a/src/SilConvertersXML/TranslationHelperForm.cs +++ b/src/SilConvertersXML/TranslationHelperForm.cs @@ -57,6 +57,8 @@ public DialogResult Show(DirectableEncConverter theEc, Font font, string sourceS // the control we're sending this to may have other EncConverters associated w/ this font, but we only have the one. So add it // here and when it gets initialized below, it may add other conversions done at that time TargetsPossible = new List<TargetPossible>(), + DisplayExistingTargetTranslation = false, + IsTargetTranslationEditable = true, }; // this form is the implementation of the way to get data @@ -64,7 +66,7 @@ public DialogResult Show(DirectableEncConverter theEc, Font font, string sourceS if (!backTranslationHelperCtrl.TheTranslators.Any(t => t.Name == theEc.GetEncConverter.Name)) backTranslationHelperCtrl.TheTranslators.Add(theEc.GetEncConverter); - backTranslationHelperCtrl.Initialize(displayExistingTargetTranslation: false); + backTranslationHelperCtrl.Initialize(_model); backTranslationHelperCtrl.GetNewData(ref _model); _updateDataProc(_model); diff --git a/src/SilConvertersXML/app.config b/src/SilConvertersXML/app.config index 3da1b89..9bf87d7 100644 --- a/src/SilConvertersXML/app.config +++ b/src/SilConvertersXML/app.config @@ -26,21 +26,17 @@ <assemblyIdentity name="Microsoft.Extensions.Http" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> - <dependentAssembly> - <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> - </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.Http.Polly" publicKeyToken="adb9793829ddae60" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.10.0" newVersion="7.0.10.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" /> @@ -58,21 +54,33 @@ <assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> + </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.0" newVersion="1.61.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Apis" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-1.60.0.0" newVersion="1.60.0.0" /> + <assemblyIdentity name="Google.Apis.Translate.v2" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-1.61.0.875" newVersion="1.61.0.875" /> + </dependentAssembly> + <dependentAssembly> + <assemblyIdentity name="Google.Api.Gax" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> <dependentAssembly> - <assemblyIdentity name="Google.Api.Gax" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> - <bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" /> + <assemblyIdentity name="Google.Api.Gax.Rest" publicKeyToken="3ec5ea7f18953e47" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> diff --git a/src/SilConvertersXML/packages.config b/src/SilConvertersXML/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SilConvertersXML/packages.config +++ b/src/SilConvertersXML/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/SpellingFixerEC/AddNewProjectForm.cs b/src/SpellingFixerEC/AddNewProjectForm.cs index 3b94cc8..d65512f 100644 --- a/src/SpellingFixerEC/AddNewProjectForm.cs +++ b/src/SpellingFixerEC/AddNewProjectForm.cs @@ -179,6 +179,11 @@ private string DecodePunctuationForCCEx(string strPunctuation) private void AddNewProjectForm_FormClosing(object sender, FormClosingEventArgs e) { + // ignore the validation below, if the user is trying to close the dialog (either by the + // upper right red 'X' or the Cancel button) + if ((e.CloseReason == CloseReason.UserClosing) || (DialogResult == DialogResult.Cancel)) + return; + if (WordBoundaryDelimiter.Contains('"')) { MessageBox.Show("Can't use the double-quote character for the word boundary delimiter", diff --git a/src/SpellingFixerEC/LoginSF.cs b/src/SpellingFixerEC/LoginSF.cs index bbeac22..6b26cc3 100644 --- a/src/SpellingFixerEC/LoginSF.cs +++ b/src/SpellingFixerEC/LoginSF.cs @@ -433,7 +433,7 @@ internal bool LoadProject(string strProjectName) ECAttributes aECAttrs = aECs.Attributes(aEC.Name, AttributeType.Converter); string strFontName = aECAttrs[SpellingFixerEC.cstrAttributeFontToUse]; string sFontSize = aECAttrs[SpellingFixerEC.cstrAttributeFontSizeToUse]; - m_isRightToleft = aECAttrs.ContainsKey(SpellingFixerEC.cstrAttributeFontRightToLeft) && (aECAttrs[SpellingFixerEC.cstrAttributeFontRightToLeft] == "true"); + m_isRightToleft = aECAttrs.ContainsKey(SpellingFixerEC.cstrAttributeFontRightToLeft) && (aECAttrs[SpellingFixerEC.cstrAttributeFontRightToLeft].ToLower() == "true"); m_strWordBoundaryDelimiter = aECAttrs[SpellingFixerEC.cstrAttributeWordBoundaryDelimiter]; m_strNonWordCharacters = aECAttrs[SpellingFixerEC.cstrAttributeNonWordChars]; diff --git a/src/SpellingFixerEC/SpellingFixerEC.csproj b/src/SpellingFixerEC/SpellingFixerEC.csproj index a58d6bf..9c3c68c 100644 --- a/src/SpellingFixerEC/SpellingFixerEC.csproj +++ b/src/SpellingFixerEC/SpellingFixerEC.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <ProjectType>Local</ProjectType> <ProductVersion>9.0.30729</ProductVersion> @@ -250,6 +250,6 @@ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/SpellingFixerEC/packages.config b/src/SpellingFixerEC/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/SpellingFixerEC/packages.config +++ b/src/SpellingFixerEC/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file diff --git a/src/TECkit Mapping Editor/TECkit Mapping Editor.csproj b/src/TECkit Mapping Editor/TECkit Mapping Editor.csproj index 9f8b1b6..2d5a465 100644 --- a/src/TECkit Mapping Editor/TECkit Mapping Editor.csproj +++ b/src/TECkit Mapping Editor/TECkit Mapping Editor.csproj @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="16.0"> - <Import Project="..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" /> + <Import Project="..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props" Condition="Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> @@ -194,7 +194,9 @@ </ItemGroup> <ItemGroup> <Content Include="TRFFC17.ICO" /> - <Content Include="UnicodeRanges.xml" /> + <Content Include="UnicodeRanges.xml"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> </ItemGroup> <ItemGroup> <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> @@ -239,6 +241,6 @@ xcopy /y "$(ProjectDir)UnicodeRanges.xml" "$(SolutionDir)output\$(PlatformName)\ <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> - <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.6.0\build\Encoding-Converters-Core.props'))" /> + <Error Condition="!Exists('..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Encoding-Converters-Core.0.7.0\build\Encoding-Converters-Core.props'))" /> </Target> </Project> \ No newline at end of file diff --git a/src/TECkit Mapping Editor/packages.config b/src/TECkit Mapping Editor/packages.config index e0a2de1..c9fc6d8 100644 --- a/src/TECkit Mapping Editor/packages.config +++ b/src/TECkit Mapping Editor/packages.config @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Encoding-Converters-Core" version="0.6.0" targetFramework="net48" /> + <package id="Encoding-Converters-Core" version="0.7.0" targetFramework="net48" /> </packages> \ No newline at end of file