transleight

0.2.0 • Public • Published

transleight

Node.js translation stream module

What is transleight

transleight is a Stream. So everything you pipe into it, is transformed in the target language you specified. LANGUAGE-A => transleight => LANGUAGE-B

Super easy!

The translation is powered by Google Translate

APIs

transleight offers two apis:

  • transleight.stream(lang) : it returns a stream that converts every text that receives in input, into text in language lang.
  • transleight.supportedLangs() : it returns an object containing all the supported languages. Every entry has the Language as key and the Code as value. E.g. json{ English : 'en' }.

Installation

transleight is on https://www.npmjs.org

npm install transleight

Examples

The examples folder contains more code.

transleight should be used like every other stream:

var trnsl8 = require('transleight');
 
streamA.pipe(trnsl8.stream('targetLanguage')).pipe(streamB);

ToDo

  • Sentence Boundary Splitting
  • Accept Encoding gzip

License

MIT

Package Sidebar

Install

npm i transleight

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • indiependente