diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4570f39b..38589e93 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,29 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 + with: + fetch-depth: 0 # fetch full history for GitVersion + + - name: Setup .NET + uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8 # v2.1.0 + with: + dotnet-version: 6.0.x - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + #- name: Restore + # run: dotnet restore + + - name: setup-msbuild + uses: microsoft/setup-msbuild@v1.1.3 + with: + # Folder location of where vswhere.exe is located if a self-hosted agent + vswhere-path: # optional + # Version of Visual Studio to search; defaults to latest if not specified + vs-version: # optional + # Enable searching for pre-release versions of Visual Studio/MSBuild + vs-prerelease: # optional + # The preferred processor architecture of MSBuild. Can be either "x86" or "x64". "x64" is only available from Visual Studio version 17.0 and later. + msbuild-architecture: x64 # optional, default is x86 - name: Fetch nuget dependecies run: nuget restore "${{env.SOLUTION_FILE_PATH}}" @@ -48,13 +67,14 @@ jobs: #- name: Test # run: output/Win32/${{matrix.build_configuration}}/RunTests.exe - - name: rename installer - if: ${{ success() && matrix.build_configuration == 'Release' }} - run: cp "output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.exe" "output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.${{github.run_number}}.exe" + # now that we're building on TeamCity (to sign it), this isn't needed + #- name: rename installer + # if: ${{ success() && matrix.build_configuration == 'Release' }} + # run: cp "output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.exe" "output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.${{github.run_number}}.exe" - - name: publish artifact - if: ${{ success() && matrix.build_configuration == 'Release' }} - uses: actions/upload-artifact@v2.2.4 - with: - name: silconverters-installers.${{matrix.platform}}.latest - path: output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.${{github.run_number}}.exe \ No newline at end of file + #- name: Upload a Build Artifact + # if: ${{ success() && matrix.build_configuration == 'Release' }} + # uses: actions/upload-artifact@v3.1.1 + # with: + # name: silconverters-installers.${{matrix.platform}}.latest + # path: output/${{matrix.platform}}/SetupSILConverters_${{matrix.platform}}.${{github.run_number}}.exe diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..6bc626c2 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,11 @@ + + + SILConverters + SILConverters + 5.1 + 5.1.1.0 + 8A50226C-84D0-4CAF-AF8F-B0284643C415 + 2022 + SIL International + + \ No newline at end of file diff --git a/Installer/AdaptIt2Unicode64bitMM/AdaptIt2Unicode64bitMM.wixproj b/Installer/AdaptIt2Unicode64bitMM/AdaptIt2Unicode64bitMM.wixproj index ec0ff9fe..32f1b6ab 100644 --- a/Installer/AdaptIt2Unicode64bitMM/AdaptIt2Unicode64bitMM.wixproj +++ b/Installer/AdaptIt2Unicode64bitMM/AdaptIt2Unicode64bitMM.wixproj @@ -1,5 +1,6 @@  + Release x64 @@ -8,6 +9,8 @@ 2.0 AdaptIt2Unicode64bitMM Module + + Debug @@ -21,11 +24,20 @@ + + + + + + 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}. + + + + \ No newline at end of file diff --git a/Installer/ParatextBackTranslationHelperPlugin64bitMM/ParatextBackTranslationHelperPlugin_MergeModule.wxs b/Installer/ParatextBackTranslationHelperPlugin64bitMM/ParatextBackTranslationHelperPlugin_MergeModule.wxs new file mode 100644 index 00000000..1a808758 --- /dev/null +++ b/Installer/ParatextBackTranslationHelperPlugin64bitMM/ParatextBackTranslationHelperPlugin_MergeModule.wxs @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Installer/ParatextBackTranslationHelperPlugin64bitMM/packages.config b/Installer/ParatextBackTranslationHelperPlugin64bitMM/packages.config new file mode 100644 index 00000000..48182e9f --- /dev/null +++ b/Installer/ParatextBackTranslationHelperPlugin64bitMM/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Installer/SCOffice0364bitMM/SCOffice0364bitMM.wixproj b/Installer/SCOffice0364bitMM/SCOffice0364bitMM.wixproj index 125abef8..48f1d76a 100644 --- a/Installer/SCOffice0364bitMM/SCOffice0364bitMM.wixproj +++ b/Installer/SCOffice0364bitMM/SCOffice0364bitMM.wixproj @@ -1,5 +1,6 @@  + Release x64 @@ -8,6 +9,8 @@ 2.0 SCOffice0364bitMM Module + + Debug @@ -22,11 +25,20 @@ + + + + + + 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}. + + + + diff --git a/Installer/SEC Setup 64bit/EcMergeModules.wxs b/Installer/SEC Setup 64bit/EcMergeModules.wxs index 7c9e1abe..be75a1e4 100644 --- a/Installer/SEC Setup 64bit/EcMergeModules.wxs +++ b/Installer/SEC Setup 64bit/EcMergeModules.wxs @@ -23,12 +23,17 @@ + + + + + diff --git a/Installer/SEC Setup 64bit/Product.wxs b/Installer/SEC Setup 64bit/Product.wxs index 1fec0f64..cc7589e7 100644 --- a/Installer/SEC Setup 64bit/Product.wxs +++ b/Installer/SEC Setup 64bit/Product.wxs @@ -1,8 +1,8 @@ - + @@ -133,6 +133,9 @@ + + + diff --git a/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj b/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj index 06d1e91e..ad6cc2c4 100644 --- a/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj +++ b/Installer/SEC Setup 64bit/SEC Setup 64bit.wixproj @@ -1,13 +1,14 @@  - + + Release x64 3.7 {69CB9E94-E875-4B29-AB69-3BBFE8D467E8} 2.0 - SetupSILConverters64 + SetupSILConverters_x64 Package @@ -57,7 +58,8 @@ 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}. - + + + + + $(TargetFileName) + $(MSBuildStartupDirectory)\ + $(SolutionDir)build\ + $(SolutionDir)output\$(PlatformName)\ + "$(OutputDir)$(MsiFile)" + + + + \ No newline at end of file diff --git a/Installer/SEC Setup 64bit/packages.config b/Installer/SEC Setup 64bit/packages.config index 4e3c5bfe..42f10aa9 100644 --- a/Installer/SEC Setup 64bit/packages.config +++ b/Installer/SEC Setup 64bit/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/Installer/SEC Setup/EcFeatures.wxs b/Installer/SEC Setup/EcFeatures.wxs index 18b6bf75..45d31a3e 100644 --- a/Installer/SEC Setup/EcFeatures.wxs +++ b/Installer/SEC Setup/EcFeatures.wxs @@ -61,12 +61,12 @@ - + - + @@ -78,7 +78,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -98,14 +98,14 @@ - + - + @@ -127,13 +127,8 @@ - - - - - - - + + @@ -159,6 +154,14 @@ + + + + + + + + diff --git a/Installer/SEC Setup/EcMergeModules.wxs b/Installer/SEC Setup/EcMergeModules.wxs index 3c4e8d6f..127a1bbe 100644 --- a/Installer/SEC Setup/EcMergeModules.wxs +++ b/Installer/SEC Setup/EcMergeModules.wxs @@ -26,6 +26,7 @@ + diff --git a/Installer/SEC Setup/Product.wxs b/Installer/SEC Setup/Product.wxs index a7499372..2d84e285 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"> - + Privileged diff --git a/Installer/SEC Setup/SEC Setup.wixproj b/Installer/SEC Setup/SEC Setup.wixproj index 1f9ac0cc..688af7a5 100644 --- a/Installer/SEC Setup/SEC Setup.wixproj +++ b/Installer/SEC Setup/SEC Setup.wixproj @@ -1,13 +1,14 @@  - + + Release x86 3.7 {348850e8-5c84-4c77-ba1a-220c6e48fa6e} 2.0 - SetupSILConverters + SetupSILConverters_x86 Package @@ -65,7 +66,8 @@ 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}. - + + + + + $(TargetFileName) + $(MSBuildStartupDirectory)\ + $(SolutionDir)build\ + $(SolutionDir)output\$(PlatformName)\ + "$(OutputDir)$(MsiFile)" + + + + \ No newline at end of file diff --git a/Installer/SEC Setup/packages.config b/Installer/SEC Setup/packages.config index 4e3c5bfe..42f10aa9 100644 --- a/Installer/SEC Setup/packages.config +++ b/Installer/SEC Setup/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/Installer/SFM Converter 64bit MM/SFM Converter 64bit MM.wixproj b/Installer/SFM Converter 64bit MM/SFM Converter 64bit MM.wixproj index 609f61d7..39dc7867 100644 --- a/Installer/SFM Converter 64bit MM/SFM Converter 64bit MM.wixproj +++ b/Installer/SFM Converter 64bit MM/SFM Converter 64bit MM.wixproj @@ -1,5 +1,6 @@  + Release x64 @@ -8,6 +9,8 @@ 2.0 SFM Converter 64bit MM Module + + Debug @@ -21,11 +24,20 @@ + + + + + + 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}. + + + + + + $(TargetName)_$(TruncatedVersion)_$(PlatformName)$(TargetExt) + $(SolutionDir)build\ + $(SolutionDir)output\$(PlatformName)\ + "$(OutputDir)$(ExeFile)" UseInsignia + + + + \ No newline at end of file diff --git a/Installer/SetupSILConverters/packages.config b/Installer/SetupSILConverters/packages.config index 4e3c5bfe..42f10aa9 100644 --- a/Installer/SetupSILConverters/packages.config +++ b/Installer/SetupSILConverters/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/Installer/SilConvertersForWord64bitMM/SilConvertersForWord64bitMM.wixproj b/Installer/SilConvertersForWord64bitMM/SilConvertersForWord64bitMM.wixproj index 565d0560..e1ab9a60 100644 --- a/Installer/SilConvertersForWord64bitMM/SilConvertersForWord64bitMM.wixproj +++ b/Installer/SilConvertersForWord64bitMM/SilConvertersForWord64bitMM.wixproj @@ -1,5 +1,6 @@  + Release x64 @@ -8,6 +9,8 @@ 2.0 SilConvertersForWord64bitMM Module + + Debug @@ -21,11 +24,20 @@ + + + + + + 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}. + + + - + $(EcLibFilesPath)\net48\x86\ECInterfaces.dll - + $(EcLibFilesPath)\net48\x64\ECInterfaces.dll - + $(EcLibFilesPath)\net48\x86\SilEncConverters40.dll - + $(EcLibFilesPath)\net48\x64\SilEncConverters40.dll @@ -208,6 +204,6 @@ 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}. - + \ No newline at end of file diff --git a/src/AdaptIt2Unicode/packages.config b/src/AdaptIt2Unicode/packages.config index d6cab12d..59d699ac 100644 --- a/src/AdaptIt2Unicode/packages.config +++ b/src/AdaptIt2Unicode/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/src/BackTranslationHelper/BackTranslationHelper.csproj b/src/BackTranslationHelper/BackTranslationHelper.csproj new file mode 100644 index 00000000..de2501f3 --- /dev/null +++ b/src/BackTranslationHelper/BackTranslationHelper.csproj @@ -0,0 +1,264 @@ + + + + + + + Debug + AnyCPU + {3E74CE98-6558-4AF0-BB0C-C7E436208B1B} + Library + Properties + BackTranslationHelper + BackTranslationHelper + v4.8 + 8.0 + 512 + true + + + + + true + full + false + ..\..\output\x86\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\output\x86\Release\ + TRACE + prompt + 4 + + + true + ..\..\output\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + + + ..\..\output\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + + + true + ..\..\output\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + + + ..\..\output\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + + + true + + + FieldWorks.snk + + + + ..\..\packages\DialogAdapters.Gtk2.0.1.11\lib\net461\DialogAdapters.dll + + + $(EcLibFilesPath)\net48\x86\ECInterfaces.dll + + + $(EcLibFilesPath)\net48\x64\ECInterfaces.dll + + + ..\..\packages\Enchant.Net.1.4.2\lib\net461\Enchant.Net.dll + + + ..\..\packages\icu.net.2.8.1\lib\net451\icu.net.dll + + + ..\..\packages\L10NSharp.5.0.0\lib\net461\L10NSharp.dll + + + ..\..\packages\Markdig.Signed.0.30.2\lib\net452\Markdig.Signed.dll + + + ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.0.4\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll + + + ..\..\packages\Microsoft.Extensions.DependencyModel.2.0.4\lib\net451\Microsoft.Extensions.DependencyModel.dll + + + ..\..\packages\Mono.Unix.7.1.0-final.1.21458.1\lib\net45\Mono.Unix.dll + + + ..\..\packages\NDesk.DBus.0.15.0\lib\NDesk.DBus.dll + + + ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\..\packages\SIL.Core.10.0.0-beta0081\lib\net461\SIL.Core.dll + + + ..\..\packages\SIL.Core.Desktop.10.0.0-beta0081\lib\net461\SIL.Core.Desktop.dll + + + ..\..\packages\SIL.Windows.Forms.10.0.0-beta0081\lib\net461\SIL.Windows.Forms.dll + + + ..\..\packages\SIL.Windows.Forms.GeckoBrowserAdapter.10.0.0-beta0081\lib\net461\SIL.Windows.Forms.GeckoBrowserAdapter.dll + + + ..\..\packages\SIL.WritingSystems.10.0.0-beta0081\lib\net461\SIL.WritingSystems.dll + + + $(EcLibFilesPath)\net48\x86\SilEncConverters40.dll + + + $(EcLibFilesPath)\net48\x64\SilEncConverters40.dll + + + ..\..\packages\Spart.1.0.0\lib\net461\Spart.dll + + + + ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + ..\..\packages\System.Configuration.ConfigurationManager.6.0.0\lib\net461\System.Configuration.ConfigurationManager.dll + + + + + + ..\..\packages\System.Drawing.Common.6.0.0\lib\net461\System.Drawing.Common.dll + + + ..\..\packages\System.IO.FileSystem.AccessControl.5.0.0\lib\net461\System.IO.FileSystem.AccessControl.dll + + + + ..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + + ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + + ..\..\packages\System.Security.AccessControl.6.0.0\lib\net461\System.Security.AccessControl.dll + + + ..\..\packages\System.Security.Permissions.6.0.0\lib\net461\System.Security.Permissions.dll + + + ..\..\packages\System.Security.Principal.Windows.5.0.0\lib\net461\System.Security.Principal.Windows.dll + + + + + + ..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + + + + + + + + + + ..\..\packages\TagLibSharp.2.2.0\lib\net45\TagLibSharp.dll + + + + + + UserControl + + + BackTranslationHelperCtrl.cs + + + + + + True + True + Resources.resx + + + True + True + Settings.settings + + + + + BackTranslationHelperCtrl.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + PreserveNewest + + + + + + + + + + + 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}. + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/BackTranslationHelper/BackTranslationHelperCtrl.cs b/src/BackTranslationHelper/BackTranslationHelperCtrl.cs new file mode 100644 index 00000000..d9678f98 --- /dev/null +++ b/src/BackTranslationHelper/BackTranslationHelperCtrl.cs @@ -0,0 +1,341 @@ +using ECInterfaces; +using SilEncConverters40; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace BackTranslationHelper +{ + public partial class BackTranslationHelperCtrl : UserControl + { + public int MaxPossibleTargetTranslations = 3; // to add more, you have to add new lines like the one starting at row 2 + + #region Member variables + // the form in which this UserControl is embedded will initialize these + public IBackTranslationHelperDataSource BackTranslationHelperDataSource; + public List TheTranslators = new List(); + + public BackTranslationHelperModel _model; + #endregion + + public BackTranslationHelperCtrl() + { + InitializeComponent(); + } + + public void Initialize(bool displayExistingTargetTranslation) + { + BackTranslationHelperDataSource.SetDataUpdateProc(UpdateData); + + /* do w/ GetPluginData/PutPluginData + foreach (var translatorName in Properties.Settings.Default.MapProjectsToTranslatorNames.Cast().ToList()) + { + if (!TheTranslators.Select(t => t.Name).Contains(translatorName)) + { + if (DirectableEncConverter.EncConverters.ContainsKey(translatorName)) + TheTranslators.Add(DirectableEncConverter.EncConverters[translatorName]); + else + { + Properties.Settings.Default.MapProjectsToTranslatorNames.Remove(translatorName); + Properties.Settings.Default.Save(); + } + } + } + */ + + // see how many converters are configured (if none, then query for one) + if (!TheTranslators.Any()) + { + var aTranslator = QueryTranslator(); + TheTranslators.Add(aTranslator.GetEncConverter); + } + + tableLayoutPanel.SuspendLayout(); + SuspendLayout(); + + hideColumn1LabelsToolStripMenuItem.Checked = Properties.Settings.Default.HideLabels; + InitializeLabelHiding(); + + labelSourceData.Font = BackTranslationHelperDataSource.SourceLanguageFont; + if (displayExistingTargetTranslation) + { + labelForExistingTargetData.Visible = !hideColumn1LabelsToolStripMenuItem.Checked; + labelTargetTextExisting.Visible = true; + labelTargetTextExisting.Font = BackTranslationHelperDataSource.TargetLanguageFont; + } + else + labelTargetTextExisting.Visible = labelForExistingTargetData.Visible = false; + + textBoxTargetBackTranslation.Font = BackTranslationHelperDataSource.TargetLanguageFont; + + // we're either showing the target translated suggestion in a textbox (if there's only 1 converter) + // or in labels above it to choose from (if there are more than one converter) + var labelsPossibleTargetTranslations = tableLayoutPanel.Controls.OfType