cjvnjde / google-translate-api-browser

A free and unlimited API for Google Translate
https://www.npmjs.com/package/google-translate-api-browser
MIT License
213 stars 31 forks source link

How to run in browser version ? #7

Closed SylvainNZ closed 5 years ago

SylvainNZ commented 5 years ago

Hi, could you provide some instruction on how to test the browser version ? I downloaded all the files in the sample app to the same folder but when I run index.html I get the following error:

browser version

Can I include google-translate-api-browser without using Node ?

SylvainNZ commented 5 years ago

I managed to make a PowerShell script to use Google translate but still the JS can be handy for on the fly translation.

cjrsgu commented 5 years ago

The examples use bundler (parcel) because there are dependencies with npm modules.. If you are using powershell to run example you need to run following commands yarn install; yarn start (or npm install; npm start). I added command to package.json to build a file that can be used without node. Just type yarn run build