gtrans
Installation
npm install gtrans
Duh.
Translation Example
var gtrans = ; var t = "apikey"; var opts = text: "Hello, world!" source: "en" // This is optional. Language can be auto-detected. target: "de"; t;
Console output:
translatedText: 'Hallo Welt!'
Language Detection Example
var gtrans = ; var t = "apikey"; t;
Console output:
language: 'en' isReliable: false confidence: 07100697
gtrans can also detect multiple strings, like this.
t
Running tests
npm install
- Rename
test/key.template.json
totest/key.json
and add your Google Translate API key npm test