2.3.7 • Published 4 years ago
translate-json-object v2.3.7
Translate a JSON Object
A Node.js module to translate a JSON object from a detectable language to any other language via
⍗ Install
npm i translate-json-object
Example
// Require the module and instantiate instance
var TJO = require('translate-json-object')();
// Choose the service to use google/yandex,
// if you provide both yandex will be used as the default
TJO.init({
googleApiKey: 'api_key',
yandexApiKey: 'api_key'
});
// An example scenario (json) object
var example = {
"name": "Please enter your name",
"list": ["translate", "object", "made", "easy"],
"nested": {
"hello": "hello",
"world": "world"
}
};
// Translate method takes (source object, and language code)
TJO.translate(example, 'es')
.then(function(data) {
console.log(data);
}).catch(function(err) {
console.log('error ', err)
});
RESULT ↴
{ name: 'por favor, escriba su nombre',
list: [ 'traducir', 'objeto', 'hecho', 'fácil' ],
nested: { hello: 'Hola', world: 'mundo' }
}
◉ API
See API Doc
✼ Others
TODO 🔧
✔︎ Adding yandex service v2.1.0
✔︎ Unit test v2.1.4
✔︎ JS Linting v2.1.3
✔︎ semantic-release-cli v2.2.0
☐ Adding bing translate service
☐ Adding cli utility
Reach Out ☮
- ⚐ Feedback via GitHub Issues
- ♡ Welcome all Contribution
2.3.7
4 years ago
2.3.6
4 years ago
2.3.5
5 years ago
2.3.4
5 years ago
2.3.3
5 years ago
2.3.2
5 years ago
2.3.1
5 years ago
2.3.0
7 years ago
2.2.1
7 years ago
2.2.0
7 years ago
2.1.4
7 years ago
2.1.3
7 years ago
2.1.2
7 years ago
2.1.1
7 years ago
2.1.0
7 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago