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
- 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 folder
ai-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.json
to 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