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

⌈⌋ ⎇ branch:  PageTranslate


Artifact [5d73937d60]

Artifact 5d73937d602202d967c3f3cb8f9fd525f94da941:

  • File test/conftest.py — part of check-in [e93c2ef456] at 2022-10-31 09:08:05 on branch trunk — release as 2.1 (user: mario size: 716)

import pytest
import dotenv
import sys, copy, os, re
sys.path.extend(["./pythonpath/", "../pythonpath/"])
dotenv.load_dotenv()

import httprequests
httprequests.update_headers("pytest/"+pytest.__version__, "2.x-dev")

@pytest.fixture(scope="module")
def params(request, **kw):
    test = re.sub("^\w+/|\.py$", "", request.node.name)
    p = copy.copy({
        "lang": "en",
        "from": "auto",
        "quick": 0,
        "quick": 0,
        "debug": 1,
        "mode": "page",
        "backend": "custom",
        "api_key": os.environ.get(test.upper()),
        #"email": "",
        #"cmd": "",
        "_test_name": request.node.name,
    })
    p.update(kw)
    return p

import translationbackends as tb