A Chrome extension that automatically translates NeetCode video subtitles from English to Indonesian.
- Automatic Translation: Translates subtitles in real-time as you watch NeetCode videos
- Batch Pre-translation: Extracts transcript and pre-translates all cues for smooth playback
- Smart Caching: Caches translations locally to avoid repeated API calls
- Dual Translation APIs: Uses Google Translate (primary) with DeepL as fallback
- Seamless Integration: Works directly with Vimeo player iframes on NeetCode
-
Clone this repository:
git clone https://github.com/z0zero/NeetCode-Subtitle-Translator.git
-
Open Chrome and navigate to
chrome://extensions/ -
Enable Developer mode (toggle in top right corner)
-
Click Load unpacked and select the cloned folder
-
The extension icon should appear in your toolbar
- Navigate to any video on neetcode.io
- Enable subtitles/captions on the video player
- The extension will automatically translate subtitles to Indonesian
- Click the extension icon to:
- Toggle translation on/off
- Configure DeepL API key (optional)
Click the extension icon and use the toggle switch to enable or disable translation.
For better translation quality, you can add your free DeepL API key:
- Get a free API key from DeepL
- Click the extension icon
- Enter your API key in the settings
- Click Save
neetcode-subtitles-extension/
├── manifest.json # Extension manifest (MV3)
├── background/
│ └── service-worker.js # Background service for translation API calls
├── content/
│ └── content.js # Content script for subtitle detection & replacement
├── popup/
│ ├── popup.html # Extension popup UI
│ ├── popup.js # Popup logic
│ └── popup.css # Popup styling
├── utils/
│ ├── translator.js # Translation API utilities (Google & DeepL)
│ └── cache.js # Local storage caching utilities
└── icons/ # Extension icons
- Content Script (
content.js) runs on Vimeo player iframes - Extracts transcript cues from the player's transcript panel
- Batch translates all cues via the Background Service Worker
- Caches translations in localStorage for instant reuse
- Observes subtitle DOM changes and replaces text with translations
- Falls back to on-the-fly translation if transcript unavailable
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Content Script │────>│ Service Worker │────>│ Google API │
│ (Vimeo Player) │ │ (Background) │ │ (or DeepL) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
│ v
│ ┌──────────────────┐
└──────────────>│ localStorage │
│ (Cache) │
└──────────────────┘
storage: Save user preferences and API keysactiveTab: Access active tab for translation- Host permissions for:
neetcode.io- Main siteplayer.vimeo.com- Video playertranslate.googleapis.com- Google Translate APIapi-free.deepl.com- DeepL API
- Chrome browser
- Basic knowledge of Chrome Extension development
- Edit source files
- Go to
chrome://extensions/ - Click the refresh icon on the extension card
- Reload the NeetCode page to test changes
Open Chrome DevTools on the Vimeo iframe and check console for logs prefixed with [NeetCode Translator].
MIT License - feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit a Pull Request.
Made with coffee for the NeetCode community