Skip to content

Support translateLocally translation provider

marcin mikołajczak requested to merge translateLocally into main

Implementation of translateLocally, which is based on the Bergamot project used for local website translation in Firefox. Seems to work better than LibreTranslate, though not close to Deepl for some models (but German<->English works amazingly well).

I chose this implementation of Bergamot, as it just works for me with their binary for Ubuntu (I use Fedora btw).

For now, models need to be manually specified in config, like:

config :pleroma, Pleroma.Language.Translation.TranslateLocally,
  models: %{
    "de" => %{
      "en" => "de-en-base"
    },
    "en" => %{
      "de" => "en-de-base",
      "pl" => "en-pl-tiny"
    },
    "cs" => %{
      "en" => "cs-en-base"
    },
    "pl" => %{
      "en" => "pl-en-tiny"
    }
  },
  intermediary_language: "en"

Merge request reports

Loading