A Chrome extension that translates images and charts on X/Twitter from any language to English using Google Gemini AI. The translated image replaces the original inline in your feed.
- Inline image replacement: Translated images replace the original directly in your X feed
- One-click translation: Hover over any image to reveal a discrete translate button
- Revert anytime: Click the button again to switch back to the original image
- Smart detection: Only shows on meaningful images (not avatars, emojis, or small icons)
- Secure API key storage: Your Gemini API key is encrypted and stored locally
- X-native design: Button styling matches X/Twitter's UI
- Uses Gemini 2.0 Flash with image generation capabilities
- Sends the original image with a translation prompt
- Gemini generates a new image with all text translated to English
- The new image replaces the original in your X feed
- Click "Revert" to see the original again
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked"
- Select the
social-image-translaterfolder - The extension icon should appear in your toolbar
- Click the extension icon in your toolbar
- Get a Google Gemini API key from Google AI Studio
- Paste your API key and click "Save API Key"
- The status indicator should turn green
Note: Make sure your API key has access to gemini-2.0-flash-exp-image-generation model.
- Go to X/Twitter (x.com or twitter.com)
- Hover over any image in a tweet
- A translate icon appears in the bottom-left corner
- Hover over the icon to see "Translate" label
- Click to translate - the image will be replaced with an English version
- The button turns green and shows "Revert" - click to restore original
- API key encryption: Your Gemini API key is encrypted using AES-256-GCM via Web Crypto API
- No data collection: The extension doesn't collect any personal data
- Direct API calls: Images are sent directly to Google's Gemini API - no intermediary servers
- Local storage only: All data stays in your browser
social-image-translater/
├── manifest.json # Extension configuration (Manifest V3)
├── icons/ # Extension icons
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
├── src/
│ ├── content.js # Injected into X/Twitter - handles button injection
│ ├── background.js # Service worker - Gemini API calls & encryption
│ ├── styles.css # Button styling
│ └── popup/
│ ├── popup.html # API key setup UI
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
└── scripts/
└── generate-icons.js # Icon generation script
- Google Chrome (or Chromium-based browser)
- Google Gemini API key with access to image generation models
- Make sure the extension is enabled in
chrome://extensions/ - Refresh the X/Twitter page
- Check that you're on x.com or twitter.com
- Your API key may not have access to the image generation model
- Try getting a new API key from Google AI Studio
- Image generation is an experimental feature - it may have usage limits
- Gemini attempts to recreate the image with translated text
- Complex charts may have slight visual differences
- The model preserves layout and colors as closely as possible
- Make sure you're using a valid Gemini API key
- Check browser console for errors
MIT License - feel free to modify and distribute.