jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
65 stars 3 forks source link
firefox-extension machine-translation privacy translation web-extension

TranslateLocally for the Browser

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers. It is a stand-alone extension, but can integrate with TranslateLocally for custom models and even better performance.

TranslateLocally for the Browser is a fork of Firefox Translations. It was initially developed in the Bergamot project as a testing bed for the technology that went into Firefox Translations.

Screenshot of TranslateLocally for the Browser

Installation in Firefox

Features

Differences from Firefox Translations

Instructions for development

  1. Install Firefox (Nightly for better performance when using WASM)
  2. Clone this repo and run npm install
  3. Run npm run watch and wait until Firefox starts
  4. Browse to a page in any of the supported languages (https://github.com/browsermt/students) to have the translation option to appear

Instructions for Native Messaging

  1. Download the latest release from the TranslateLocally
  2. …and start it once. This will register the native client with Firefox.
  3. Go to about://addons, click "TranslateLocally for Firefox", and click "Preferences".
  4. You can then select TranslateLocally as your translation provider in the Preferences pane of the extension settings.

Google Chrome / Chromium

This branch has experimental support for Google Chrome, including native messaging. However, setup is a bit of a hassle at the moment:

  1. Clone or download this repository
  2. Open Google Chrome, go to chrome://extensions/, and turn on developer mode (the toggle in top right corner)
  3. Click Load Unpacked
  4. Select the extension folder in your local copy of this repository
  5. Get translateLocally
  6. Once you have a binary of translateLocally, run ./translateLocally --allow-client AABBCC where AABBCC is the extension ID Chrome assigned to your installed version of this extension.
  7. (Restart Chrome? Not sure this is necessary)
  8. Go to the Extension options page of this extension and select TranslateLocally as translation provider.