GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nanek/mstranslator: DEPRECATED: Microsoft Translator API module for node.js

BranchesTags
Open more actions menu

Latest commit

 

History

117 Commits
117 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
.env.example
.env.example
 
 
.eslintrc
.eslintrc
 
 
.gitignore
.gitignore
 
 
.nvmrc
.nvmrc
 
 
API.md
API.md
 
 
LICENSE-MIT
LICENSE-MIT
 
 
README.md
README.md
 
 
example.js
example.js
 
 
mstranslator.js
mstranslator.js
 
 
package.json
package.json
 
 

Repository files navigation

DEPRECATED

Microsoft Translator API module for node.js

NOTE: This module currently only supports V2 of the API which will be discontinued on April 30, 2019. https://docs.microsoft.com/en-us/azure/cognitive-services/translator/migrate-to-v3

See https://github.com/MicrosoftTranslator/Text-Translation-API-V3-NodeJS for examples of working with v3.

Methods

Microsoft Translator API Reference

API Docs

  • addTranslation
  • addTranslationArray (not implemented)
  • breakSentences (not working)
  • detect
  • detectArray
  • getLanguageNames
  • getLanguagesForSpeak
  • getLanguagesForTranslate
  • getTranslations
  • getTranslationsArray
  • speak
  • translate
  • translateArray
  • translateArray2

Installation

$ npm install mstranslator

An API key from portal.azure.com is needed to create a token as of April 30, 2017. See Microsoft Translator API Documentation. For details on previous authentication API and migration info

Example Usage - Auto-generated token

var MsTranslator = require('mstranslator');
// Second parameter to constructor (true) indicates that
// the token should be auto-generated.

var client = new MsTranslator({
  api_key: "your portal.azure.com api key"
}, true);

var params = {
  text: 'How\'s it going?',
  from: 'en',
  to: 'es'
};

// Don't worry about access token, it will be auto-generated if needed.
client.translate(params, function(err, data) {
  console.log(data);
});

Example Usage - Generate token manually

var MsTranslator = require('mstranslator');

var client = new MsTranslator({
  api_key: "your portal.azure.com api key"
}, true);

var params = {
  text: 'How\'s it going?',
  from: 'en',
  to: 'es'
};

// Using initialize_token manually.
client.initialize_token(function(err, keys) {
  console.log(keys);
  client.translate(params, function(err, data) {
    console.log(data);
  });
});

Tests

npm test

License

Licensed under the MIT license.

About

DEPRECATED: Microsoft Translator API module for node.js

Topics

archivedobselete

Resources

Readme
MIT license
Activity

Stars

77 stars

Watchers

6 watching

Forks

22 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.