txl.el
txl.el copied to clipboard
How to fix Authorization failed?
With region marked e.g. "Guten Tag"
C-x t
txl-translate-region-or-paragraph
Authorization failed. Please supply a valid authkey parameter
(add-to-list 'load-path "~/src/txl.el")
(require 'txl)
(setq txl-languages '(DE . EN-US))
(setq txl-deepl-api-key "my_free_dev_deepl_api_key")
(global-set-key (kbd "C-x t") 'txl-translate-region-or-paragraph)
.
curl -H "Authorization: DeepL-Auth-Key my_free_dev_deepl_api_key" https://api-free.deepl.com/v2/usage
{"character_count":0,"character_limit":500000}
Nice work, thank you
You're configuration looks fine to me. Perhaps the free dev key doesn't work for this purpose? Worth checking with DeepL.
Changing the domain according to their api introduction solved the issue
Excerpt api introduction
...Please note that the API domain is different for each DeepL API plan, so please make sure to use the correct domain.
Interesting. I wasn't aware of that. Will have to add something to the documentation. Thanks!
I added a new defcustom for the API URL. Please see here and let me know if it works. And sorry: only now I noticed that you had made a PR. In my e-mail program it looked like an issue. Either way, thanks for your contribution.