Skip to content

Real-time video translation Chrome extension that automatically generates subtitles for any web video content

License

Notifications You must be signed in to change notification settings

xignoe/videoTranslatorExtenstion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Video Translator Chrome Extension

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.

πŸš€ Features

  • 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

πŸ“‹ Current Status

Development Progress: ~42% Complete (5/12 major tasks)

βœ… Completed Components

  • 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)

πŸ”„ In Progress

  • User interface integration
  • Background script development
  • Content script orchestration
  • Error handling and user feedback
  • Security and privacy features
  • Performance optimization

πŸ—οΈ Architecture

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

πŸ› οΈ Development Setup

Prerequisites

  • Node.js (v14 or higher)
  • Chrome browser
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/xignoe/videoTranslatorExtenstion.git
cd videoTranslatorExtenstion
  1. Install dependencies:
npm install
  1. Run tests:
npm test

Loading in Chrome for Development

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode" in the top right
  3. Click "Load unpacked" and select the project directory
  4. The extension will appear in your extensions list

πŸ§ͺ Testing

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 -- --coverage

Test 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

πŸ“– Usage

For Users

  1. Install the extension in Chrome
  2. Navigate to any website with video content
  3. Click the extension icon to configure your target language
  4. Play a video - subtitles will automatically appear
  5. Customize subtitle appearance in the options page

For Developers

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

πŸ”§ Configuration

Translation Settings

  • Target language selection
  • Source language detection
  • Translation confidence thresholds

Subtitle Appearance

  • Font size, color, and family
  • Background color and opacity
  • Position (top, center, bottom)
  • Animation and timing settings

πŸ›οΈ Technical Details

Core Technologies

  • 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

Key Features

  • 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

🀝 Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and add tests
  4. Run the test suite: npm test
  5. Commit your changes: git commit -m 'Add feature'
  6. Push to your branch: git push origin feature-name
  7. Submit a pull request

Development Guidelines

  • Follow the existing code style and architecture
  • Add tests for new functionality
  • Update documentation as needed
  • Ensure all tests pass before submitting

πŸ“ Project Structure

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

πŸ”’ Privacy & Security

  • 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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Known Issues

  • 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

πŸ—ΊοΈ Roadmap

Phase 1 (Current)

  • Core component development
  • Individual component testing
  • Component integration

Phase 2 (Next)

  • User interface completion
  • End-to-end functionality
  • Cross-platform testing

Phase 3 (Future)

  • Performance optimization
  • Additional language support
  • Advanced subtitle features
  • Chrome Web Store publication

πŸ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Include browser version, extension version, and steps to reproduce

πŸ™ Acknowledgments

  • 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.

Releases

No releases published

Packages

No packages published