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

⌈⌋ ⎇ branch:  PageTranslate


View Ticket

Ticket Hash: c2fdc44dc54b9850b476c0b5f8c7b35497cf680a
Title: Gave error on translation to Spanish with Deepl Web interface slected
Status: Closed Type: Incident
Severity: Important Priority: Low
Subsystem: Resolution: Overcome_By_Events
Last Modified: 2022-11-03 12:57:32
Version Found In: 1.7
User Comments:
anonymous added on 2022-10-17 02:31:09:
Selected Deepl Web interface  ( OPS Windows 7 Pro)

Expecting Value: Line 1 column 1 (char 0)

Traceback (most recent call last):
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pagetranslate.py", line 125, in trigger
    self.rewrite_selection(selection)
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pagetranslate.py", line 215, in rewrite_selection
    self.assign_t()
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pagetranslate.py", line 146, in assign_t
    self.t = translationbackends.assign_service(self.params)
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pythonpath\translationbackends.py", line 455, in assign_service
    if params.get("deepl_web"):    return deepl_web(params)
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pythonpath\translationbackends.py", line 142, in __init__
    j = http.post(
  File "C:\Users\Steve\AppData\Roaming\LibreOffice\4\user\uno_packages\cache\uno_packages\lu7980ya2h.tmp_\pagetranslate1.oxt\pythonpath\requests\models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Program Files\LibreOffice\program\python-core-3.8.10\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\LibreOffice\program\python-core-3.8.10\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\LibreOffice\program\python-core-3.8.10\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

mario added on 2022-10-18 21:44:08:

Thanks for the BR. But it appears an old version of the plugin. (line 455) Newest release (2.0) seems to work, albeit not suitable for recurring use.