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

⌈⌋ branch:  PageTranslate


Check-in [b7a0126051]

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

Overview
Comment:Add basic OpenOffice options dialog registry, definition and schema. (Just decorative for now. Requires WindowEventHandler still to be of any use.)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b7a01260516693ba004f3837b0e2c63b2cf9672c
User & Date: mario 2020-05-23 09:34:31
Context
2020-05-23
09:35
move license text to pkg-desc/ check-in: 3ab89c30c4 user: mario tags: trunk
09:34
Add basic OpenOffice options dialog registry, definition and schema. (Just decorative for now. Requires WindowEventHandler still to be of any use.) check-in: b7a0126051 user: mario tags: trunk
09:33
Introduce requests, restructure regex+http methods into classes to allow different translation backends (deepl), prepare for config settings. check-in: ebfff6744f user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added OptionsDialog.xcu.



































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?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="Writer" oor:op="fuse">
      <node oor:name="Leaves">
        <node oor:name="vnd.include-once.OptionsPageTranslate" oor:op="fuse">
          <prop oor:name="Id">
            <value>vnd.include-once.OptionsPageTranslate</value>
          </prop>
          <prop oor:name="Label">
            <value xml:lang="en-US">PageTranslate</value>
          </prop>
          <prop oor:name="OptionsPage">
            <value>%origin%/OptionsDialog.xdl</value>
            <!--value>vnd.sun.star.extension://vnd.include-once.pagetranslate/OptionsPage.xdl</value-->
          </prop>
          <prop oor:name="EventHandlerService">
            <value></value>
            <!--value>service:org.openoffice.comp.pyuno.pagetranslate_options</value-->
            <!--value>org.libreoffice.comp.pyuno.LightproofOptionsEventHandler.en</value-->
            <!--value>vnd.include-once.OptionsPageSettings</value-->
          </prop>
        </node>
      </node>
    </node>
  </node>
</oor:component-data>
<!-- https://github.com/p&mdash;-q/OptionsDialog/tree/master/OptionsDialog/src -->
<!-- https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/Adding_a_Leaf_to_an_Existing_Node -->

Added OptionsDialog.xdl.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script"
    dlg:id="OptionsPageTranslate" dlg:left="110" dlg:top="50" dlg:width="190" dlg:height="150"
    dlg:closeable="false" dlg:moveable="false" dlg:title="Title" dlg:withtitlebar="false">
 <dlg:bulletinboard>
  <dlg:checkbox dlg:id="useDeepL" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="160" dlg:height="12" dlg:help-text="instead of the default Google Translate" dlg:value="use DeepL translation service" dlg:checked="false"/>
  <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="1" dlg:left="25" dlg:top="25" dlg:width="155" dlg:height="40" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="API key"/>
   <dlg:textfield dlg:id="apiKey" dlg:tab-index="2" dlg:left="10" dlg:top="15" dlg:width="135" dlg:height="12" dlg:help-text="Key required for faster translation service"/>
  </dlg:titledbox>
  <dlg:checkbox dlg:id="debug" dlg:tab-index="3" dlg:left="10" dlg:top="70" dlg:width="160" dlg:height="12" dlg:value="additonal debugging" dlg:checked="true" dlg:help-text="Log file in /tmp/pagetranslate-libreoffice.txt"/>
 </dlg:bulletinboard>
</dlg:window>

Added OptionsSchema.xcs.

















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8"?>
<!-- oor:name must be identical to the filename of this xcs file //-->
<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  oor:name="OptionsSchema"
  oor:package="vnd.include-once.org.pagetranslate" xml:lang="en-US">
  
  <!-- struct for config nodes `/vnd.include-once.org.pagetranslate.OptionsSchema/Leaves` ?? -->
  
  <info>
    <author></author>
    <desc>Contains the options data used for the test extensions.</desc>
  </info>
  <templates>
    <group oor:name="Leaf">
      <info>
        <desc>The data for one leaf.</desc>
      </info>
      <prop oor:name="String0" oor:type="xs:string">
        <value></value>
      </prop>
      <prop oor:name="String1" oor:type="xs:string">
        <value></value>
      </prop>
      <prop oor:name="String2" oor:type="xs:string">
        <value></value>
      </prop>
      <prop oor:name="String3" oor:type="xs:string">
        <value></value>
      </prop>
      <prop oor:name="String4" oor:type="xs:string">
        <value></value>
      </prop>
    </group>
  </templates>
  <component>
    <group oor:name="Leaves">
      <group oor:name="FooOptionsPage" oor:type="Leaf">
        <prop oor:name="chkFoobarA" oor:type="xs:short">
          <value>0</value>
        </prop>
        <prop oor:name="chkFoobarB" oor:type="xs:short">
          <value>1</value>
        </prop>
        <prop oor:name="lstLikeMost" oor:type="oor:string-list">
          <value>Apples Bananas Oranges Grapes</value>
        </prop>
        <prop oor:name="lstLikeMostSelected" oor:type="oor:short-list">
          <value>0</value>
        </prop>
      </group>
    </group>
  </component>
</oor:component-schema>
y