Skip to content

Commit

Permalink
Merge pull request #8 from bb-io/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ce-nistal authored May 16, 2024
2 parents a178b57 + d540e67 commit d687def
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions Apps.Crowdin/Actions/TaskActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Blackbird.Applications.Sdk.Utils.Utilities;
using Crowdin.Api.Tasks;
using TaskStatus = Crowdin.Api.Tasks.TaskStatus;
using System.IO;

namespace Apps.Crowdin.Actions;

Expand Down Expand Up @@ -127,8 +128,8 @@ [ActionParameter] [Display("Task ID")] string taskId)
if (downloadLink is null)
throw new("No string found for this task");

var fileContent = await FileDownloader.DownloadFileBytes(downloadLink.Url, _fileManagementClient);

return new(fileContent);
var fileContent = await FileDownloader.DownloadFileBytes(downloadLink.Url);
var file = await _fileManagementClient.UploadAsync(fileContent.FileStream, fileContent.ContentType, fileContent.Name);
return new(file);
}
}
3 changes: 1 addition & 2 deletions Apps.Crowdin/Actions/TranslationActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public async Task<PreTranslationEntity> PreTranslate(
EngineId = intEngineId,
DuplicateTranslations = input.DuplicateTranslations,
TranslateUntranslatedOnly = input.TranslateUntranslatedOnly,
TranslateWithPerfectMatchOnly = input.TranslateWithPerfectMatchOnly,
MarkAddedTranslationsAsDone = input.MarkAddedTranslationsAsDone
TranslateWithPerfectMatchOnly = input.TranslateWithPerfectMatchOnly
};
var response = await client.Translations
.ApplyPreTranslation(intProjectId!.Value, request);
Expand Down
6 changes: 4 additions & 2 deletions Apps.Crowdin/Actions/TranslationMemoryActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Blackbird.Applications.Sdk.Utils.Parsers;
using Blackbird.Applications.Sdk.Utils.Utilities;
using Crowdin.Api.TranslationMemory;
using System.IO;

namespace Apps.Crowdin.Actions;

Expand Down Expand Up @@ -114,8 +115,9 @@ public async Task<DownloadFileResponse> DownloadTranslationMemory(
var client = new CrowdinClient(Creds);

var response = await client.TranslationMemory.DownloadTm(intTmId!.Value, input.ExportId);
var fileContent = await FileDownloader.DownloadFileBytes(response.Url, _fileManagementClient);
return new(fileContent);
var fileContent = await FileDownloader.DownloadFileBytes(response.Url);
var file = await _fileManagementClient.UploadAsync(fileContent.FileStream, fileContent.ContentType, fileContent.Name);
return new(file);
}

[Action("Add translation memory segment", Description = "Add new segment to the translation memory")]
Expand Down
6 changes: 3 additions & 3 deletions Apps.Crowdin/Apps.Crowdin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<Nullable>enable</Nullable>
<Product>Crowdin</Product>
<Description>Cloud-based solution that streamlines localization management</Description>
<Version>1.0.3</Version>
<Version>1.0.4</Version>
<AssemblyName>Apps.Crowdin</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blackbird.Applications.Sdk.Common" Version="2.6.0" />
<PackageReference Include="Blackbird.Applications.SDK.Extensions.FileManagement" Version="1.0.1" />
<PackageReference Include="Blackbird.Applications.Sdk.Utils" Version="1.0.16" />
<PackageReference Include="Crowdin.Api" Version="2.17.1" />
<PackageReference Include="Blackbird.Applications.Sdk.Utils" Version="1.0.25" />
<PackageReference Include="Crowdin.Api" Version="2.22.1" />
<PackageReference Include="MimeTypes" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ public class PreTranslateRequest
[Display("Translate with perfect match only")]
public bool? TranslateWithPerfectMatchOnly { get; set; }

[Display("Mark added translations as done")]
public bool? MarkAddedTranslationsAsDone { get; set; }
}

0 comments on commit d687def

Please sign in to comment.