A modern, web-based subtitle translator powered by Google's Gemini AI. Translate your SRT subtitle files between 20+ languages with real-time preview and streaming translation.
- 🌍 20+ Languages - Support for major languages including English, Spanish, French, German, Arabic, Persian, Chinese, Japanese, and more
- 🔄 Real-Time Translation - See translations appear progressively as they complete
- 📊 Live Preview - Dual text areas showing source and translated subtitles side by side
- ⚡ Smart Processing - Intelligent chunking and rate limiting for optimal performance
- 🎨 Beautiful UI - Modern, responsive design with smooth animations
- 🌐 Multi-Language Interface - Available in English and Persian (فارسی) with RTL support
- 🔒 Secure - Your API key is stored locally in your browser
- 💾 Instant Download - Download translated SRT files with one click
- ⚙️ Customizable - Adjust translation prompts, chunk size, and request delays
- A Google account
- A free Gemini API key from Google AI Studio
- Clone the repository:
git clone https://github.com/alifallahrn/subtitle-translator.git
cd subtitle-translator- Install dependencies:
npm install- Start development server:
npm run dev-
Open http://localhost:3000/subtitle-translator/ in your browser
-
Go to Settings and add your Gemini API key
-
Start translating!
-
Get Your API Key
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key (it's free!)
- Copy the key
-
Configure Settings
- Click the ⚙️ Settings button
- Paste your API key
- (Optional) Customize translation prompt and parameters
- Save settings
-
Translate Subtitles
- Click "Upload SRT File" and select your subtitle file
- Choose source language (or use Auto Detect)
- Select target language
- Click "Translate"
- Watch the translation progress in real-time
- Download the translated file
- Frontend Framework: React 19.2.1
- Build Tool: Vite 7.2.7
- AI API: Google Generative AI (Gemini)
- Styling: Pure CSS3 with modern gradients
- State Management: React Hooks
- Storage: Browser LocalStorage
Auto Detect, English, Spanish, French, German, Italian, Portuguese, Russian, Japanese, Korean, Chinese (Simplified), Arabic, Hindi, Turkish, Dutch, Polish, Swedish, Persian, Thai, Vietnamese
You can customize these in the Settings page:
- API Key: Your Gemini API key (required)
- Prompt Pattern: Template for translation requests
- Request Delay: Delay between API calls (500-10000ms)
- Chunk Size: Number of subtitles per request (1-20)
- Interface Language: English or Persian
Create a .env file for local development:
VITE_DONATE_URL=https://your-donation-link.com # Optional- ✅ Your API key is stored only in your browser (LocalStorage)
- ✅ No backend server - all processing is client-side
- ✅ Direct communication with Google's Gemini API
- ✅ No data is sent to any third-party servers
- ✅ Open source - you can verify the code yourself
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for the translation API
- The React team for the amazing framework
- Vite for the blazing fast build tool
If you have any questions or issues, please open an issue on GitHub.
If you find this project useful, please consider giving it a star! It helps others discover the project.
Made with ❤️ for subtitle enthusiasts worldwide