Skip to content

animatedcreativity/modernmt-translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

modernmt-translate

Text translations using ModernMT.
See also: https://www.npmjs.com/package/modernmt-translate-server

Can translate full HTML documents.

Usage

var modernmtTranslate = require("modernmt-translate");
var translate = new modernmtTranslate({key: "<your_api_key_goes_here>"});
translate.languages().then(function(languages) {
  console.log(languages);
}).catch(function(error) {
  console.log(error);
});
translate.translate("This is a test line.", "eng", "swe").then(function(text) {
  console.log(text);
}).catch(function(error) {
  console.log(error);
});

Usage with modernmt-translate-server

var modernmtTranslate = require("modernmt-translate");
var translate = new modernmtTranslate({
  server: {
    use: true,
    link: "https://<your_server_name>",
    authorization: "<your_server_authorization_key>"
  }
});
translate.languages().then(function(languages) {
  console.log(languages);
}).catch(function(error) {
  console.log(error);
});
translate.translate("This is a test line.", "eng", "swe").then(function(text) {
  console.log(text);
}).catch(function(error) {
  console.log(error);
});

For API key:
https://www.modernmt.com/pricing/

About

Text translations using ModernMT.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published