{"id":35136640,"url":"https://github.com/vseprr/srt-smart-translator","last_synced_at":"2026-04-12T11:40:04.222Z","repository":{"id":329830380,"uuid":"1119139304","full_name":"vseprr/srt-smart-translator","owner":"vseprr","description":"AI-powered SRT subtitle translator with context preservation","archived":false,"fork":false,"pushed_at":"2025-12-24T22:23:46.000Z","size":1859,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T11:39:32.588Z","etag":null,"topics":["deepl","flask","nlp","python","spacy","srt","subtitle","translation"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vseprr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T20:06:15.000Z","updated_at":"2026-03-28T11:42:00.000Z","dependencies_parsed_at":"2025-12-23T10:00:53.333Z","dependency_job_id":null,"html_url":"https://github.com/vseprr/srt-smart-translator","commit_stats":null,"previous_names":["vseprr/srt-smart-translator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vseprr/srt-smart-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseprr%2Fsrt-smart-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseprr%2Fsrt-smart-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseprr%2Fsrt-smart-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseprr%2Fsrt-smart-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vseprr","download_url":"https://codeload.github.com/vseprr/srt-smart-translator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vseprr%2Fsrt-smart-translator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31713876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T06:22:27.080Z","status":"ssl_error","status_checked_at":"2026-04-12T06:21:52.710Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deepl","flask","nlp","python","spacy","srt","subtitle","translation"],"created_at":"2025-12-28T09:31:22.301Z","updated_at":"2026-04-12T11:40:04.217Z","avatar_url":"https://github.com/vseprr.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎬 Smart SRT Translator\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo_v-2.svg\" alt=\"Smart SRT Translator Logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAI-powered subtitle translation with context preservation\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#the-problem\"\u003eThe Problem\u003c/a\u003e •\n  \u003ca href=\"#how-it-works\"\u003eHow It Works\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#api-reference\"\u003eAPI\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## ✨ Features\n\n- 🧠 **Smart Sentence Merging** – Uses SpaCy NLP to detect sentence boundaries across subtitle blocks\n- 🔄 **Context-Aware Translation** – Translates complete sentences, not fragmented blocks\n- ⚡ **Proportional Splitting** – Redistributes translations back to original timestamps using character ratios\n- 🌍 **29+ Languages** – Powered by DeepL API with support for major world languages\n- 🎨 **Modern Web UI** – Dark glassmorphism theme with drag-and-drop file upload\n- 📊 **Real-time Progress** – Server-Sent Events (SSE) for live translation status updates\n- 🔐 **Secure** – API keys stored locally, never transmitted to third parties\n- 🛠️ **Multi-Model Support** – Install multiple SpaCy language models for different source languages\n- 🔍 **Auto Language Detection** – Automatically detects source file language\n- ⚠️ **Smart Warnings** – Alerts for language mismatches and same language selections\n\n---\n\n## 🎥 Demo\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/demo.gif\" alt=\"Smart SRT Translator Demo\" width=\"700\"/\u003e\n\u003c/p\u003e\n\n---\n\n## 🎯 The Problem: Why Context Matters?\n\n### Turkish → English Example\n\nTurkish sentence structure places the verb at the end. When subtitles split a sentence into multiple lines, standard translators fail to capture the meaning of the first line because the action (verb) is missing until the end.\n\n**Original (Split in 3 lines):**\n\u003e 1. Bütün bu olanlardan\n\u003e 2. sonra, beni affetmeni\n\u003e 3. beklemiyorum.\n\n| Method | Output (Subtitle) | Why it fails/succeeds? |\n| :--- | :--- | :--- |\n| **Standard (Line-by-Line)** | 1. From all these things\u003cbr\u003e2. after, to forgive me\u003cbr\u003e3. **I am not waiting.** | ❌ **FAIL:** \"Beklemiyorum\" is translated as \"waiting\" physically, instead of \"expecting\". The sentence is broken and meaningless. |\n| **SRT Smart Translator** | 1. After all that has happened,\u003cbr\u003e2. I do not expect\u003cbr\u003e3. you to forgive me. | ✅ **SUCCESS:** It merges lines, understands \"affetmeni beklemiyorum\" implies expectation, translates correctly, and re-splits by timing. |\n\n---\n\n## 💡 How It Works\n\nSmart SRT Translator uses a 4-step pipeline:\n\n```\n┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐\n│  Parse   │───▶│  Merge   │───▶│Translate │───▶│  Split   │\n│   SRT    │    │Sentences │    │  (API)   │    │  Back    │\n└──────────┘    └──────────┘    └──────────┘    └──────────┘\n```\n\n### 1. Parse\nReads the SRT file with UTF-8 BOM support using `pysrt`\n\n### 2. Merge\nSpaCy NLP detects sentence boundaries and merges split sentences\n\n### 3. Translate\nComplete sentences are sent to DeepL API for contextual translation\n\n### 4. Smart Split\nTranslation is proportionally split back to original block structure using character ratios\n\n---\n\n## 🛠 Installation\n\n### Prerequisites\n\n- **Python 3.8+** – [Download from python.org](https://www.python.org/downloads/)\n  - ⚠️ Check \"Add Python to PATH\" during installation!\n- **DeepL API Key** – [Get free API key](https://www.deepl.com/pro-api)\n\n### Quick Start\n\n```bash\n# 1. Clone repository\ngit clone https://github.com/vseprr/srt-smart-translator.git\ncd srt-smart-translator\n\n# 2. Create virtual environment\npython -m venv venv\n\n# 3. Activate virtual environment\n# Windows (PowerShell):\n.\\venv\\Scripts\\Activate.ps1\n# Windows (CMD):\nvenv\\Scripts\\activate\n# macOS/Linux:\nsource venv/bin/activate\n\n# 4. Install dependencies\npip install -r requirements.txt\n\n# 5. Start the application\npython app.py\n```\n\n### First Run\n\n1. Browser opens automatically to **http://localhost:5000**\n2. You'll see the **Setup Wizard** 🧙‍♂️\n3. Select one or more language models to install:\n   - 🇬🇧 English (en_core_web_sm)\n   - 🇹🇷 Turkish (tr_core_news_lg)\n   - 🇪🇸 Spanish (es_core_news_sm)\n   - 🇫🇷 French (fr_core_news_sm)\n   - 🇩🇪 German (de_core_news_sm)\n   - 🌐 Multilingual (xx_sent_ud_sm) - works with any language\n   - ➕ Custom (install from URL)\n4. Wait for installation to complete\n5. Enter your DeepL API key in Settings\n6. Start translating! 🎉\n\n\u003e 💡 **Tip:** For multilingual models (xx_*), just type the install command - language is auto-selected as \"Multilingual / Universal\".\n\n### Windows Quick Launch\n\nAfter initial setup, double-click `UI-Start.bat` to launch (auto-setup if first time).\n\n---\n\n## 🚀 Usage\n\n1. **Start the server:** `python app.py` (browser opens automatically)\n2. **Upload SRT file** via drag-and-drop\n3. **Select target language** and click \"Start Translation\"\n4. **Download** the translated file when complete\n\n### Warnings System\n\n- 🔴 **Language Mismatch** – No SpaCy model for detected language, using fallback\n- 🟣 **Universal Model** – Using multilingual model (works for all languages)\n- 🟠 **Same Language** – Source and target languages are the same\n\n---\n\n## 📁 Project Structure\n\n```\nsrt-smart-translator/\n├── app.py                    # Flask server + API endpoints\n├── parser.py                 # SRT file reading/writing\n├── engine.py                 # Sentence merging algorithm  \n├── translator.py             # DeepL API integration\n├── requirements.txt          # Python dependencies\n├── UI-Start.bat              # Windows quick launcher\n├── backend/\n│   ├── model_manager.py      # SpaCy model management\n│   └── language_data.py      # Language configurations\n├── templates/\n│   ├── index.html            # Main translation page\n│   ├── setup.html            # First-run setup wizard\n│   └── settings.html         # Settings \u0026 model management\n├── static/\n│   └── style.css             # Dark glassmorphism theme\n├── uploads/                  # Temporary upload storage\n└── outputs/                  # Translated files\n```\n\n---\n\n## ⚙️ Settings Page Features\n\n- **API Key Management** – Save/remove DeepL API key\n- **Installed Models** – View all installed SpaCy models\n- **Remove Model** – Uninstalls model with `pip uninstall`\n- **Add Model** – Install via:\n  - `python -m spacy download xx_model`\n  - `pip install https://...whl`\n  - Direct wheel URL\n\n---\n\n## 🔌 API Reference\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/` | Main page (HTML) |\n| `GET` | `/setup` | Setup wizard (if no models) |\n| `GET` | `/settings` | Settings page |\n| `GET` | `/api/config` | Check API key status |\n| `POST` | `/api/config` | Save API key |\n| `DELETE` | `/api/config` | Remove API key |\n| `POST` | `/api/install-model` | Install SpaCy model |\n| `POST` | `/api/remove-model` | Uninstall SpaCy model |\n| `POST` | `/upload` | Upload SRT file |\n| `POST` | `/translate` | Start translation job |\n| `GET` | `/status/{job_id}` | Translation status (JSON) |\n| `GET` | `/progress/{job_id}` | Real-time progress (SSE) |\n| `GET` | `/download/{job_id}` | Download translated file |\n\n---\n\n## 🎨 Tech Stack\n\n| Component | Technology |\n|-----------|------------|\n| Backend | Flask 3.x |\n| NLP | SpaCy (multiple models) |\n| Language Detection | langdetect |\n| Translation | DeepL Free API |\n| SRT Parsing | pysrt |\n| Frontend | Vanilla HTML/CSS/JS |\n| Design | Dark Glassmorphism |\n\n---\n\n## ⚠️ Known Limitations\n\n- **Single file only** – No batch translation yet\n- **SRT format only** – VTT, ASS not supported\n- **Internet required** – DeepL API needs connectivity\n\n---\n\n## 🗺️ Roadmap\n\n- [x] ~~Multi-language SpaCy model support~~\n- [x] ~~Automatic source language detection~~\n- [x] ~~First-run setup wizard~~\n- [x] ~~Real pip uninstall for models~~\n- [ ] Batch file translation\n- [ ] VTT/ASS format support\n- [ ] Formality selection (formal/informal)\n- [ ] Translation history\n- [ ] PWA support for offline UI\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n---\n\n## 📄 License\n\nThis project is open source and available under the [MIT License](LICENSE).\n\n---\n\n## 🙏 Acknowledgements\n\n- [DeepL](https://www.deepl.com/) for their excellent translation API\n- [SpaCy](https://spacy.io/) for natural language processing\n- [pysrt](https://github.com/byroot/pysrt) for SRT file handling\n- [Turkish NLP Suite](https://huggingface.co/turkish-nlp-suite) for Turkish SpaCy model\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ for the subtitle community\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseprr%2Fsrt-smart-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvseprr%2Fsrt-smart-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvseprr%2Fsrt-smart-translator/lists"}