Google Translate Api Wrapper
Convert text to different languages on the browser. Flexible package and powerful back-end using Google :
Getting started
This package can be used in on the browser. For the browser we are using fetch
, so you might want to polyfill it depending on the browsers you support.
Install:
npm install google-translate-api-wrapper
Then import it to use it:
To use it in the browser download the main translate.min.js
file and include it:
Options
The first parameter is the string that you want to translate. Right now only a single string of text is accepted.
The second parameter is the options. It accepts either a String
of the language to translate to or a simple Object
with these options:
Examples:
// Translate from Indonesia to Englishconst foo = await
Authors and thanks
Current package and development: Thofik Wiranata