srt-translate
A package that translates .srt files using Google Cloud Translate.
Usage
Command Line (CLI):
Install the package globally:
sudo npm install -g srt-translate
Usage:
srt-translate --key "one-drive-000000-00000x00xxxx.json" --input source.srt --output output.srt --target en
Node:
Install the package:
sudo npm install srt-translate
Usage:
import srtTranslate from 'srt-translate';
let translate = new srtTranslate({
key: 'one-drive-000000-00000x00xxxx.json',
input: 'source.srt',
output: 'output.srt',
target: 'en'
});
translate.init();
Options
Option | Required | Default | Description |
---|
key | :heavy_check_mark: | None | Your Google Cloud API JSON file. See Google's Setup Page for more information. |
input | :heavy_check_mark: | None | Your .srt input file. |
output | :heavy_check_mark: | None | Your .srt output destination. |
target | :heavy_check_mark: | None | Target language (en , ru and so on). See language support for more information. |
delay | :x: | 200 | Delay between requests made to Google Translate. |
silent | :x: | False | Disables the printing of translated lines. |