Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ytrans.js

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytrans.js

Unofficial Yandex translation services API

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ytrans.js Build Status NPM

  • Unofficial Node.js API for Yandex translation services.

  • You'll need an API key in order to access the translation service.

Usage:

  • If you don't already have one, get an API key here
    var ytrans = require('ytrans.js');
    var yt = new ytrans();
    yt.set_key(API_KEY);

    yt.translate('Hello there!', function(err, result) {
        ...;
    });
    yt.set_default_lang("sk", function(err, success) {
        if (err || ! success)
            console.log("Failed to set the default language: look at results ", arguments);
        else
            console.log("Successfully set the default language!");
    });
    yt.translate({
        text: ['кофе', 'Я знаю, французской и правда'], lang: 'de'
    }, function(err, translation) {
        ...;
    });
    var ytk = new ytrans({api_key_path: API_KEY_PATH});
    ytk.get_allowed_translations("uk", function(err, secondaries) {
        ...;
    });
    var ytk1 = new ytrans(API_KEY_PATH);
    ytk1.translate_file({
        path: TARGET_FILE, lang: 'cs-ru'
    }, function(err, content) {
        ...;
    });

    ytk1.is_allowed_transition("ru", "ch", function(err, validity) {
        ...;
    });
    var catfish = new ytrans(API_KEY_PATH);
    catfish.translate({
        text: ["Je sais espagnol pour de vrai, je suis couché LOL"], lang: "es"
    }, function(err, res) {
        ...;
    });

Keywords

FAQs

Package last updated on 16 Feb 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc