MCPcopy Index your code
hub / github.com/VjayC/SRT-Subtitle-Translator-Validator

github.com/VjayC/SRT-Subtitle-Translator-Validator @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
163 symbols 300 edges 35 files 0 documented · 0% updated 2mo agov1.5.0 · 2026-05-01★ 88
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SRT Translator & Validator

SRT Translator & Validator Icon

MIT License GitHub Release Star this repo

A comprehensive browser-based and desktop tool that leverages Large Language Models (LLMs) to translate SRT subtitle files and automatically validate the output for common errors. Built specifically to create high-quality, script-accurate subtitles using your existing LLM subscriptions (Gemini, ChatGPT, Claude, etc.) via CLIProxyAPI.

Input SRT in English Output of translated SRT in Tenglish

[!NOTE] Screenshots are taken from Psych, an American detective comedy-drama television series created by Steve Franks for USA Network.

Motivation

My mom loves to watch movies and TV shows, but she isn't fluent in English. Properly translated subtitles are the perfect way for her to enjoy and understand the content. When I set out to find a subtitle translator powered by mainstream LLMs, I hit several roadblocks.

Existing solutions either required expensive paid API keys, charged high per-token rates (I tested commercial options like GPT Subtitler, but the pricing was unsustainable for my regular usage), or completely lacked the ability to detect and automatically fix the subtle formatting errors LLMs often introduce. Furthermore, I wanted a way to leverage my existing Gemini subscription rather than paying separately for API usage—which this tool achieves via CLIProxyAPI.

While Large Language Models are incredibly powerful and can translate subtitles in minutes, they often introduce subtle errors without strict oversight, such as:

  • Timestamp Drift: The model may slightly alter timestamps, causing subtitles to appear too early or too late.
  • Character "Hallucinations": When translating for a specific language (like Telugu), the model might mistakenly insert characters from a similar-looking but incorrect script (like Devanagari, Tamil, or Kannada).
  • Incomplete Translations: Long subtitle files may be cut off mid-translation due to context limits.
  • Formatting Errors: Line breaks or subtitle numbering can sometimes be corrupted.

This tool automates the entire translation workflow, validates the output, and provides one-click fixes for common LLM errors—ensuring the subtitles are perfect.

What This Tool Replaces

This is the successor to my original SRT Subtitle Validator, which could only validate pre-translated files. The new SRT Translator & Validator combines translation and validation into a single, streamlined workflow with automatic error correction.

Features

Translation Modes

  • Translate: Ideal for translating an entire file at once. Recommended for SRT files with around 800 to 900 indexes.
  • Batch Translate: Translates the file in manageable batches, preventing context-length cutoffs. Recommended for files with over 900 indexes.
  • Standalone Validate: Dedicated mode to validate and fix an already translated SRT file without re-translating.

Translation Capabilities

  • Direct LLM Integration: Translate subtitles using any supported LLM via CLIProxyAPI.
  • Customizable Prompts: Full markdown editor with live preview for translation instructions.
  • Partial Translation Recovery: Automatically detects incomplete translations and continues from where it stopped.
  • Language Detection: Automatically identifies the target language for proper filename generation.
  • Raw Output Logging: Saves all LLM responses with timestamps for debugging.

Validation

  • Timestamp Synchronization: Compares timestamps between source and translated files, reporting any mismatches with detailed ranges.
  • Script Validation: Ensures translated text only contains characters from allowed Unicode ranges (e.g., English + Telugu).
  • Configurable Character Sets: Search from 130+ language scripts or add custom Unicode ranges/characters.
  • Real-time Feedback: Color-coded error reports with subtitle indices and Unicode values.

Automatic Error Correction

  • Fix Timestamp Errors: One-click replacement of incorrect timestamps with source values.
  • Fix Script Errors: Sends problematic subtitles back to Gemini for automatic correction.
  • Combined Fixing: Handles both timestamp and script errors in a single operation.
  • Smart Validation: Re-checks after fixes and shows remaining issues.

User Experience

  • Editable Output: View and manually edit translated subtitles before downloading.
  • Auto-save: Preserve manual edits while continuing the workflow.
  • Progress Tracking: Browser tab title shows current status (Translating, Translated, Fixing, Fixed, Error).
  • Auto-scroll: Automatically scrolls to validation results.
  • Dark/Light Mode: Adapts to your system theme preference.
  • Configured Prompt Templates: Loads your saved configuration and prompt to minimize manual entry.
  • File Drag & Drop: Supports an alternative way to upload files.

Desktop Application Specifics

You can download the latest native installer for your operating system (Mac, Windows, or Linux) from the GitHub Releases page.

If you are using the downloadable native desktop application, it comes with several built-in enhancements:

  • Automated CLIProxyAPI Management: The application will automatically launch and stop the CLIProxyAPI for you! You must navigate to Global Settings and save the appropriate launch command for your Operating System (Windows, macOS, or Linux).
  • Manual Updates Required: While the desktop app can auto-update itself via the Settings page, you must keep the underlying CLIProxyAPI up to date manually, just as you did for the web version. The dashboard provides a convenient status indicator and links to the latest GitHub and Homebrew releases.
  • Strict Template Enforcement: The desktop application's Template Manager only accepts @Config configured templates. Raw text templates are not supported in the desktop app to ensure a strict and automated workflow.
  • Embedded Database: Your settings and validated templates are saved locally via an embedded H2 database and persist between sessions.

Prerequisites

Desktop Application Requirements

If you are downloading the native .dmg, .exe, or .AppImage files, please ensure your system meets the following requirements:

  • Java Runtime Environment (JRE): The desktop application bundles a local Spring Boot server for its validation engine. You must have Java 17 or higher installed and available in your system's PATH. You can download it from Adoptium (Eclipse Temurin).
  • Windows: Requires the Microsoft Edge WebView2 Runtime (this is already pre-installed on Windows 11 and fully updated Windows 10 machines).
  • macOS: Because this application is not signed with a paid Apple Developer certificate, macOS Gatekeeper will block it initially. To safely bypass this for your first launch:
  • Try to open the app normally from your Applications folder (it will show a blocked warning).
  • Open your Mac's System Settings (Apple menu > System Settings).
  • Click Privacy & Security in the left sidebar and scroll down to the Security section.
  • You will see a message saying the app was blocked. Click the Open Anyway button. (Note: This button is only available for about an hour after you try to open the app).
  • Enter your Mac login password and click Open. (You only have to do this once! It will open normally every time after).
  • Linux: Requires WebKit2GTK to render the application window. If it doesn't launch, you may need to install it via your package manager (e.g., sudo apt install libwebkit2gtk-4.1-0).

CLIProxyAPI Installation

CLIProxyAPI is required to access your Gemini subscription through an API interface.

For installation instructions, please visit: https://help.router-for.me/introduction/quick-start.html

LLM Authentication

Depending on which model you want to use (Gemini, Claude, OpenAI, etc.), you will need to authenticate the CLIProxyAPI.

For step-by-step instructions on authenticating different models, please go to the CLIProxyAPI Provider Configuration and click on the respective model name in the sidebar to view the correct commands.

Example for Gemini: 1. Run the login command: cliproxyapi --login

If you're an existing Gemini Code user: cliproxyapi --login --project_id <your_project_id>

  1. Follow the OAuth flow in your browser to authenticate
  2. The local OAuth callback uses port 8085

Configuration

Create or edit your config.yaml file.

For more information, please visit: https://help.router-for.me/configuration/basic.html or use the provided example config.yaml.

[!IMPORTANT] The api-keys value in config.yaml must match the API Key field in the web application. The key dummy is used by default if the field is left blank.

Usage

1. Start CLIProxyAPI Server

If installed via Homebrew:

/opt/homebrew/opt/cliproxyapi/bin/cliproxyapi --config ~/path/to/your/config.yaml

If built from source:

./cli-proxy-api --config /path/to/your/config.yaml

The server will start on http://localhost:8317 by default.

