Translation settings

The options page can be found under Toolsย โ–ธ Optionsย โ–ธ ๐Ÿ—”ย โ–ธ Language Settingsย โ–ธ PageTranslate.

Translation service to use

There's a few built-in backends:

โ˜‘ Google Translate

Google Translate is the default option, and suitable to both text selection and translating whole pages. Provides pretty good machine translations. It incurs some delays for longer texts, as each 1900 characters (sentences/paragraphs) have to be transfered individually (managed automatically, no user interaction necessary).

โ MyMemory

For MyMemory you should specify an email address in the according input box (though it's optional, it unlocks more requests). No longer requires the python-translate module, but langdetect (for supplying the correct source language). Which is why it sometimes fails, and possibly requires the Tools โ†’ PageTranslate โ†’ From โžœ To option. Doesn't yield quite as good machine translations. But it's an open source service.

โ Command line tool

Allows to send each text paragraph to a local application. To use it, set the command in the according input field again. Placeholders are `{lang}` for the target language, and `{text}` for the paragaphs or current text section. (Both get automatically escaped). For translate-cli you might need the -p provider option as well. See also the translate-python documentation on how to prepare a separate ~/.python-translate.cfg. Or use deep-translator cli with for example deep_translator -trans "google" -src "auto" -tg {lang} -txt {text}.

โ DeepL API

Utilizes the speedier DeepL Pro API to translate documents. As of yet untested. Requires an API key and paid subscription. No XML mode (to retain full inline formatting) yet, still translates each text segment/paragraph/sentence individually.

โ DeepL Free API

You can now get a free API key for limited usage (500K characters per month - around 1 or 2 documents per day). This secondary API might not be as well maintained. And signup still requires a credit card (use one of the privacy or temporary online credit card services).

โ DeepL web interface

Utilizes web scraping on the DeepL online translator. Only suitable for testing and translating single paragraphs or text selection, because it quickly blocks with "error 429 - too many requests". It's also kinda redundant now that there's a Free API option.

Some provided via pip install translate-python:

โ Microsoft Translator

Requires an authorization key. There's also a free/test subscription for an API key. Not tested within PageTranslate yet.

And more via pip install deep-translator:

โ QCRI Machine Translation

Requires a free API key, but is suitable for whole-document translations.

โ Yandex Translation

Also requires its own API key.

โ Linguee Dictionary

Performs word-wise translation lookups, so not suitable for translating whole documents, but just text selections. Albeit PageTranslate will split up sentences and pipe each word through the service; that won't yield a readable machine translation.

โ Pons Dictonary

Also is more of a dictionary than a translation service. Suitable for text-selections, but probably not paragraphs or whole documents. PageTranslate will split-process longer selections word-wise through the Pons Translation interface.

Parameters

API key

You can set an API or OAuth key for services that require one. The same input field serves for all backends, so you can't switch between them without also changing this entry first. (Not a common use case to have multiple API subscriptions really).

Email adr

An email address is only required by MyMemory. And strictly speaking it's not even required; it just allows for more translations.

Command

This field defines the CLI tool to use for translation. You can use something other than `translate-cli` or `deep-translator` of course. Placeholders like {lang} and {text} can be used here.

Options / Flags

โ quick linebreak handling

Might speed up table processing with Google Translate, as it avoids sending each newline-split sentence separately. It simply conjoins multiple lines temporarily with "/#ยง/" in place of a linebreak (and then rejoins them), so there are less requests. Primarily helps with tables, but less for documents with lengthy paragraphs.

โ also iterate over TextFrames

Handles normal and floating TextFrames. Those are essentially subdocuments in a Writer page. But you probably don't need this option for standard office documents.

โ super slow mode

Iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. And currently the formatting still bleeds into adjoining paragraph segments, so not very useful in practice yet.

โ˜‘ debug mode

Will fill up the /tmp/pagetranslate-libreoffice.txt log file quicker. Currently the debug mode is enabled by default anyway.