You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A misleading error message (400: Bad Request) is returned when unsupported languages are used with the DeepL API. Since DeepL only supports a rather small subset of languages, it would be nice to be informed when a selected target language was unsupported by the API.
To Reproduce
Attempt to translate text from any language to an unsupported one (e.g. Korean [ko]). The error message displayed is: DeepL: Response status code does not indicate success: 400 (Bad Request)
Expected behavior
A more helpful message should be shown (e.g. The target language is not supported by this API)
The text was updated successfully, but these errors were encountered:
Looking at the DeepL API, it doesn't seem to return any specific error regarding unsupported language. Just 400 (Bad Request). We can't assume all 400 BAD REQUEST are going to be due to unsupported language issue. Does it make sense to make an additional API call to /languages to check if the language is supported or not?
I would make the supported languages API call the first time the user requests a DeepL translation. Then just cache the list for the lifetime of the extension/program and pop up a warning message when an unsupported language is used.
Describe the bug
A misleading error message (400: Bad Request) is returned when unsupported languages are used with the DeepL API. Since DeepL only supports a rather small subset of languages, it would be nice to be informed when a selected target language was unsupported by the API.
There is an endpoint to fetch supported langs documented here: https://www.deepl.com/docs-api/other-functions/listing-supported-languages/
To Reproduce
Attempt to translate text from any language to an unsupported one (e.g. Korean [ko]). The error message displayed is:
DeepL: Response status code does not indicate success: 400 (Bad Request)
Expected behavior
A more helpful message should be shown (e.g.
The target language is not supported by this API
)The text was updated successfully, but these errors were encountered: