Skip to content

Commit

Permalink
added trados 2022 plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
TommiNieminen committed Jul 2, 2022
1 parent b87bc92 commit 3908808
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 40 deletions.
15 changes: 15 additions & 0 deletions OpusCatEngineAndPlugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpusCatMTEngineTests", "Opu
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "memoqPluginTest", "memoqPluginTest\memoqPluginTest.csproj", "{240B57C5-5B97-473C-8B79-D3E440755402}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpusCatTranslationProvider2022", "Trados2022Plugin\OpusCatTranslationProvider2022.csproj", "{4B5B9E7A-FC62-443B-A002-10C9397461C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -201,6 +203,18 @@ Global
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x64.Build.0 = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x86.ActiveCfg = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x86.Build.0 = Release|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|x64.ActiveCfg = Debug|x64
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|x64.Build.0 = Debug|x64
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|x86.ActiveCfg = Debug|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Debug|x86.Build.0 = Debug|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|Any CPU.Build.0 = Release|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|x64.ActiveCfg = Release|x64
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|x64.Build.0 = Release|x64
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|x86.ActiveCfg = Release|Any CPU
{4B5B9E7A-FC62-443B-A002-10C9397461C7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -219,6 +233,7 @@ Global
{7835C453-B4A0-45C4-BDB8-7888D26561FC} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364} = {05D6D17C-DFCC-4E76-AE07-0F22FD38F3B7}
{240B57C5-5B97-473C-8B79-D3E440755402} = {AFE9D936-9C76-46D3-85DB-DB68EAD8B353}
{4B5B9E7A-FC62-443B-A002-10C9397461C7} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8F143A32-2D24-488F-AD4C-CD6D074641C6}
Expand Down
19 changes: 12 additions & 7 deletions Trados2017Plugin/OpusCatTranslationProvider2017.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@
<Private>False</Private>
</Reference>
<Reference Include="Sdl.Core.PluginFramework, Version=1.8.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888, processorArchitecture=MSIL">
<HintPath>..\packages\Sdl.Core.PluginFramework.2.0.0\lib\net45\Sdl.Core.PluginFramework.dll</HintPath>
</Reference>
<Reference Include="Sdl.Core.PluginFramework.PackageSupport, Version=1.8.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888, processorArchitecture=MSIL">
<HintPath>..\packages\Sdl.Core.PluginFramework.2.0.0\lib\net45\Sdl.Core.PluginFramework.PackageSupport.dll</HintPath>
<HintPath>..\packages\Sdl.Core.PluginFramework.2.1.0\lib\netstandard2.0\Sdl.Core.PluginFramework.dll</HintPath>
</Reference>
<Reference Include="Sdl.Core.Settings">
<HintPath>..\..\..\..\..\..\Program Files (x86)\SDL\SDL Trados Studio\Studio5\Sdl.Core.Settings.dll</HintPath>
Expand Down Expand Up @@ -217,7 +214,10 @@
</Compile>
<Compile Include="..\Trados2019Plugin\OpusCatTpSettings.Designer.cs">
<Link>OpusCatTpSettings.Designer.cs</Link>
</Compile>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>OpusCatTpSettings.settings</DependentUpon>
<AutoGen>True</AutoGen>
</Compile>
<Compile Include="..\Trados2019Plugin\OpusCatMTServiceHelper.cs">
<Link>OpusCatMTServiceHelper.cs</Link>
</Compile>
Expand Down Expand Up @@ -283,6 +283,11 @@
<None Include="Resources\opus_mt.png" />
<None Include="App.config" />
<None Include="Resources\opus.ico" />
<None Include="..\Trados2019Plugin\OpusCatTpSettings.settings">
<Link>OpusCatTpSettings.settings</Link>
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>OpusCatTpSettings.Designer.cs</LastGenOutput>
</None>
<EmbeddedResource Include="..\Trados2019Plugin\stopwords-iso.json">
<Link>stopwords-iso.json</Link>
</EmbeddedResource>
Expand Down Expand Up @@ -349,12 +354,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Sdl.Core.PluginFramework.Build.16.0.1\build\Sdl.Core.PluginFramework.Build.targets" Condition="Exists('..\packages\Sdl.Core.PluginFramework.Build.16.0.1\build\Sdl.Core.PluginFramework.Build.targets')" />
<Import Project="..\packages\Sdl.Core.PluginFramework.Build.17.0.0\build\Sdl.Core.PluginFramework.Build.targets" Condition="Exists('..\packages\Sdl.Core.PluginFramework.Build.17.0.0\build\Sdl.Core.PluginFramework.Build.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<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\Sdl.Core.PluginFramework.Build.16.0.1\build\Sdl.Core.PluginFramework.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Sdl.Core.PluginFramework.Build.16.0.1\build\Sdl.Core.PluginFramework.Build.targets'))" />
<Error Condition="!Exists('..\packages\Sdl.Core.PluginFramework.Build.17.0.0\build\Sdl.Core.PluginFramework.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Sdl.Core.PluginFramework.Build.17.0.0\build\Sdl.Core.PluginFramework.Build.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
4 changes: 2 additions & 2 deletions Trados2017Plugin/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net471" />
<package id="RestSharp" version="106.12.0" targetFramework="net471" />
<package id="Sdl.Core.PluginFramework" version="2.0.0" targetFramework="net471" />
<package id="Sdl.Core.PluginFramework.Build" version="16.0.1" targetFramework="net471" />
<package id="Sdl.Core.PluginFramework" version="2.1.0" targetFramework="net471" />
<package id="Sdl.Core.PluginFramework.Build" version="17.0.0" targetFramework="net471" />
</packages>
6 changes: 3 additions & 3 deletions Trados2019Plugin/ConnectionControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private void StartFetch()
//If connection details are custom, check the custom checkbox, this is for start-up
this.UseCustomConnection.IsChecked =
host != OpusCatTpSettings.Default.MtServiceAddress ||
port != OpusCatTpSettings.Default.MtServicePort;
port != OpusCatTpSettings.Default.MtServicePortHttp;

