Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generate termbase from extracted terms file #1306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,7 @@ Restart Studio and now you should be able to generate the new termbase.</value>
<data name="TellMe_Provider_Results" xml:space="preserve">
<value>{0} results</value>
</data>
<data name="termbaseDefaultDefinitionFile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>resources\termbasedefaultdefinitionfile.xdt;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"Profile 1": {
"commandName": "Executable",
"executablePath": "C:\\Program Files (x86)\\Trados\\Trados Studio\\Studio17\\SDLTradosStudio.exe"
},
"SR1 Beta5": {
"commandName": "Executable",
"executablePath": "C:\\Program Files (x86)\\Trados\\Trados Studio\\Studio17Beta\\SDLTradosStudio.exe"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,69 @@
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TradosFolder>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17</TradosFolder>
<PluginDeploymentPath>$(AppData)\Trados\Trados Studio\17\Plugins</PluginDeploymentPath>
<CreatePluginPackage>true</CreatePluginPackage>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\termbaseDefaultDefinitionFile.xdt" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Sdl.Core.Globalization">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Core.Globalization.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.Core.Globalization.dll</HintPath>
</Reference>
<Reference Include="Sdl.Core.Globalization.Async">
<HintPath>$(TradosFolder)\Sdl.Core.Globalization.Async.dll</HintPath>
</Reference>
<Reference Include="Sdl.Core.Settings">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Core.Settings.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.Core.Settings.dll</HintPath>
</Reference>
<Reference Include="Sdl.Desktop.IntegrationApi">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Desktop.IntegrationApi.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.Desktop.IntegrationApi.dll</HintPath>
</Reference>
<Reference Include="Sdl.Desktop.IntegrationApi.Extensions">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Desktop.IntegrationApi.Extensions.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.Desktop.IntegrationApi.Extensions.dll</HintPath>
</Reference>
<Reference Include="Sdl.Desktop.Platform">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.Desktop.Platform.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.Desktop.Platform.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Core">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Core.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.FileTypeSupport.Framework.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Core.Utilities">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Core.Utilities.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.FileTypeSupport.Framework.Core.Utilities.dll</HintPath>
</Reference>
<Reference Include="Sdl.FileTypeSupport.Framework.Implementation">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.FileTypeSupport.Framework.Implementation.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.FileTypeSupport.Framework.Implementation.dll</HintPath>
</Reference>
<Reference Include="Sdl.MultiTerm.TMO.Interop">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.MultiTerm.TMO.Interop.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.MultiTerm.TMO.Interop.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Sdl.ProjectApi">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectApi.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.ProjectApi.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.AutomaticTasks">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.AutomaticTasks.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.ProjectAutomation.AutomaticTasks.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Core">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Core.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.ProjectAutomation.Core.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.FileBased">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.FileBased.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.ProjectAutomation.FileBased.dll</HintPath>
</Reference>
<Reference Include="Sdl.ProjectAutomation.Settings">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.ProjectAutomation.Settings.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.ProjectAutomation.Settings.dll</HintPath>
</Reference>
<Reference Include="Sdl.TranslationStudio.Api">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.TranslationStudio.Api.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.TranslationStudio.Api.dll</HintPath>
</Reference>
<Reference Include="Sdl.TranslationStudioAutomation.IntegrationApi">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.TranslationStudioAutomation.IntegrationApi.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.TranslationStudioAutomation.IntegrationApi.dll</HintPath>
</Reference>
<Reference Include="Sdl.TellMe.ProviderApi">
<HintPath>$(MSBuildProgramFiles32)\Trados\Trados Studio\Studio17\Sdl.TellMe.ProviderApi.dll</HintPath>
<HintPath>$(TradosFolder)\Sdl.TellMe.ProviderApi.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -118,6 +125,9 @@
<Version>6.0.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\termbaseDefaultDefinitionFile.xdt" />
</ItemGroup>
<ItemGroup>
<Compile Update="PluginResources.Designer.cs">
<DesignTime>True</DesignTime>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public static string GetResourceTextFile(string fileName)

var result = string.Empty;

using (Stream stream = typeof(TermbaseDefinitionFile).Assembly.GetManifestResourceStream("Sdl.Community.ProjectTerms.Plugin.Resources." + fileName))
using (var stream = new MemoryStream (PluginResources.termbaseDefaultDefinitionFile))
{
using (StreamReader sr = new StreamReader(stream))
using (var sr = new StreamReader(stream))
{
result = sr.ReadToEnd();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Sdl.Community.ProjectTerms.Plugin.Exceptions;
using Sdl.Community.ProjectTerms.Telemetry;
using Sdl.Core.Globalization;
using Sdl.Core.Globalization.LanguageRegistry;
using Sdl.Desktop.IntegrationApi;
using Sdl.Desktop.IntegrationApi.Extensions;
using Sdl.MultiTerm.TMO.Interop;
Expand Down Expand Up @@ -138,7 +139,7 @@ private void IncludeTermbaseInStudio(TermbaseGeneration termbaseCreator, string
{
foreach (var targetLanguage in targetLanguages.Keys)
{
termbaseConfig.LanguageIndexes.Add(new TermbaseLanguageIndex(new Language(CultureInfo.GetCultureInfo(targetLanguages[targetLanguage])), targetLanguage));
termbaseConfig.LanguageIndexes.Add(new TermbaseLanguageIndex(LanguageRegistryApi.Instance.GetLanguage(CultureInfo.GetCultureInfo(targetLanguages[targetLanguage]).Name), targetLanguage));
}
}
project.UpdateTermbaseConfiguration(termbaseConfig);
Expand Down