[nodejs] [ANN] translate.js - translate text from one language to another on node.js and the browser. 30+ languages supported, simple as cake.

189 views
Skip to first unread message

Marak Squires

unread,
Jun 13, 2010, 3:06:07 AM6/13/10
to nodejs, ny...@googlegroups.com
hello internet friends-

i've created a javascript babel fish! 

translate.js - translate text from one language to another on node.js and the browser. 30+ languages supported, simple as cake.


i wouldn't use the current translation engine for anything too serious, but i think this is a great start! thanks to everyone who helped out!

    var translate = require('./translate');

    // set the input language
    translate.input('English'); //

    // set the output language
    translate.output('Spanish');

    // note: if you don't specify an input or output language, translate.js will attempt to autodetect your input and set your output to English
    translate.text('yo quero tacos por favor', function(text){
      sys.puts(text); // outputs : i want tacos please
    }); 

-marak

Marak Squires

unread,
Jun 13, 2010, 4:15:48 AM6/13/10
to nodejs
oops

// set the input language
translate.input('Spanish');

// set the output language
translate.output('English');
Reply all
Reply to author
Forward
0 new messages