var modeltag = this.options.modelTag;
Task.Run(() => this.FetchServiceData(host, port, modeltag));
Expand All @@ -284,7 +284,7 @@ private void RetryConnection_Click(object sender, RoutedEventArgs e)

private void SaveAsDefault_Click(object sender, RoutedEventArgs e)
{
OpusCatTpSettings.Default.MtServicePort = this.ServicePortBoxElement.Text;
OpusCatTpSettings.Default.MtServicePortHttp = this.ServicePortBoxElement.Text;
OpusCatTpSettings.Default.MtServiceAddress = this.ServiceAddressBoxElement.Text;
OpusCatTpSettings.Default.Save();
}
Expand All @@ -297,7 +297,7 @@ public void TagBox_SelectionChanged(object sender, SelectionChangedEventArgs e)

private void UseCustomConnection_Unchecked(object sender, RoutedEventArgs e)
{
this.ServicePortBoxElement.Text = OpusCatTpSettings.Default.MtServicePort;
this.ServicePortBoxElement.Text = OpusCatTpSettings.Default.MtServicePortHttp;
this.ServiceAddressBoxElement.Text = OpusCatTpSettings.Default.MtServiceAddress;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Trados2019Plugin/FinetuneBatchTaskControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Trados2019Plugin/FinetuneBatchTaskControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace OpusCatTranslationProvider
{
public partial class FinetuneBatchTaskControl : UserControl, ISettingsAware<FinetuneBatchTaskSettings>
#if TRADOS21
#if (TRADOS21 || TRADOS22)
, IUISettingsControl
#endif
{
Expand Down
7 changes: 5 additions & 2 deletions Trados2019Plugin/OpusCatOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Configuration;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using System.Windows.Input;
Expand Down Expand Up @@ -117,8 +118,8 @@ public string mtServicePort
if (parameter == "" || parameter == null)
{
//Add default to URI
SetStringParameter("mtServicePort", OpusCatTpSettings.Default.MtServicePort);
return OpusCatTpSettings.Default.MtServicePort;
SetStringParameter("mtServicePort", OpusCatTpSettings.Default.MtServicePortHttp);
return OpusCatTpSettings.Default.MtServicePortHttp;
}
else
{
Expand All @@ -128,6 +129,8 @@ public string mtServicePort
set { SetStringParameter("mtServicePort", value); NotifyPropertyChanged(); }
}



public string mtServiceAddress
{
get
Expand Down
4 changes: 2 additions & 2 deletions Trados2019Plugin/OpusCatProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public OpusCatOptions Options
set;
}

#if TRADOS21
#if (TRADOS21 || TRADOS22)
private static IStudioDocument activeDocument;
#else
private static Document activeDocument;
Expand Down Expand Up @@ -93,7 +93,7 @@ private static void ClearSegmentHandlers()
}
}

#if TRADOS21
#if (TRADOS21 || TRADOS22)
private static void UpdateSegmentHandler(IStudioDocument doc)
#else
private static void UpdateSegmentHandler(Document doc)
Expand Down
2 changes: 1 addition & 1 deletion Trados2019Plugin/OpusCatProviderLanguageDirection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private SearchResult CreateSearchResult(Segment searchSegment, Segment translati

if (this._options.showMtAsOrigin)
{
#if TRADOS21
#if (TRADOS21 || TRADOS22)
tu.Origin = TranslationUnitOrigin.Nmt;
#else
tu.Origin = TranslationUnitOrigin.MachineTranslation;
Expand Down
24 changes: 12 additions & 12 deletions Trados2019Plugin/OpusCatTpSettings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Trados2019Plugin/OpusCatTpSettings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="OpusCatTranslationProvider" GeneratedClassName="OpusCatTpSettings">
<Profiles />
<Settings>
<Setting Name="MtServicePort" Type="System.String" Scope="User">
<Value Profile="(Default)">8477</Value>
</Setting>
<Setting Name="SupportAllLanguagePairs" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
Expand Down Expand Up @@ -44,5 +41,8 @@
<Setting Name="RestoreTags" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="MtServicePortHttp" Type="System.String" Scope="User">
<Value Profile="(Default)">8500</Value>
</Setting>
</Settings>
</SettingsFile>
1 change: 1 addition & 0 deletions Trados2019Plugin/OpusCatTranslationProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
Expand Down
Loading

0 comments on commit 3908808

Please sign in to comment.