translatelocally-web-ext
translatelocally-web-ext copied to clipboard
TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
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.
Installation in Firefox
- Download the translatelocally.xpi file from the latest release.
- If you do this in Firefox, it will prompt you to install it
- Otherwise, open Firefox and drag & drop the downloaded file into it. It will then prompt you to install it.
Features
- Runs entirely offline (it downloads the necessary language model on demand, but it will never submit any text or metadata to any server.)
- In-page translations, including support for web apps.
- Translates selection
- Translate as you type in form fields
- Can use TranslateLocally for even faster and more efficient translations. And you can import any translation model that is supported by Marian.
Differences from Firefox Translations
- Uses models from https://github.com/browsermt/students. Most of these are also available through Mozilla's extension.
- UI is a button + popup instead of the translation bar because the translation bar is not available for unprivileged extensions.
- Translation engine and memory is shared among all tabs and webpages
- Removed optional translation quality indicators
- UI is only in English (for now)
Instructions for development
- Install Firefox (Nightly for better performance when using WASM)
- Clone this repo and run
npm install
- Run
npm run watch
and wait until Firefox starts - 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
- Download the latest release from the TranslateLocally
- …and start it once. This will register the native client with Firefox.
- Go to about://addons, click "TranslateLocally for Firefox", and click "Preferences".
- 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:
- Clone or download this repository
- Open Google Chrome, go to chrome://extensions/, and turn on developer mode (the toggle in top right corner)
- Click Load Unpacked
- Select the extension folder in your local copy of this repository
- Get translateLocally
- Once you have a binary of translateLocally, run
./translateLocally --allow-client AABBCC
whereAABBCC
is the extension ID Chrome assigned to your installed version of this extension. - (Restart Chrome? Not sure this is necessary)
- Go to the Extension options page of this extension and select TranslateLocally as translation provider.