Skip to content

Commit

Permalink
Microsoft Translator 2.0.3.1: Throw exception when retrieval of suppo…
Browse files Browse the repository at this point in the history
…rted languages fails
  • Loading branch information
ealbu committed Oct 14, 2024
1 parent 67ed5a8 commit 432d968
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="LanguageMappingProvider" Version="1.0.92" />
<PackageReference Include="RestSharp" Version="107.3.0" />
<PackageReference Include="Sdl.Core.PluginFramework">
<Version>2.1.0</Version>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion MicrosoftTranslatorProvider/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.3.0")]
[assembly: AssemblyFileVersion("2.0.3.1")]
4 changes: 4 additions & 0 deletions MicrosoftTranslatorProvider/Service/MicrosoftService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public static async Task<List<TranslationLanguage>> GetSupportedLanguages()

var response = await httpClient.GetAsync(url);
var responseBody = await response.Content.ReadAsStringAsync();

if (!response.IsSuccessStatusCode)
throw new Exception($"Error: {response.StatusCode}, {responseBody}");

var languagesResponse = JsonConvert.DeserializeObject<LanguagesResponse>(responseBody);

var output = languagesResponse.Translation.Select(x => new TranslationLanguage()
Expand Down
2 changes: 1 addition & 1 deletion MicrosoftTranslatorProvider/pluginpackage.manifest.xml
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>Microsoft Translator Provider</PlugInName>
<Version>2.0.3.0</Version>
<Version>2.0.3.1</Version>
<Description>Microsoft Translator Provider</Description>
<Author>Trados AppStore Team</Author>
<RequiredProduct name="TradosStudio" minversion="18.0" maxversion="18.9" />
Expand Down

0 comments on commit 432d968

Please sign in to comment.