Socket
Socket
Sign inDemoInstall

translate-json-object

Package Overview
Dependencies
56
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    translate-json-object

Translate a JSON object to any language via google or yandex translate API


Version published
Weekly downloads
515
decreased by-23.93%
Maintainers
1
Install size
9.79 MB
Created
Weekly downloads
 

Readme

Source

Translate a JSON Object

Build Status Codacy Badge Version Downloads

↳ Links: NPM | GitHub

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 ☮

License semantic-release Commitizen friendly

Keywords

FAQs

Last updated on 28 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc