A powerful Chrome extension that leverages Google's Gemini AI to provide instant translation, text correction, and image prompt enhancement directly in your browser. With support for 12 languages and multiple AI-powered modes, it's your ultimate multilingual companion.
- Popup Translator: Full-featured translation interface with history and settings
- Selected Text Translation: Instant translation of selected text on any webpage
- Independent Language Settings: Separate language preferences for each translation mode
- Smart Context Detection: Automatically detects input fields vs. webpage content
- 13 Languages: English, Polish, German, Spanish, French, Italian, Portuguese, Russian, Japanese, Korean, Chinese, Vietnamese, Ukrainian
- Complete UI Localization: Interface adapts to your browser's language
- Intelligent Language Mapping: Automatic conversion between language codes and full names
- Multiple API Key Management: Store and manage multiple Gemini API keys with health monitoring
- Translation History: Track and restore previous translations with smart filtering
- One-Click Web Translation: Select text on any webpage for instant floating translation
- Screenshot Translation: Capture and translate text from images (Ctrl+Shift+T)
- Responsive Design: Optimized interface with smooth animations
- Offline Storage: Secure local storage of settings and history
- Copy to Clipboard: One-click copying of translated text
- Error Recovery: Automatic retry with fallback API keys
Coming soon - Extension is currently in review process
- Download: Clone or download this repository
git clone https://github.com/yourusername/ai-translator-gemini-api.git
- Open Chrome Extensions: Navigate to
chrome://extensions/ - Enable Developer Mode: Toggle the switch in the top right corner
- Load Extension: Click "Load unpacked" and select the extension directory
- Pin Extension: Click the puzzle icon and pin AI Translator for easy access
- Click the extension icon in your browser toolbar
- Navigate to Settings section
- Enter your Google Gemini API key
- Click "Save API Key"
- ✅ Free API keys available - No credit card required for basic usage
Set up your translation preferences:
- Popup Translator Language: Choose target language for in-extension translations
- Selected Text Language: Set separate language for webpage text selection
- Independent Settings: Each translation mode has its own language preference
- Paste or type text in the input area
- Select target language from dropdown
- Click "Translate" button
- Copy results with one click
- View translation history in sidebar
- Select any text on any webpage
- Click the floating translate icon that appears
- View instant translation in popup dialog
- Translation uses your selected text language setting
- Results automatically saved to history
- Press Ctrl+Shift+T to enter screenshot mode
- Drag to select area containing text
- AI will extract and translate all visible text
- Perfect for images, PDFs, and non-selectable content
- View all previous translations in the sidebar
- Click any history item to restore both original and translated text
- Select multiple items for batch deletion
- Separate history for popup and selected text translations
Modern, intuitive interface with multiple AI modes and translation history
Complete feature overview showing all capabilities
One-click translation directly on any webpage
- Browser: Chrome 88+ or Chromium-based browsers
- API: Google Gemini API key (free tier available)
- Permissions: Active tab access for web translation
- Storage: ~5MB for extension and user data
| Language | Code | Native Name |
|---|---|---|
| English | en | English |
| Polish | pl | Polski |
| German | de | Deutsch |
| Spanish | es | Español |
| French | fr | Français |
| Italian | it | Italiano |
| Portuguese | pt | Português |
| Russian | ru | Русский |
| Japanese | ja | 日本語 |
| Korean | ko | 한국어 |
| Chinese | zh | 中文 |
| Vietnamese | vi | Tiếng Việt |
- ✅ Local Storage Only: All data stored locally in your browser
- ✅ No Data Collection: We don't collect or store your personal data
- ✅ Secure API Calls: All requests use HTTPS encryption
- ✅ No Third-Party Sharing: Your API keys and translations stay private
- Active Tab: Required for webpage text selection and translation
- Storage: Saves your settings, API keys, and translation history locally
- Host Permissions: Needed to inject translation interface on websites
- Stored encrypted in Chrome's secure storage
- Never transmitted except to Google's Gemini API
- Can be easily removed or replaced
- Multiple key management for redundancy
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a pull request.
# Clone the repository
git clone https://github.com/yourusername/ai-translator-gemini-api.git
cd ai-translator-gemini-api
# Load in Chrome for development
# 1. Open chrome://extensions/
# 2. Enable Developer mode
# 3. Click "Load unpacked" and select the project folderai-translator-gemini-api/
├── manifest.json # Extension configuration
├── popup/ # Main interface
│ ├── popup.html # UI structure
│ ├── popup.css # Styling
│ └── popup.js # Main logic
├── background/ # Service worker
│ ├── background.js # Background processes
│ └── config.js # Configuration
├── content/ # Web page integration
│ ├── content.js # Content script
│ └── content.css # Injection styles
├── _locales/ # Internationalization
│ ├── en/messages.json # English translations
│ ├── pl/messages.json # Polish translations
│ └── ... # Other languages
└── icons/ # Extension icons
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Create new folder in
_locales/(e.g.,_locales/fr/) - Copy
_locales/en/messages.jsonto the new folder - Translate all message values
- Test the extension with the new language
- ❌ "Invalid API Key": Verify your key at Google AI Studio
- ❌ "API Key Empty": Make sure to paste the complete key
- ❌ "Rate Limited": You've exceeded the free tier limits
- ❌ No translation appears: Check your internet connection
- ❌ Text not selectable: Try refreshing the webpage
- ❌ Extension not working: Reload the extension in
chrome://extensions/
- ❌ UI in wrong language: Check your browser's language settings
- ❌ History not saving: Ensure Chrome has storage permissions
- ❌ Popup not opening: Try pinning the extension to toolbar
- 📖 Documentation: Check this README for detailed instructions
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Start a discussion
- 📧 Contact: your-email@example.com
- 🌟 GitHub Stars: Growing community of users
- 🔄 Active Development: Regular updates and improvements
- 🌍 Global Reach: Supporting 12+ languages
- 🚀 Performance: Optimized for speed and efficiency
- 🔄 Independent Translation Modes: Separated popup translator and selected text translation with independent language settings
- 🎯 Enhanced Selected Text Translation: Fixed translation functionality - now properly translates instead of copying original text
- 🌐 Improved Language Handling: Better language code mapping and API prompt optimization for more accurate translations
- �️ API Response Processing: Enhanced response parsing to handle various Gemini API output formats
- 🔧 Bug Fixes: Resolved syntax errors and improved error handling throughout the extension
- ⚡ Performance Optimization: Removed debug logging for faster execution and cleaner console output
- 🔒 Security Updates: Updated host permissions for better API compatibility
- 📱 UI Improvements: Better icon positioning and dialog box display for selected text translations
- 🎨 New Design: Complete interface redesign with modern styling
- 🔄 Multiple Modes: Added Text Correction and Image Prompt Enhancement
- 📱 Responsive UI: Improved layout with better proportions
- 📚 Enhanced History: Fixed height, better scrolling, and improved management
- 🎯 Custom Dropdown: Replaced select with custom dropdown for mode selection
- ⚡ Performance: Faster textarea transitions and smoother animations
- 🌐 Complete Localization: All 12 languages fully supported in new interface
- 🌍 Multi-language Support: Added 12 language translations
- 🔧 UI Localization: Complete interface translation system
- 🔒 Enhanced Security: Strict Content Security Policy implementation
- 🏗️ Architecture: Restructured for Chrome Web Store standards
- ⚡ Optimization: Improved background service worker performance
- 🧹 Code Cleanup: Dependency optimization and refactoring
- 🛡️ Error Handling: Enhanced error management mechanisms
- 📝 HTML Improvements: Semantic HTML structure updates
- 🎨 CSS Optimization: Animation consolidation and performance
⚠️ Bug Fixes: Status display and warning resolution
- 🎯 Language Selection: Separate source/target language controls
- 🎨 UI Consistency: Visual improvements across interface
- 📋 Copy Feedback: Enhanced clipboard operation feedback
- ⚙️ Configuration: Centralized text and settings management
- 🔑 API Validation: Improved key format validation
- 📡 API Integration: Translation request optimization
- ⚙️ Configuration: Added centralized config system
- 🏷️ CSS Prefixing: Namespace collision prevention
- 🚀 Core Features: Basic translation functionality
- 🔑 API Key Management: Secure storage system
- 🌐 Web Integration: Text selection translation
- 💾 Local Storage: Settings and history persistence