2. Open the Web Application

Open this link SRT Translator & Validator in any modern web browser.

3. Configure the Application

  1. CLIProxyAPI Endpoint: Default is http://localhost:8317/v1/chat/completions
  2. Model Name: Default is gemini-2.5-pro
  3. API Key: Enter the same key from your config.yaml (e.g., 1234567)

4. Set Up Allowed Scripts

By default, the tool allows: - Basic Latin (English alphabet) - Latin Supplement (é, ñ, etc.) - Special characters (quotes, em-dash, line breaks)

To add your target language: 1. Type the language name in the search bar (e.g., "Telugu", "Arabic", "Tamil") 2. Click the suggested script to add it 3. Or add custom Unicode ranges: U+0C00-U+0C7F or single characters: U+0C00

You can also remove any script (except special characters and line breaks) by clicking the × button.

5. Create Your Translation Prompt

[!CAUTION] Update your translation prompts to remove any mention of timestamps, as the model no longer sees or generates them.

Write your translation instructions in the prompt field. You can use markdown formatting and switch to Markdown View to preview how it renders.

Using Configured Prompt Templates

For reusable prompts with dynamic values, create a template file with optional configuration:

  1. Create a .txt file with placeholders using {{Variable Name}} syntax
  2. Click "📥 Import Template" or drag and drop the template file onto the prompt section
  3. Fill in the template variables that appear
  4. Click "Apply Template" to generate your final prompt

Basic Template Example:

You are translating subtitles for {{Show Name}}, Season {{Season}}, Episode {{Episode}}.

Translate from {{Source Language}} to {{Target Language}}.

**Style Guidelines:**
- Use {{Formality Level}} language
- Keep character names in {{Name Language}}

[Rest of your translation instructions...]

When imported, you'll be prompted to fill in: Show Name, Season, Episode, Source Language, Target Language, Formality Level, and Name Language.

Configured Template Example (Advanced):

For even more automation, add a @Config header to pre-configure settings:

@Config
{{http://localhost:8317/v1/chat/completions}}
{{gemini-3-flash-preview}} {{gemini-3.1-pro-preview}}
{{Basic Latin}} {{Latin Supplement}} {{Telugu}}
{{TV show}} {{Psych}} {{2006}} {{, S01E01}} {{, (Title)}}

You are translating subtitles for the {{Enter movie or TV show}} {{Movie/TV Show Name}} ({{Release Year}}){{Season/Episode Number}}{{Episode Title}}.

[Rest of your translation instructions...]

Configuration Format: - Line 1: @Config marker - Line 2: API endpoint URL - Line 3: Two model Names for Language Detection and Translation - Line 4: Allowed script ranges (language scripts or Unicode ranges) - Line 5: Default values for placeholders in the prompt body (must match the order and number of unique placeholders) - Line 6: Empty line (required separator) - Lines 7+: Your prompt

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 75
Method 61
Interface 18
Class 9

Languages

TypeScript54%
Java44%
Rust2%

Modules by API surface

app/backend/src/main/java/com/srttranslator/backend/model/Template.java23 symbols
app/backend/src/main/java/com/srttranslator/backend/model/Settings.java17 symbols
app/frontend/src/pages/Dashboard.tsx16 symbols
app/frontend/src/utils/validationUtils.ts9 symbols
app/frontend/src/hooks/useTranslator.ts9 symbols
app/frontend/src/context/TemplateContext.tsx7 symbols
app/frontend/src/pages/TemplateManager.tsx6 symbols
app/frontend/src/components/FileDropzone.tsx6 symbols
app/backend/src/main/java/com/srttranslator/backend/service/CliProxyManagerService.java6 symbols
app/backend/src/main/java/com/srttranslator/backend/controller/TemplateController.java6 symbols
app/backend/src/main/java/com/srttranslator/backend/controller/ProxyController.java6 symbols
app/frontend/src/context/SettingsContext.tsx5 symbols

For agents

$ claude mcp add SRT-Subtitle-Translator-Validator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page