Skip to content

Commit

Permalink
Transcreate: Implemented Back-Translation wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
Impertatore committed Feb 15, 2021
1 parent 8da5bbd commit 63d4894
Show file tree
Hide file tree
Showing 25 changed files with 1,555 additions and 195 deletions.
6 changes: 4 additions & 2 deletions SDLTranscreate/SDLTranscreate/Actions/ConvertProjectAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class ConvertProjectAction : AbstractAction
private IDialogService _dialogService;
private SegmentBuilder _segmentBuilder;
private ProjectAutomationService _projectAutomationService;
private ProjectSettingsService _projectSettingsService;

protected override void Execute()
{
Expand All @@ -52,7 +53,7 @@ protected override void Execute()

var wizardService = new WizardService(action, workFlow, _pathInfo, _customerProvider,
_imageService, _controllers, _segmentBuilder, settings, _dialogService,
_projectAutomationService);
_projectAutomationService, _projectSettingsService);

var taskContext = wizardService.ShowWizard(_controllers.ProjectsController, out var message);
if (taskContext == null && !string.IsNullOrEmpty(message))
Expand All @@ -79,7 +80,8 @@ public override void Initialize()
_segmentBuilder = new SegmentBuilder();
_projectAutomationService = new ProjectAutomationService(_imageService, _controllers.TranscreateController,
_controllers.ProjectsController, _customerProvider);

_projectSettingsService = new ProjectSettingsService();

SetEnabled();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CreateBackTranslationAction : AbstractViewControllerAction<Transcre
private IDialogService _dialogService;
private SegmentBuilder _segmentBuilder;
private ProjectAutomationService _projectAutomationService;
private ProjectSettingsService _projectSettingsService;
private Controllers _controllers;

protected override void Execute()
Expand Down Expand Up @@ -70,7 +71,7 @@ protected override void Execute()

var wizardService = new WizardService(action, workFlow, _pathInfo, _customerProvider,
_imageService, _controllers, _segmentBuilder, settings, _dialogService,
_projectAutomationService);
_projectAutomationService, _projectSettingsService);

try
{
Expand Down Expand Up @@ -111,7 +112,8 @@ public override void Initialize()
_segmentBuilder = new SegmentBuilder();
_controllers = SdlTradosStudio.Application.GetController<TranscreateViewController>().Controllers;
_projectAutomationService = new ProjectAutomationService(_imageService, _controllers.TranscreateController, _controllers.ProjectsController, _customerProvider);

_projectSettingsService = new ProjectSettingsService();

_controllers.TranscreateController.ProjectSelectionChanged += ProjectsController_SelectedProjectsChanged;

var projects = _controllers?.TranscreateController?.GetSelectedProjects();
Expand Down
6 changes: 4 additions & 2 deletions SDLTranscreate/SDLTranscreate/Actions/ExportAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ExportAction : AbstractViewControllerAction<TranscreateViewControll
private IDialogService _dialogService;
private SegmentBuilder _segmentBuilder;
private ProjectAutomationService _projectAutomationService;
private ProjectSettingsService _projectSettingsService;

protected override void Execute()
{
Expand All @@ -49,7 +50,7 @@ protected override void Execute()
var settings = GetSettings();
var wizardService = new WizardService(action, workFlow, _pathInfo, _customerProvider,
_imageService, _controllers, _segmentBuilder, settings, _dialogService,
_projectAutomationService);
_projectAutomationService, _projectSettingsService);

var taskContext = wizardService.ShowWizard(Controller, out var message);
if (taskContext == null && !string.IsNullOrEmpty(message))
Expand Down Expand Up @@ -87,7 +88,8 @@ public override void Initialize()
_segmentBuilder = new SegmentBuilder();
_projectAutomationService = new ProjectAutomationService(_imageService, _controllers.TranscreateController,
_controllers.ProjectsController, _customerProvider);

_projectSettingsService = new ProjectSettingsService();

Enabled = false;
}

Expand Down
4 changes: 3 additions & 1 deletion SDLTranscreate/SDLTranscreate/Actions/ImportAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ImportAction : AbstractViewControllerAction<TranscreateViewControll
private SegmentBuilder _segmentBuilder;
private IDialogService _dialogService;
private ProjectAutomationService _projectAutomationService;
private ProjectSettingsService _projectSettingsService;

protected override void Execute()
{
Expand All @@ -48,7 +49,7 @@ protected override void Execute()
var settings = GetSettings();
var wizardService = new WizardService(action, workFlow, _pathInfo, _customerProvider,
_imageService, _controllers, _segmentBuilder, settings, _dialogService,
_projectAutomationService);
_projectAutomationService, _projectSettingsService);

var taskContext = wizardService.ShowWizard(_controllers.TranscreateController, out var message);
if (taskContext == null && !string.IsNullOrEmpty(message))
Expand Down Expand Up @@ -86,6 +87,7 @@ public override void Initialize()
_segmentBuilder = new SegmentBuilder();
_projectAutomationService = new ProjectAutomationService(_imageService, _controllers.TranscreateController,
_controllers.ProjectsController, _customerProvider);
_projectSettingsService = new ProjectSettingsService();

