This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Drawing; | |
using Sdl.TellMe.ProviderApi; | |
namespace Sdl.Community.DeepLMTProvider.DeepLTellMe | |
{ | |
public class DeepLStoreAction : AbstractTellMeAction | |
{ | |
public DeepLStoreAction() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sdl.TellMe.ProviderApi; | |
namespace Sdl.Community.DeepLMTProvider.DeepLTellMe | |
{ | |
[TellMeProvider] | |
public class DeepLTellMeProvider : ITellMeProvider | |
{ | |
public string Name => "DeepL tell me provider"; | |
public AbstractTellMeAction[] ProviderActions => new AbstractTellMeAction[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void RemoveTp(FileBasedProject studioProject) | |
{ | |
var entries = studioProject.GetTranslationProviderConfiguration().Entries; | |
entries.RemoveAt(0); | |
if (entries.Count > 0) | |
{ | |
entries[0].MainTranslationProvider.Enabled = true; | |
entries[0].PerformUpdate = true; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var converter = manager.GetConverterToDefaultBilingual(file.LocalFilePath, file.LocalFilePath, null); | |
var contentProcessor = new MtComparisonTargetContentProcessor(file.Language.IsoAbbreviation, file.Name, enName); | |
converter.AddBilingualProcessor(new BilingualContentHandlerAdapter(contentProcessor)); | |
converter.Parse(); | |
var segments = contentProcessor.CustomSegments; | |
public class MtComparisonTargetContentProcessor : AbstractBilingualContentProcessor | |
{ | |
private readonly string _targetLanguage; | |
private readonly string _fileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private FileBasedProject CreateStudioProject(List<StudioReportFile> studioReportFiles, FileBasedProject project) | |
{ | |
var providerConfiguration = project.GetTranslationProviderConfiguration(); | |
var path = Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test")); | |
if (!Directory.Exists(path)) | |
{ | |
Directory.CreateDirectory(path); | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApplicationInitializer] | |
public class Create : IApplicationInitializer | |
{ | |
public void Execute() | |
{ | |
var uri = new Uri(@"Add your url"); | |
var translationProviderServer = new TranslationProviderServer(uri, false, "user name", "password"); | |
var serverTm = new ServerBasedTranslationMemory(translationProviderServer) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ApplicationInitializer] | |
public class CreateProject : IApplicationInitializer | |
{ | |
public void Execute() | |
{ | |
//import Sdl.ProjectAutomation.Core.dll | |
var projectInfo = new ProjectInfo | |
{ | |
Name = "Project From Plugin", | |
SourceLanguage = new Language(CultureInfo.GetCultureInfo("en-US")), //import Sdl.core.globalization.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//remove the notification from list | |
_notificationGroup.Notifications.Remove(notification); | |
//check if for that group there are any notification remaining | |
if (_notificationGroup.Notifications.Count > 0) | |
{ | |
var addNotificationEvent = new AddStudioGroupNotificationEvent(_notificationGroup); | |
_eventAggregator.Publish(addNotificationEvent); | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get Studio Event Aggregator | |
_eventAggregator = SdlTradosStudio.Application.GetService<IStudioEventAggregator>(); | |
//create event group | |
_notificationGroup = new InSourceNotificationGroup(NotificationGroupId) | |
{ | |
Title = "InSource Notifications" | |
}; | |
//create notification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InSourceCommand : IStudioNotificationCommand | |
{ | |
private readonly Action action; | |
public InSourceCommand(Action action) | |
{ | |
this.action = action; | |
} | |
public event EventHandler CanExecuteChanged; |
NewerOlder