LibreOffice plugin to pipe whole Writer documents through Google Translate, that ought to keep most of the page formatting.

⌈⌋ branch:  PageTranslate


options

The settings page allows to define a few operation parameters.

Primarily which service to use:

Google Translate is the default

DeepL web interface (kinda works, but only allows a few short paragraphs to be translated / then blocks further requests / "error 429")

DeepL per API (as of yet untested)

API key (also for Microsoft Translator)
<input type=text size=24>

Microsoft Translator (requires an authorization key, and a pip install translate system package)

MyMemory (should have an email address in the "API key" field, also requires pip install translate)

Email (optional, but recommended)
<input type=text size=24 value=you@example.com>

Command line tool allows to send each text paragraph to a local application. To use it, set the command in the "API key" field again.

Command
<input type=text size=24 value="translate-cli -o -t {lang} {text}">

Where `{text}` is a placeholder for the current text section. (Automatically escaped.)

Additional options:

quick linebreak handling might speed up table processing with Google Translate, as it avoids sending each newline-split sentence separately.

super slsow mode iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. Not very useful in practice.

also iterate over TextFrames handles floating textframes / subdocuments.

debug mode will fill up the /tmp/pagetranslate-libreoffice.txt file quicker