Skip to content

adinschmidt/AI-translator

Repository files navigation

AI Translator

A browser extension that leverages customizable AI models for superior text and page translations.

Available in the Chrome Web Store Available on Firefox Add-ons

Documentation: https://adinschmidt.com/AI-translator/

Why AI Translator?

  • More Coherent Output: AI translation delivers natural, context-aware results that surpass traditional Machine Translation (MTL) in coherence and fluency.
  • Right-click to translate selected text or entire pages.
  • Fully customizable AI models and settings.

Screenshots

AI vs. Traditional Translation

AI-powered translation provides more natural and contextually accurate results compared to traditional services.

Traditional (DeepL) AI Translator
DeepL Translation AI Selection Translation

Additional Previews

Full Page Translation Settings Page

Installation

Chrome / Chromium-based browsers

  1. Download or clone this repository.
  2. Go to chrome://extensions/.
  3. Enable Developer mode (top-right toggle).
  4. Click Load unpacked and select the extension folder.

Firefox

  1. Download or clone this repository.
  2. Go to about:debugging#/runtime/this-firefox.
  3. Click Load Temporary Add-on.
  4. Select the manifest.json file in the extension folder.

Note: Temporary add-ons in Firefox are removed when the browser closes. For permanent installation, the extension must be signed by Mozilla or installed in Firefox Developer/Nightly with xpinstall.signatures.required set to false.

Usage

  1. Text Translation: Select text on any webpage, right-click → "Translate Selected Text".
  2. Page Translation: Right-click anywhere on the page → "Translate Page".
  3. Configure: Click the extension icon → Options to set up API keys, models, languages, etc.

Options Page Features

  • Select AI providers and models (e.g., GPT, Claude).
  • Set source and target languages.
  • Manage API keys securely.
  • Customize translation behavior.

Roadmap & Current State

Development

Prerequisites

  • Install Bun for building the extension

Build

  • Build Chrome + Firefox extensions to dist/:
    bun run build
  • Build and create zip artifacts:
    bun run build:zip

Project Structure

src/
├── extension/     # Extension-specific code
│   ├── background.ts   # Background service worker
│   ├── content.ts      # Content script (page injection)
│   └── options.ts      # Options page logic
└── shared/        # Shared utilities
    ├── constants/      # Shared constants
    ├── messaging.ts    # Message passing between contexts
    └── storage.ts      # Chrome storage abstraction
dist/               # Build output (generated, gitignored)
build.ts            # Build script (TypeScript, runs on Bun)

The build process compiles TypeScript files and copies necessary assets (manifests, HTML, CSS, images) to dist/ for both Chrome and Firefox.

Tech Stack

  • TypeScript (compiled for browser runtime)
  • Manifest V3
  • Content scripts for page interaction
  • Service worker for background API calls
  • Tailwind CSS for styling
  • Bun for build tooling

Privacy

We value your privacy. This extension operates client-side and does not collect your data.

Permissions:

  • host_permissions (https://*/*, http://*/*): Allow the selection button and page translation to run on any site you visit.
  • storage: Used to save your settings locally.
  • scripting: Used to inject translation scripts into the page when requested.

See our Privacy Policy for full details.

About

Chrome extension to translate text and pages using customizable AI models.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors