A fast and simple CLI tool for translating SRT subtitle files between languages using Google Translate.
- 🌍 Translate subtitles to any language with auto-detection
- 📝 Preserves original timing
- 🚀 Batch translation for improved speed
- 💯 Free - uses Google Translate's public API
- ⚡ Progress indicator during translation
- 🔄 Two modes: create new file or replace original
Download pre-built binaries from the releases page.
Or install using Go:
go install github.com/celso-alexandre/subterfuge@latestOr build from source (requires Go installed):
git clone https://github.com/celso-alexandre/subterfuge.git
cd subterfuge
go buildsubterfuge [command] [options] <input.srt>extract- Extract SRT file out of video file (requires ffmpeg)translate- Translate the given SRT file
-s <lang>- Source language (default:autofor auto-detection)-t <lang>- Target language (default:en)-m <mode>- Output mode:createorreplace(default:create)
Extract SRT subtitle from video:
subterfuge extract movie.mp4
# Creates: movie.srtTranslate to Portuguese (replace mode):
subterfuge translate -t pt -m replace movie.srt
# Renames original to: movie.<input-lang>.srtTranslate to Spanish, creating a new file:
subterfuge translate -t es -m create movie.srt
# Creates: movie.es.srtTranslate from French to Japanese:
subterfuge translate -s fr -t ja -m create anime.srt
# Creates: anime.ja.srt- Creates new file:
filename.<output-lang>.srt - Compatible with VLC and other media players' auto-detection
- Renames original file to
filename.<input-lang>.srt - Replaces input file with translated content
Use ISO 639-1 language codes:
| Language | Code | Language | Code |
|---|---|---|---|
| English | en |
Spanish | es |
| Portuguese | pt |
French | fr |
| Portuguese (Brazil) | pt-br |
German | de |
| Italian | it |
Japanese | ja |
| Korean | ko |
Chinese | zh |
| Russian | ru |
Arabic | ar |
- (Optional) Extracts SRT from video using ffmpeg
- Parses the input SRT file into subtitle blocks
- Auto-detects source language if not specified
- Outputs translated SRT file with original timing preserved
- Shows real-time progress during translation
- Uses unofficial Google Translate API (rate limits may apply)
- Includes small delays between batches to avoid rate limiting
- Best for personal/non-commercial use
Contributions welcome! Please open an issue or submit a pull request.
MIT