https://github.com/sixem/srt-translate
A package that translates .srt files using Google Cloud Translate.
https://github.com/sixem/srt-translate
api cloud google srt srt-translate translate
Last synced: 11 months ago
JSON representation
A package that translates .srt files using Google Cloud Translate.
- Host: GitHub
- URL: https://github.com/sixem/srt-translate
- Owner: sixem
- License: mit
- Created: 2022-07-01T14:17:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-03T04:02:13.000Z (almost 4 years ago)
- Last Synced: 2025-02-13T00:35:19.834Z (over 1 year ago)
- Topics: api, cloud, google, srt, srt-translate, translate
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/srt-translate
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
srt-translate
A package that translates .srt files using Google Cloud Translate.
# Usage
## Command Line (CLI):
#### Install the package globally:
```bash
sudo npm install -g srt-translate
```
#### Usage:
```bash
srt-translate --key "one-drive-000000-00000x00xxxx.json" --input source.srt --output output.srt --target en
```
## Node:
#### Install the package:
```bash
sudo npm install srt-translate
```
#### Usage:
```js
/* 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` | :heavy_check_mark: | `None` | Your Google Cloud API JSON file. See [Google's Setup Page](https://cloud.google.com/translate/docs/setup) 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](https://cloud.google.com/translate/docs/languages) for more information.
| `delay` | :x: | `200` | Delay between requests made to Google Translate.
| `silent` | :x: | `False` | Disables the printing of translated lines.