A Chrome extension that provides real-time translation and subtitle generation for any video or audio content on the web. Unlike existing text-only translation tools, this extension detects audio from videos across all websites, transcribes the speech, translates it to your preferred language, and displays synchronized subtitles overlaid on the video content.
- Universal Video Support: Works on any website with video content (YouTube, Netflix, news sites, etc.)
- Real-time Translation: Live speech recognition and translation with minimal delay
- Customizable Subtitles: Adjustable font size, color, position, and styling
- Multi-language Support: Translate to/from multiple languages
- Smart Synchronization: Subtitles appear within 2 seconds of spoken audio
- Privacy-focused: Audio processing happens locally or through secure connections
- Cross-platform Compatibility: Works across different video platforms and formats
Development Progress: ~42% Complete (5/12 major tasks)
- Chrome extension project structure and manifest
- Video detection system with MutationObserver
- Audio processing and speech recognition
- Translation service with API integration
- Subtitle rendering and overlay system
- Comprehensive test suite (164 passing tests)
- User interface integration
- Background script development
- Content script orchestration
- Error handling and user feedback
- Security and privacy features
- Performance optimization
The extension follows a modular architecture with clear separation of concerns:
βββ content/ # Content scripts (injected into web pages)
β βββ videoDetector.js # Detects video elements on pages
β βββ audioProcessor.js # Captures and processes audio streams
β βββ speechRecognizer.js # Speech-to-text conversion
β βββ translationService.js # Translation API integration
β βββ subtitleRenderer.js # Creates and positions subtitle overlays
β βββ subtitleTimer.js # Handles subtitle timing and synchronization
β βββ subtitleStyleManager.js # Manages subtitle appearance
βββ background/ # Background service worker
βββ popup/ # Extension popup interface
βββ options/ # Settings and configuration page
βββ tests/ # Comprehensive test suite
- Node.js (v14 or higher)
- Chrome browser
- Git
- Clone the repository:
git clone https://github.com/xignoe/videoTranslatorExtenstion.git
cd videoTranslatorExtenstion- Install dependencies:
npm install- Run tests:
npm test- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked" and select the project directory
- The extension will appear in your extensions list
The project includes comprehensive test coverage:
# Run all tests
npm test
# Run specific test suites
npm test subtitleRenderer
npm test translationService
npm test videoDetector
# Run tests with coverage
npm test -- --coverageTest Coverage: 164 passing tests covering:
- Video detection across platforms
- Audio processing and speech recognition
- Translation service with retry logic
- Subtitle rendering and timing
- Style management and customization
- Install the extension in Chrome
- Navigate to any website with video content
- Click the extension icon to configure your target language
- Play a video - subtitles will automatically appear
- Customize subtitle appearance in the options page
The extension is built with a modular architecture that makes it easy to:
- Add new translation providers
- Support additional video platforms
- Customize subtitle rendering
- Extend audio processing capabilities
- Target language selection
- Source language detection
- Translation confidence thresholds
- Font size, color, and family
- Background color and opacity
- Position (top, center, bottom)
- Animation and timing settings
- Chrome Extension Manifest V3
- Web Audio API for audio capture
- Web Speech API for speech recognition
- Translation APIs for language conversion
- DOM Manipulation for subtitle overlay
- Real-time Processing: Minimal latency between speech and subtitles
- Memory Management: Efficient cleanup and resource management
- Error Handling: Comprehensive error recovery and user feedback
- Cross-origin Support: Works with embedded videos and iframes
- Performance Optimized: Minimal impact on video playback
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run the test suite:
npm test - Commit your changes:
git commit -m 'Add feature' - Push to your branch:
git push origin feature-name - Submit a pull request
- Follow the existing code style and architecture
- Add tests for new functionality
- Update documentation as needed
- Ensure all tests pass before submitting
video-translator-extension/
βββ .kiro/specs/ # Project specifications and requirements
βββ background/ # Background service worker
βββ content/ # Content scripts and core functionality
βββ icons/ # Extension icons
βββ options/ # Options page (settings)
βββ popup/ # Extension popup interface
βββ tests/ # Test suite
βββ manifest.json # Chrome extension manifest
βββ package.json # Node.js dependencies and scripts
βββ README.md # This file
- Audio data is processed locally or through secure, encrypted connections
- No audio data is stored permanently
- User preferences are stored locally using Chrome's storage API
- Extension only accesses audio from active video tabs
- Automatic cleanup when tabs are closed or extension is disabled
This project is licensed under the MIT License - see the LICENSE file for details.
- Some speech recognition tests need mock setup fixes
- Translation service queue tests have timing issues
- Content script orchestration is not yet implemented
- Background script functionality is minimal
- Core component development
- Individual component testing
- Component integration
- User interface completion
- End-to-end functionality
- Cross-platform testing
- Performance optimization
- Additional language support
- Advanced subtitle features
- Chrome Web Store publication
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Include browser version, extension version, and steps to reproduce
- Chrome Extension APIs and documentation
- Web Speech API for speech recognition capabilities
- Translation service providers
- Open source testing frameworks (Jest, JSDOM)
Note: This extension is currently in active development. Core functionality is implemented and tested, but integration work is ongoing. See the project tasks for detailed progress tracking.