Enabled = false;
}
Expand Down
29 changes: 29 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/AnalysisTaskSettingsInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Trados.Transcreate.Model
{
public class AnalysisTaskSettingsInfo
{
public AnalysisTaskSettingsInfo()
{
ReportCrossFileRepetitions = true;
UnknownSegmentsMaximumMatchValue = 74;
FrequentSegmentsNoOfOccurrences = 5;
}

public bool ReportCrossFileRepetitions { get; set; }

public bool ReportInternalFuzzyMatchLeverage { get; set; }

public bool ExcludeLockedSegments { get; set; }

public bool ReportLockedSegmentsSeparately { get; set; }

public bool ExportUnknownSegments { get; set; }

public bool ExportFrequentSegments { get; set; }

public int UnknownSegmentsMaximumMatchValue { get; set; }

public int FrequentSegmentsNoOfOccurrences { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Trados.Transcreate.Model
{
public class BackTranslationProject : Project
{
{
public bool IsUpdate { get; set; }
}
}
36 changes: 36 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/FileAssignmentInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;

namespace Trados.Transcreate.Model
{
public class FileAssignmentInfo
{
public FileAssignmentInfo()
{
Phase = string.Empty;
AssignedAt = DateTime.MinValue;
DueDate = DateTime.MaxValue;
AssignedBy = string.Empty;
IsCurrentAssignment = false;
Assignees = new List<string>();
FileStateInfo = new FileStateInfo();
}

/// <summary>
/// Preparation, Translation, Review, Finalisation
/// </summary>
public string Phase { get; set; }

public DateTime AssignedAt { get; set; }

public DateTime DueDate { get; set; }

public string AssignedBy { get; set; }

public bool IsCurrentAssignment { get; set; }

public List<string> Assignees { get; set; }

public FileStateInfo FileStateInfo { get; set; }
}
}
21 changes: 21 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/FileStateInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Trados.Transcreate.Model
{
public class FileStateInfo
{
public FileStateInfo()
{
LatestServerVersionTimestamp = string.Empty;
LatestServerVersionNumber = 0;
CheckedOutTo = string.Empty;
IsCheckedOutOnline = false;
}

public string LatestServerVersionTimestamp { get; set; }

public int LatestServerVersionNumber { get; set; }

public string CheckedOutTo { get; set; }

public bool IsCheckedOutOnline { get; set; }
}
}
38 changes: 38 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/FileVersionInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;

namespace Trados.Transcreate.Model
{
public class FileVersionInfo
{
public FileVersionInfo()
{
Guid = string.Empty;
VersionNumber = 0;
Size = 0;
FileName = string.Empty;
PhysicalPath = string.Empty;
CreatedAt = DateTime.MinValue;
CreatedBy = string.Empty;
FileTimeStamp = DateTime.MinValue;
IsAutoUpload = false;
}

public string Guid { get; set; }

public int VersionNumber { get; set; }

public long Size { get; set; }

public string FileName { get; set; }

public string PhysicalPath { get; set; }

public DateTime CreatedAt { get; set; }

public string CreatedBy { get; set; }

public DateTime FileTimeStamp { get; set; }

public bool IsAutoUpload { get; set; }
}
}
26 changes: 26 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/LanguageFileInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Collections.Generic;

namespace Trados.Transcreate.Model
{
public class LanguageFileInfo
{
public LanguageFileInfo()
{
Guid = string.Empty;
SettingsBundleGuid = string.Empty;
LanguageCode = string.Empty;
FileVersionInfos = new List<FileVersionInfo>();
FileAssignmentInfos = new List<FileAssignmentInfo>();
}

public string Guid { get; set; }

public string SettingsBundleGuid { get; set; }

public string LanguageCode { get; set; }

public List<FileVersionInfo> FileVersionInfos { get; set; }

public List<FileAssignmentInfo> FileAssignmentInfos { get; set; }
}
}
32 changes: 32 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/ProjectFileInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Collections.Generic;

namespace Trados.Transcreate.Model
{
public class ProjectFileInfo
{
public ProjectFileInfo()
{
Guid = string.Empty;
SettingsBundleGuid = string.Empty;
Name = string.Empty;
Path = string.Empty;
Role = string.Empty;
FilterDefinitionId = string.Empty;
LanguageFileInfos = new List<LanguageFileInfo>();
}

public string Guid { get; set; }

public string SettingsBundleGuid { get; set; }

public string Name { get; set; }

public string Path { get; set; }

public string Role { get; set; }

public string FilterDefinitionId { get; set; }

public List<LanguageFileInfo> LanguageFileInfos { get; set; }
}
}
17 changes: 17 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/ProjectUserInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Trados.Transcreate.Model
{
public class ProjectUserInfo
{
public string UserId { get; set; }

public string FullName { get; set; }

public string Description { get; set; }

public string Email { get; set; }

public string PhoneNumber { get; set; }

public string EmailType { get; set; }
}
}
16 changes: 16 additions & 0 deletions SDLTranscreate/SDLTranscreate/Model/SourceContentSettingsInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Trados.Transcreate.Model
{
public class SourceContentSettingsInfo
{
public bool AllowSourceEditing { get; set; }
public bool AllowMergeAcrossParagraphs { get; set; }
public bool EnableIcuTokenization { get; set; }

public SourceContentSettingsInfo()
{
AllowSourceEditing = false;
AllowMergeAcrossParagraphs = false;
EnableIcuTokenization = false;
}
}
}
Loading

0 comments on commit 63d4894

Please sign in to comment.