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

⌈⌋ ⎇ branch:  PageTranslate


Check-in [c82a3fa68a]

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

Overview
Comment:Disable ToggleDropdown, update dependencies
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c82a3fa68a9a2f7590ad236d86d7f8c69c5fe3cd
User & Date: mario 2021-06-02 16:45:56
Context
2021-06-02
17:27
Generalize langdetect into base class as `self.lang(text)` check-in: e233f76db8 user: mario tags: trunk
16:45
Disable ToggleDropdown, update dependencies check-in: c82a3fa68a user: mario tags: trunk
16:45
Adapt tooltips check-in: cd67c85797 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Addons.xcu.

772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
              <prop oor:name="Title" oor:type="xs:string"><value>T→🇬🇧</value></prop>
            </node>
            <node oor:name="T4" oor:op="replace">
              <prop oor:name="URL" oor:type="xs:string"><value>service:org.openoffice.comp.pyuno.pagetranslate?page&amp;lang=flag</value></prop>
              <prop oor:name="ImageIdentifier" oor:type="xs:string"><value></value></prop>
              <prop oor:name="Target" oor:type="xs:string"><value>_self</value></prop>
              <prop oor:name="Context" oor:type="xs:string"><value>com.sun.star.text.TextDocument,com.sun.star.drawing.DrawingDocument,com.sun.star.presentation.PresentationDocument</value></prop>
              <prop oor:name="ControlType" oor:type="xs:string"><value>ToggleDropdownButton</value></prop>
              <prop oor:name="Title" oor:type="xs:string"><value xml:lang="en-US">🏴</value></prop>
              <prop oor:name="List" oor:type="xs:string"><value xml:lang="en-US">locale config etc</value></prop>
            </node>
            <node oor:name="T5" oor:op="replace">
              <prop oor:name="URL" oor:type="xs:string"><value>private:separator</value></prop>
            </node>
          </node>
        </node>
      </node>







|

|







772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
              <prop oor:name="Title" oor:type="xs:string"><value>T→🇬🇧</value></prop>
            </node>
            <node oor:name="T4" oor:op="replace">
              <prop oor:name="URL" oor:type="xs:string"><value>service:org.openoffice.comp.pyuno.pagetranslate?page&amp;lang=flag</value></prop>
              <prop oor:name="ImageIdentifier" oor:type="xs:string"><value></value></prop>
              <prop oor:name="Target" oor:type="xs:string"><value>_self</value></prop>
              <prop oor:name="Context" oor:type="xs:string"><value>com.sun.star.text.TextDocument,com.sun.star.drawing.DrawingDocument,com.sun.star.presentation.PresentationDocument</value></prop>
              <prop oor:name="ControlType" oor:type="xs:string"><value>CheckButton<!--ToggleDropdownButton--></value></prop>
              <prop oor:name="Title" oor:type="xs:string"><value xml:lang="en-US">🏴</value></prop>
              <prop oor:name="List" oor:type="xs:string"><value xml:lang="en-US">locale paragraph select en config debug etc</value></prop>
            </node>
            <node oor:name="T5" oor:op="replace">
              <prop oor:name="URL" oor:type="xs:string"><value>private:separator</value></prop>
            </node>
          </node>
        </node>
      </node>

Changes to Makefile.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	unopkg remove vnd.include-once.pagetranslate
	unopkg add --log-file log.txt -s pagetranslate.oxt

version: # https://fossil.include-once.org/versionnum/
	which version  &&  version  --read pagetranslate.py  --incr  --write pagetranslate.py  --write description.xml  ||  true

oxt:
	zip pagetranslate.oxt -r META-INF pagetranslate.py *xcu *xcs *xdl *desc* icons pythonpath/ help

aoo:	version oxt
	#/opt/openoffice4/program/unopkg remove pagetranslate.oxt
	/opt/openoffice4/program/unopkg add pagetranslate.oxt
	# Shift+F1 for UNO names of widgets
	HELP_DEBUG=true /opt/openoffice4/program/soffice -writer
	







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	unopkg remove vnd.include-once.pagetranslate
	unopkg add --log-file log.txt -s pagetranslate.oxt

version: # https://fossil.include-once.org/versionnum/
	which version  &&  version  --read pagetranslate.py  --incr  --write pagetranslate.py  --write description.xml  ||  true

oxt:
	zip pagetranslate.oxt -r META-INF pagetranslate.py *xcu *xcs *xdl *desc* icons pythonpath/ help NEWS

aoo:	version oxt
	#/opt/openoffice4/program/unopkg remove pagetranslate.oxt
	/opt/openoffice4/program/unopkg add pagetranslate.oxt
	# Shift+F1 for UNO names of widgets
	HELP_DEBUG=true /opt/openoffice4/program/soffice -writer
	

Changes to pythonpath/Makefile.

1
2
3
4
5
6
7

8

9
# The pythonpath/ directory can be packaged alongside, to inject new python
# packages into LibreOffices` python bundle. Which really just makes sense
# for the Windows package, because distro-packaged Office setups utilize the
# system python path.


all:

	pip3 install requests langdetect translate six -t ./ --upgrade --no-compile









>
|
>

1
2
3
4
5
6
7
8
9
10
11
# The pythonpath/ directory can be packaged alongside, to inject new python
# packages into LibreOffices` python bundle. Which really just makes sense
# for the Windows package, because distro-packaged Office setups utilize the
# system python path.


all:
	pip2 install requests langdetect six -t ./ --upgrade --no-compile
	#pip install translate -t ./ --upgrade --no-compile
	pip3 install deep-translator -t ./ --upgrade --no-compile