A Chrome extension that adds a floating translation icon to text inputs on web pages. Click the icon to send text to an AI service for translation based on your settings.
- Adds a floating translator icon to all text inputs on web pages
- Translates text using AI (via OpenAI API or other compatible providers)
- Configurable source and target languages
- Customizable translation prompt
- Adjustable icon positioning
- Simple popup interface to quickly access settings
- Download or clone this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the folder containing the extension files
- The extension will be installed and the options page will open automatically
Before using the extension, you need to set up your API key and preferences:
- Get an API key from OpenAI or another compatible AI service
- Enter your API key in the extension options
- Configure your preferred source and target languages
- Customize the translation prompt if needed
- Save your settings
- Visit any website with text input fields
- Notice the floating translation icon next to each text input
- Enter or paste text into an input field
- Click the translator icon to translate the text
- The translated text will replace the original content in the input field
You can customize how the AI translates your text by modifying the prompt template in the settings. Use the following placeholders:
{source_language}: Will be replaced with the source language name{target_language}: Will be replaced with the target language name{text}: Will be replaced with the text to translate
Example prompt:
Translate the following text from {source_language} to {target_language}: {text}
The extension currently supports the following languages:
- English
- French
- Spanish
- German
- Italian
- Portuguese
- Russian
- Japanese
- Chinese
- Korean
- Arabic
More languages can be added by modifying the code.
manifest.json: Extension configuration and permissionsoptions.html/js/css: Settings page for the extensionpopup.html/js: The popup that appears when clicking the extension iconcontent.js/css: Scripts that inject and manage the translator icon on web pagesbackground.js: Handles extension installation and events
This extension requires the following permissions:
storage: To save your settingsactiveTab: To interact with the content of your current tab
- The extension requires an API key from OpenAI or another compatible AI service
- Translation quality depends on the AI service used
- Be aware of any usage limits or costs associated with your API key