A Chrome extension that provides an alternative to the official Google Translate extension.
-
In-page Translation
- Select text and click the floating icon to translate directly within the page.
-
Pop-up Window Translation
- Click the extension icon to open a translation window:
- Automatically translates selected text.
- Provides real-time translation as you type.
- Click the extension icon to open a translation window:
-
Stable Styling with Shadow DOM
- Utilizes Shadow DOM to isolate styles, ensuring compatibility with various websites.
- Unlike Google Translate, this version remains stable on websites like example.com.
-
Customizable Translation Backends
- Supports multiple translation services: Google, OpenAI, DeepL, and Ollama.
- Modular design allows for easy integration and customization of translation backends.
- Clone or download this repository.
- Go to
chrome://extensions
in your Chromium-based browser (e.g., Chrome, Edge, Brave). - Enable “Developer mode.”
- Click on “Load unpacked” and select the directory of this repository.
- The extension will now appear in your list of installed extensions.
If the built-in key still works, you can skip this section.
- Retrieve the API key from the Google Translate extension.
- Click the extension icon to open the pop-up window.
- Go to “Settings,” find the “Google” section, and paste the key.
- Get an API key. Refer to this guide.
- Go to “Settings,” find the “OpenAI” section, and paste the API key.
- Get an API key. Refer to this page.
- Go to “Settings,” find the “DeepL” section, and paste the API key.
Example steps:
-
Install Ollama:
- Download and install Ollama locally.
-
Download
gemma2
:- Run
ollama pull gemma2
to download thegemma2
model. - If you're working with limited memory, try using
gemma2:2b
instead.
- Run
-
Set Web Origins:
- To allow requests with
Origin: chrome-extension://*
, set theOLLAMA_ORIGINS
environment variable to*
. - For more details, refer to this FAQ.
- To allow requests with
-
In
background/backends
, add a new JS script following the structure of the existing scripts. -
Import and register your new backend in
background/translator.js
:import example from "./backends/example.js"; const backends = new Map([ // ... ["example", example], ]);