Skip to content

GetTargetLanguagesAsync() and TranslateTextAsync() are not aligned and cause errors #77

@sjoerdbroos1996

Description

@sjoerdbroos1996

Describe the bug
GetTargetLanguagesAsync() gives de-DE and de in the result. However TranslateTextAsync() doesn't accept de-DE as a target language. This used to be no problem, however this changed recently. You can see this behavior in the screenshot. Perhaps this happens with more supported target languages that are actually not supported by the TranslateTextAsync().

To Reproduce
Steps to reproduce the behavior:

  1. Make a console app and use the same code as provided in the GitHub to get target languages and translate with TranslateTextAsync.
  2. As an example see the code below. I had as the source language "en".
  3. Error that I got: "type": "DeepL.DeepLException",
    "message": "Bad request, message: Unsupported language pair: 'en' => 'de-DE'.",
    "source": "DeepL.net",
    "stackTrace": " at DeepL.Internal.DeepLHttpClient.CheckStatusCodeAsync(HttpResponseMessage responseMessage, Boolean usingGlossary, Boolean downloadingDocument)\r\n at DeepL.Translator.TranslateTextAsync(IEnumerable`1 texts, String sourceLanguageCode, String targetLanguageCode, TextTranslateOptions options, CancellationToken cancellationToken)\r\n at DeepL.Translator.TranslateTextAsync(String text, String sourceLanguageCode, String targetLanguageCode, TextTranslateOptions options, CancellationToken cancellationToken)\r\n ...

Expected behavior
This code should give a translation. Either the de-DE should be removed in the supported target languages or the TranslateTextAsync should give a result when I give any of the supported target languages.

Screenshots or sample code
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions