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.
- Host: GitHub
- URL: https://github.com/animatedcreativity/modernmt-translate
- Owner: animatedcreativity
- Created: 2020-07-07T05:13:05.000Z (almost 6 years ago)
- Default Branch: glitch
- Last Pushed: 2020-07-08T07:27:30.000Z (almost 6 years ago)
- Last Synced: 2025-10-10T13:26:37.102Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/