Skip to content

Commit

Permalink
Export Analysis Reports 6.0.1.0 - SDLCOM-5894: Implemeneted method th…
Browse files Browse the repository at this point in the history
…at a given file is an Anlysis Report file and fixed the Tell Me typos and icons
  • Loading branch information
aflorescu579774 committed Dec 13, 2024
1 parent c2a9671 commit 2db611c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.0.0.0")]
[assembly: AssemblyFileVersion("6.0.0.1")]
[assembly: AssemblyFileVersion("6.0.1.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ private OptionalInformation SetOptionalInformation()
IncludePerfectMatch = perfectMatch.Checked
};
}

private void SetProjectDataSource()
{
projListbox.DataSource = _projectsDataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,7 @@ private bool ReportFileExist(string reportFolderPath)
if (Directory.Exists(reportFolderPath))
{
var files = Directory.GetFiles(reportFolderPath);
return files.Any(file => new FileInfo(file).Name.Contains("Analyze Files") &&
file.EndsWith(".xml", StringComparison.CurrentCultureIgnoreCase));
return files.Any(file => IsAnalyzeFileReport(file));
}

if (!string.IsNullOrEmpty(fileName) && fileName.Contains("ProjectFiles") && Directory.Exists(reportFolderPath))
Expand All @@ -447,6 +446,30 @@ private bool ReportFileExist(string reportFolderPath)
return false;
}

private bool IsAnalyzeFileReport(string filePath)
{
try
{
if (!filePath.EndsWith(".xml"))
{
return false;
}

var firstLine = File.ReadLines(filePath).FirstOrDefault();

if (firstLine != null && firstLine.Trim().StartsWith("<task name=\"analyse\">"))
{
return true;
}

return false;
}
catch (Exception _)
{
return false;
}
}

// Configure the details used in the exported report
private void ConfigureReportDetails(ProjectDetails project, ProjectInfo projectInfo, XmlNode report, XmlDocument doc)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ public class CommunitySupportAction : ExportAnalysisReportAbstractTellMeAction
{
public CommunitySupportAction()
{
Name = "RWS Community AppStore forum";
Name = "RWS Community AppStore Forum";
}

public override Icon Icon => PluginResources.ForumIcon;
public override Icon Icon => PluginResources.Question;

public override void Execute()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ExportAnalysisReportAction()
Name = PluginResources.Plugin_Name;
}

public override Icon Icon => PluginResources.folder2_blue;
public override Icon Icon => PluginResources.Settings;

public override void Execute() => SdlTradosStudio.Application?.GetAction<ReportExporter>().ExecuteAction();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PluginPackage xmlns="http://www.sdl.com/Plugins/PluginPackage/1.0">
<PlugInName>Trados Studio – Export Analysis Reports</PlugInName>
<Version>6.0.0.1</Version>
<Version>6.0.1.0</Version>
<Description>Plugin which exports Trados Studio analysis report to CSV</Description>
<Author>Trados AppStore Team</Author>
<Include>
Expand Down

0 comments on commit 2db611c

Please sign in to comment.