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

⌈⌋ ⎇ branch:  PageTranslate


Check-in [e93c2ef456]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:release as 2.1
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | 2.1
Files: files | file ages | folders
SHA1: e93c2ef4569b7cf9701e2d00c72993068a2d18cb
User & Date: mario 2022-10-31 09:08:05
Context
2022-11-15
17:47
prepare for language list updates (seems shorter than default list however) check-in: b469e6efc0 user: mario tags: trunk
2022-10-31
09:08
release as 2.1 check-in: e93c2ef456 user: mario tags: trunk, 2.1
2022-10-25
09:36
combined _assign_t() for conf+data merging (avoid text input in log messages) check-in: c4e7e1d8e1 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

49
50
51
52
53
54
55
56
tk_translate:
	./setup.py bdist_wheel

pylint:
	PYTHONPATH=./pythonpath/:/opt/libreoffice7.1/program/ pylint pagetranslate.py pythonpath/translationbackends.py

test:
	pytest -v







|
49
50
51
52
53
54
55
56
tk_translate:
	./setup.py bdist_wheel

pylint:
	PYTHONPATH=./pythonpath/:/opt/libreoffice7.1/program/ pylint pagetranslate.py pythonpath/translationbackends.py

test:
	pytest -vv -ra

Changes to NEWS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dev (unreleased)
 * DuckDuckGo backend added.
 * Google Cloud Translate available, but untested.
 * Annotations enabled for text selection mode.
 * Target language is now set for translated paragraphs.
 * Internal rewrites.
 * FauxRequests fallback might now work for all backends.
 * Translate-python has been removed (Msft now via D-T).
 * Undo unicode glyphs in dropdown (hiccup in AOO).
 * DeepL and SysTran fixes.
 * ...

2.0 (2022-10-17)
 * Add SYSTRAN backend.
 * Introduce ArgosTranslate binding.
 * Added LibreTranslate via D-T and internal.
 * Select-only mode (disable whole-doc traversal).
 * Added pt-BR as default language in menu.
|









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2.1 (2022-10-31)
 * DuckDuckGo backend added.
 * Google Cloud Translate available, but untested.
 * Annotations enabled for text selection mode.
 * Target language is now set for translated paragraphs.
 * Internal rewrites.
 * FauxRequests fallback might now work for all backends.
 * Translate-python has been removed (Msft now via D-T).
 * Undo unicode glyphs in dropdown (hiccup in AOO).
 * DeepL and SysTran fixes.
 * Added some automated tests for services.

2.0 (2022-10-17)
 * Add SYSTRAN backend.
 * Introduce ArgosTranslate binding.
 * Added LibreTranslate via D-T and internal.
 * Select-only mode (disable whole-doc traversal).
 * Added pt-BR as default language in menu.

Changes to description.xml.

1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
  <identifier value="vnd.include-once.pagetranslate"/>
  <version value="2.0"/>
  <display-name>
    <name lang="en">PageTranslate</name>
  </display-name>
  <dependencies>
    <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
  </dependencies>
  <registration>



|







1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
  <identifier value="vnd.include-once.pagetranslate"/>
  <version value="2.1"/>
  <display-name>
    <name lang="en">PageTranslate</name>
  </display-name>
  <dependencies>
    <OpenOffice.org-minimal-version value="3.0" dep:name="OpenOffice.org 3.0"/>
  </dependencies>
  <registration>

Changes to pagetranslate.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python
# encoding: utf-8
# api: uno
##type: callback
# category: language
# title: PageTranslate
# description: Action button to get whole Writer document translated
# version: 2.0.130
# state: stable
# author: mario
# url: https://fossil.include-once.org/pagetranslate/
# depends: python:requests (>= 2.5), python:uno
# pack: *.py, pythonpath/*.py, META-INF/*, pkg-desc, *.x*, icons/*
# config:
#    { name: frames, type: bool, value: 0, description: traverse TextFrames }







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python
# encoding: utf-8
# api: uno
##type: callback
# category: language
# title: PageTranslate
# description: Action button to get whole Writer document translated
# version: 2.1
# state: stable
# author: mario
# url: https://fossil.include-once.org/pagetranslate/
# depends: python:requests (>= 2.5), python:uno
# pack: *.py, pythonpath/*.py, META-INF/*, pkg-desc, *.x*, icons/*
# config:
#    { name: frames, type: bool, value: 0, description: traverse TextFrames }

Changes to test/conftest.py.

23
24
25
26
27
28
29

        #"cmd": "",
        "_test_name": request.node.name,
    })
    p.update(kw)
    return p

import translationbackends as tb








>
23
24
25
26
27
28
29
30
        #"cmd": "",
        "_test_name": request.node.name,
    })
    p.update(kw)
    return p

import translationbackends as tb

Changes to tk_translate/__init__.py.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# version: 0.5
# state: beta
# license: MITL
# config:
#    { name: source, value: auto, description: assumed source language }
#    { name: target, value: en, description: default target language }
#    { name: linebreakwise, type: bool, value: 0, description: linebreakwise paragraph translation }
#    { name: quick, type: bool, value: 0, description: quick placeholder linebreaks in requests }
# priority: optional
# depends: python >= 3.8, python:PySimpleGUI >= 4.37, python:requests
# pack: pythonpath/*.py=gui/
# architecture: all
# classifiers: translation
# keywords: translation
# url: https://fossil.include-once.org/pagetranslate/







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# version: 0.5
# state: beta
# license: MITL
# config:
#    { name: source, value: auto, description: assumed source language }
#    { name: target, value: en, description: default target language }
#    { name: linebreakwise, type: bool, value: 0, description: linebreakwise paragraph translation }
#    { name: quick, type: bool, value: 0, description: "quick placeholder {..} linebreaks in requests" }
# priority: optional
# depends: python >= 3.8, python:PySimpleGUI >= 4.37, python:requests
# pack: pythonpath/*.py=gui/
# architecture: all
# classifiers: translation
# keywords: translation
# url: https://fossil.include-once.org/pagetranslate/