Translations from German to English generate errors
See original GitHub issueHello,
we use version 1.0.4.
If we try to translate “Dog” from english to german like this …
var translator = new Translator(Settings.DeeplTranslatorTextKey); TextResult textResult = await translator.TranslateTextAsync(“Dog”, LanguageCode.EnglishAmerican, LanguageCode.German);
… we get the following error:
Bad request, message: Value for ‘source_lang’ not supported.
at DeepL.Internal.DeepLClient.<CheckStatusCodeAsync>d__10.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at DeepL.Translator.<TranslateTextAsync>d__8.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at DeepL.Translator.<TranslateTextAsync>d__9.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult()
If we try to translate “Hund” from german to english, everything works fine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thank you for your quick reply!
Now I understood the trick: The source language must be LanguageCode.English and must not be LanguageCode.EnglishAmerican or LanguageCode.EnglishBritish, while the target language must be LanguageCode.EnglishAmerican or LanguageCode.EnglishBritish but must not be LanguageCode.English, otherwise it will generate the following error message: targetLanguageCode=“en” is deprecated, please use “en-GB” or “en-US” instead.
Thanks for the help!
Hi @daniel-jones-deepl, I have tested it on my end, and unfortunately, I couldn’t find any documentation related to
Language
enum. I have thoroughly examined the source code by decompiling and even checked the IDE (Rider), but to no avail. Do you think it’s possible that the documentation got lost during the Nuget building process?