A Chrome extension that provides an alternative to the official Google Translate extension.
![screenshot](https://private-user-images.githubusercontent.com/17045050/379879117-fdb7ead8-1663-43c8-ac3e-ecd9a7dc14ca.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxOTA5MjEsIm5iZiI6MTczOTE5MDYyMSwicGF0aCI6Ii8xNzA0NTA1MC8zNzk4NzkxMTctZmRiN2VhZDgtMTY2My00M2M4LWFjM2UtZWNkOWE3ZGMxNGNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDEyMzAyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1ZjFhYTNjZmFhOWY2NjgwNTViOGRlMDAwMDg3Nzk1YzU3YjNkZGEzNDM1NGFlNjIxMWNhYmExYWM3N2FjZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sgvnkZXCmdCVQa5cU9z_D745cB4SCIo1k8OkkBy2P1A)
-
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], ]);