0.0.2 • Published 10 years ago

translat v0.0.2

Weekly downloads
2
License
-
Repository
github
Last release
10 years ago

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

  1. Make sure that you have mocha installed globally.

    npm install -g mocha
  2. Download the package from the repository.

  3. Run from inside.

    cd translat
    npm test