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

⌈⌋ ⎇ branch:  PageTranslate


Check-in [2d2c5955a6]

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

Overview
Comment:AOO compat. OptionsDialog XCU requires leaf name to equal handler ID.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2d2c5955a613c9031ff157129ea4e2e7c7f3f78c
User & Date: mario 2020-05-29 15:04:35
Context
2020-05-29
15:05
Strip log=None, because importing the module inherits the settings from __main__ anyway. check-in: 3c6f3e31f5 user: mario tags: trunk
15:04
AOO compat. OptionsDialog XCU requires leaf name to equal handler ID. check-in: 2d2c5955a6 user: mario tags: trunk
2020-05-28
17:40
Also strip `.leaf` from <node oor:name= suffix, which now leaves two leaves however. (Prior extension cached?) check-in: 88248edbe0 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.

1
2
3
4
5
6
7
8
9
10
11
12



all:	oxt install

install:
	unopkg remove vnd.include-once.pagetranslate
	unopkg add --log-file log.txt -s pagetranslate.oxt

oxt:
	version  --read pagetranslate.py  --incr  --write pagetranslate.py  --write description.xml
	zip pagetranslate.oxt -r META-INF pagetranslate.py *xcu *xcs *xdl *desc* icons pythonpath/

#pythonpath:
















>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
all:	oxt install

install:
	unopkg remove vnd.include-once.pagetranslate
	unopkg add --log-file log.txt -s pagetranslate.oxt

oxt:
	version  --read pagetranslate.py  --incr  --write pagetranslate.py  --write description.xml
	zip pagetranslate.oxt -r META-INF pagetranslate.py *xcu *xcs *xdl *desc* icons pythonpath/

#pythonpath:

aoo:	oxt
	/opt/openoffice4/program/unopkg add pagetranslate.oxt
	/opt/openoffice4/program/soffice -writer

Changes to OptionsDialog.xcu.

1
2
3
4
5
6
7
8
9
10


11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data
  oor:name="OptionsDialog" oor:package="org.openoffice.Office"
  xmlns:oor="http://openoffice.org/2001/registry"
  xmlns:xs="http://www.w2.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <node oor:name="Nodes">
    <node oor:name="LanguageSettings" oor:op="fuse">  <!-- previously in name="Writer" -->
      <node oor:name="Leaves">
        <node oor:name="vnd.include-once.OptionsPageTranslate" oor:op="fuse">


          <prop oor:name="Id">
            <value>vnd.include-once.OptionsPageTranslate</value>
            <!-- seems irrelevant / just an ID,
                 and can be different from EventHandlerService even -->
          </prop>
          <prop oor:name="Label">
            <value xml:lang="en-US">PageTranslate</value>










>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data
  oor:name="OptionsDialog" oor:package="org.openoffice.Office"
  xmlns:oor="http://openoffice.org/2001/registry"
  xmlns:xs="http://www.w2.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <node oor:name="Nodes">
    <node oor:name="LanguageSettings" oor:op="fuse">  <!-- previously in name="Writer" -->
      <node oor:name="Leaves">
        <node oor:name="vnd.include-once.OptionsPageTranslate" oor:op="fuse">
                   <!-- apparently AOO needs ↑ this equivalent to the EventHandlerService
                        identifier to pick up the relation between XDL and callback -->
          <prop oor:name="Id">
            <value>vnd.include-once.OptionsPageTranslate</value>
            <!-- seems irrelevant / just an ID,
                 and can be different from EventHandlerService even -->
          </prop>
          <prop oor:name="Label">
            <value xml:lang="en-US">PageTranslate</value>