potamides / pantran.nvim

Use your favorite machine translation engines without having to leave your favorite editor.
MIT License
289 stars 2 forks source link

fix(yandex,curl): fixed yandex v2, changes to curl #18

Closed infastin closed 1 year ago

infastin commented 1 year ago

Yandex Translator API v2 wasn't working. This PR fixes that. Part of the problem was that the API accepts JSON (as i think), so now if any engine sets Content-Type header equal to "application/json", curl will create a request with a valid JSON body instead of passing data as plain parameters.

potamides commented 1 year ago

Thank you for testing the Yandex endpoint (issue #1) and providing a pull request!