google-translate-api icon indicating copy to clipboard operation
google-translate-api copied to clipboard

Doesn't work in browser

Open Svetomechc opened this issue 5 years ago • 5 comments

I'm trying to use this in an Angular 7 app, but it seems this is not possible?

Svetomechc avatar Jan 29 '19 10:01 Svetomechc

This lib is for Node.js.

vitalets avatar Jan 29 '19 15:01 vitalets

It doesn't work in browser because it uses cross origin requests. I made it work here google-translate-api-browser. It uses cors-anywhere

cjrsgu avatar Mar 06 '19 13:03 cjrsgu

It doesn't work in browser because it uses cross origin requests. I made it work here google-translate-api-browser. It uses cors-anywhere

I think you should definitely mention that all requests are proxied via http://cors-anywhere.herokuapp.com. If that app goes down or your users pass sensitive data for translation - it may have impact on you.

vitalets avatar Mar 06 '19 14:03 vitalets

Ye. @cjvnjde, I carried over the additions and fixes that were added recently into vitalets' fork of this repo over to yours. Go ahead and take a look at that PR and see if things still work like they should over there with the new code in place.

rawr51919 avatar Mar 19 '19 12:03 rawr51919

In case others are looking here is an up-to-date axios port: https://github.com/AidanWelch/google-translate-api

AidanWelch avatar Jun 08 '22 00:06 AidanWelch