An open API service indexing awesome lists of open source software.

https://github.com/animatedcreativity/modernmt-translate

Text translations using ModernMT.
https://github.com/animatedcreativity/modernmt-translate

Last synced: 4 months ago
JSON representation

Text translations using ModernMT.

Awesome Lists containing this project

README

          

# 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: ""});
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://",
authorization: ""
}
});
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/