translat
v0.0.2
Published
Translation using just page-fetching
Downloads
4
Readme
translat
Translation using just page-fetching
Imortant
While using languages like Chinese, all inputs are reguarded as sentences, so they are probably capitalized.
Usage
npm install translat
var translat = require('translat'),
translator = translat.create({
from: 'en', to: 'zh-CN'
});
translator.get('I love you', function(err, result){
console.log(result); // 我爱你
});
// dynamically switching languages
translator.defaults({
from: 'fr', to: 'en'
}).get("Je t'aime", function(err, result){
console.log(result); // I love you
});
Testing
Make sure that you have
mocha
installed globally.npm install -g mocha
Download the package from the repository.
Run from inside.
cd translat npm test