Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 the package */
import srtTranslate from 'srt-translate';

/* Create a class instance */
let translate = new srtTranslate({
    key: 'one-drive-000000-00000x00xxxx.json',
    input: 'source.srt',
    output: 'output.srt',
    target: 'en'
});

/* Initialize the translation */
translate.init();

Options

Option Required Default Description
key ✔️ None Your Google Cloud API JSON file. See Google's Setup Page for more information.
input ✔️ None Your .srt input file.
output ✔️ None Your .srt output destination.
target ✔️ None Target language (en, ru and so on). See language support for more information.
delay 200 Delay between requests made to Google Translate.
silent False Disables the printing of translated lines.

About

A package that translates .srt files using Google Cloud Translate.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages