Message translation API

It would be useful to add some button for auto-translate message text using lingva.ml API or any other (defined in settings)

is any solution maybe available or just plugins?

Sending incoming messages to a third-party service leaks encrypted message contents. A solution could be to integrate a local translation model like https://browser.mt/, but the models available at GitHub - mozilla/firefox-translations-models: CPU-optimized Neural Machine Translation models for Firefox Translations are quite large.

1 Like

I meant translation button that send GET request to API selected by user (after message receiving)

The models here used by LibreTranslate are quite small:

that is about 100 mb per language pair, would probably be okay to download - if all further processing is local then.

do you know if there is a rust implementation of LibreTranslate?

1 Like

LibreTranslate itself uses some other underlying library which uses OpenNMT which is a C
++ library. WASM support is not present and we’ll have to ship native binaries. Furthermore, It seems the main usage of CTranslate2 is from Python. We’ll need to use the C++ library from Desktop or core. I am trying to compile the library to see how big it’ll be in the case we wanted to ship it.

Alright, CTranslate2 requires this:

Pay attention to the non-free label…

Edit: Read this as well:

It is redistributable but even with that, it’s only for Intel CPUs.

Edit2: Alright. It can be compiled with MKL. My bad!

The so library is 2.6MiB stripped and the cli tool is 325KiB stripped. I think it makes sense to ship it with desktop if there are no other issues.