Socket
Socket
Sign inDemoInstall

@google-cloud/translate

Package Overview
Dependencies
199
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @google-cloud/translate

Google Translate API Client Library for Node.js


Version published
Weekly downloads
114K
decreased by-11.7%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@google-cloud/translate

Google Translate API Client Library for Node.js

Looking for more Google APIs than just Translate? You might want to check out google-cloud.

An API key is required for Translate. See Identifying your application to Google.

$ npm install --save @google-cloud/translate
var translate = require('@google-cloud/translate')({
  key: 'API Key'
});

// Translate a string of text.
translate.translate('Hello', 'es', function(err, translation) {
  if (!err) {
    // translation = 'Hola'
  }
});

// Detect a language from a string of text.
translate.detect('Hello', function(err, results) {
  if (!err) {
    // results = {
    //   language: 'en',
    //   confidence: 1,
    //   input: 'Hello'
    // }
  }
});

// Get a list of supported languages.
translate.getLanguages(function(err, languages) {
  if (!err) {
    // languages = [
    //   'af',
    //   'ar',
    //   'az',
    //   ...
    // ]
  }
});

Keywords

FAQs

Last updated on 30 Aug 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc