nidhaloff / deep-translator

A flexible free and unlimited python tool to translate between different languages in a simple way using multiple translators.
https://deep-translator.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
1.61k stars 185 forks source link

Deepl doesn't work #276

Open Simanas opened 1 month ago

Simanas commented 1 month ago

Description

Tried using django-deep-translator, with Deepl backend, however it doesn't work due to wrong Deepl API implementation on this package.

What I Did

./manage.py translate_messages -l pl

raises error: deep_translator.exceptions.AuthorizationException: Unauthorized access with the api key 6d91d25b-8aae-a083-dca5-d8e78a74d9cc

Possible fix

After quick investigation I have found that current DeepL API uses authorization in request header. https://github.com/DeepLcom/deepl-python/blob/main/deepl/translator.py

While this package is trying to add it to a request itself.