Closed mattbrannon closed 2 years ago
Hi Matt, this is a good suggestion, thanks.
It will take some time to change to our backend; I'll post an update when it is changed.
I just want to add my support for this feature, it would be easier to set up the requests that way.
Hello again, we've added two new allowed formality values: prefer_less
and prefer_more
. They have the same function as less
and more
respectively if the target language supports formality, otherwise they fallback to the default
formality. With these two values you will not get the error mentioned above.
Currently, a request that specifies a formality setting not yet supported by DeepL returns an error without a translation.
DeepLError: Bad request, message: 'formality' is not supported for given 'target_lang'.
Maybe a more user friendly alternative would be to just ignore any unsupported options in the request, possibly attaching a warning message to the response informing the user of their mistake. This way, applications that call the DeepL api won't break when supplied an invalid configuration.