024aade152
* Adding _locales submodule pointing to https://github.com/mozilla-l10n/firefox-translations-l10n * Removing CODEOWNERS |
||
---|---|---|
.github/workflows | ||
extension | ||
scripts | ||
.eslintrc.js | ||
.gitignore | ||
.gitmodules | ||
LICENSE | ||
README.md | ||
package-lock.json | ||
package.json |
README.md
Firefox Translations
Firefox Translations is a webextension that enables client side in-page translations for web browsers.
Instructions to run
- Install Firefox Nightly
- Clone this repo and run
npm install
- Run
npm run once
and wait until Nightly starts - Go to
about:config
and setextensions.experiments.enabled
to true - Browse to a page in any of the supported languages (https://github.com/mozilla/firefox-translations-models/#currently-supported-languages) to have the translation option to appear
Development
Updating telemetry schema
After adding new metrics to extension/model/telemetry/metrics.yaml
or pings to extension/model/telemetry/pings.yaml
, run
bash scripts/update-telemetry-schema.sh
to regenerate JS telemetry schema.
Updating bergamot-translator WASM module
After replacing extension/controller/translation/bergamot-translation-worker.js
, run
bash scripts/update-bergamot-translator.sh
to regenerate JS version file. This version is reported in telemetry.
Testing
Preliminary builds
One can test preliminary versions of the extension in Firefox Nightly since an artifact is generated on every commit. In order to do that, go to the Github Action, click at the commit you wish to test, and then click to download the artifact as a zip file at the end of the page. With that:
- Download Firefox Nightly
- Type
about:addons
in the navigation bar, click on the gear to he right, then oninstall from a file
and load the saved zip file. - Type
about:config
in the navigation bar again, and switch the following preferences:extensions.translations.disabled
totrue
extensions.experiments.enabled
totrue
javascript.options.wasm_simd_wormhole
totrue
xpinstall.signatures.required
tofalse
And then you should be able to use the extension.