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

βŒˆβŒ‹ βŽ‡ branch:  PageTranslate


Check-in [1bb59b3af8]

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

Overview
Comment:Minor reshuffling in config dialog (and get rid of parenthesis)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1bb59b3af8210bcaf19f5101f13b943b2547ff35
User & Date: mario 2021-02-08 05:57:47
Context
2021-02-08
16:00
Prettier error/esxception dialog, and Fromβ†’To language selection mode now available per menu entry. (Only used by MyMemory for now.) check-in: ab2252ef7a user: mario tags: trunk
05:57
Minor reshuffling in config dialog (and get rid of parenthesis) check-in: 1bb59b3af8 user: mario tags: trunk
05:48
Add langdetect as dependency/bundle (used by mymemory) check-in: 3f3f41295e user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to OptionsDialog.xdl.

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
<?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:help-url="vnd.sun.star.help://help/vnd.include-once.pagetranslate/config.xhp?Language=en&amp;System=UNIX&amp;UseDB=no" dlg:left="110" dlg:top="50" dlg:width="283" dlg:height="258" dlg:closeable="true" dlg:moveable="true" dlg:title="Title" dlg:withtitlebar="false">
 <dlg:bulletinboard>
  <dlg:radiogroup>
   <dlg:radio dlg:id="google" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="115" dlg:height="12" dlg:help-text="Standard translation service" dlg:value="Google Translate web service" dlg:group-name="backend" dlg:checked="true"/>
   <dlg:radio dlg:id="deepl_web" dlg:tab-index="1" dlg:left="10" dlg:top="25" dlg:width="115" dlg:height="12" dlg:help-text="not yet implemented" dlg:value="DeepL web interface (slower?)" dlg:group-name="backend"/>
   <dlg:radio dlg:id="deepl_api" dlg:tab-index="2" dlg:left="10" dlg:top="40" dlg:width="95" dlg:height="19" dlg:help-text="Requires subscription and API key" dlg:value="DeepL translation API (faster&#x0a;and better formatting?)" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="microsoft" dlg:tab-index="3" dlg:left="10" dlg:top="61" dlg:width="95" dlg:height="18" dlg:help-text="Requires an OAuth secret in API key" dlg:value="Microsoft Translator API&#x0a;(via translate-python)" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="mymemory" dlg:tab-index="4" dlg:left="10" dlg:top="82" dlg:width="84" dlg:height="19" dlg:help-text="Add an email address instead of API key" dlg:value="MyMemory&#x0a;(via translate-python)" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="cli" dlg:tab-index="5" dlg:left="10" dlg:top="105" dlg:width="83" dlg:height="18" dlg:help-text="For instace `translate-cli -t en {}`" dlg:value="command line tool&#x0a;(CLI program)" dlg:multiline="true" dlg:group-name="backend"/>
  </dlg:radiogroup>
  <dlg:textfield dlg:id="api_key" dlg:tab-index="6" dlg:left="115" dlg:top="53" dlg:width="93" dlg:height="12" dlg:help-text="Key required for DeepL, Microsoft Translator, or Google Translate API (not implemented here)"/>
  <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="7" dlg:disabled="true" dlg:left="110" dlg:top="39" dlg:width="105" dlg:height="36" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="API key / OAuth secret"/>
  </dlg:titledbox>
  <dlg:checkbox dlg:id="frames" dlg:tab-index="8" dlg:left="10" dlg:top="149" dlg:width="184" dlg:height="12" dlg:help-text="Traverse subdocuments (frames / floating frames) as well" dlg:value="also iterate over TextFrames" dlg:checked="false"/>
  <dlg:checkbox dlg:id="quick" dlg:tab-index="9" dlg:left="10" dlg:top="132" dlg:width="185" dlg:height="12" dlg:help-text="Temporary placeholders instead of iterating over newline breaks. (Only tested with Google Translate. Might screw up others.)" dlg:value="quick paragraph linebreak handling" dlg:checked="false"/>
  <dlg:checkbox dlg:id="debug" dlg:tab-index="10" dlg:left="10" dlg:top="182" dlg:width="182" dlg:height="12" dlg:help-text="Log file in /tmp/pagetranslate-libreoffice.txt" dlg:value="additonal debugging" dlg:checked="true"/>
  <dlg:titledbox dlg:id="FrameControl2" dlg:tab-index="12" dlg:disabled="true" dlg:left="100" dlg:top="76" dlg:width="105" dlg:height="25" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="Email address"/>
  </dlg:titledbox>
  <dlg:titledbox dlg:id="FrameControl3" dlg:tab-index="14" dlg:disabled="true" dlg:left="100" dlg:top="100" dlg:width="105" dlg:height="25" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="Command"/>
  </dlg:titledbox>
  <dlg:textfield dlg:id="cmd" dlg:tab-index="13" dlg:left="106" dlg:top="109" dlg:width="93" dlg:height="12" dlg:help-text="Command to run, use `{}` as placeholder for text section"/>
  <dlg:textfield dlg:id="email" dlg:tab-index="11" dlg:left="105" dlg:top="85" dlg:width="93" dlg:height="12" dlg:help-text="MyMemory asks for an email addres (does not require it)"/>
  <dlg:checkbox dlg:id="slow" dlg:tab-index="15" dlg:left="11" dlg:top="165" dlg:width="183" dlg:height="12" dlg:help-text="Split sentences on formatting prior translation (= more roundtrips, less cohesive sentence structure / translation)" dlg:value="super slow mode (retain more inline-paragraph formatting)" dlg:checked="false"/>
 </dlg:bulletinboard>
</dlg:window>






|
|
|
|
|












|






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
<?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:help-url="vnd.sun.star.help://help/vnd.include-once.pagetranslate/config.xhp?Language=en&amp;System=UNIX&amp;UseDB=no" dlg:left="110" dlg:top="50" dlg:width="283" dlg:height="258" dlg:closeable="true" dlg:moveable="true" dlg:title="Title" dlg:withtitlebar="false">
 <dlg:bulletinboard>
  <dlg:radiogroup>
   <dlg:radio dlg:id="google" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="115" dlg:height="12" dlg:help-text="Standard translation service" dlg:value="Google Translate web service" dlg:group-name="backend" dlg:checked="true"/>
   <dlg:radio dlg:id="deepl_web" dlg:tab-index="1" dlg:left="10" dlg:top="25" dlg:width="115" dlg:height="12" dlg:help-text="broken again" dlg:value="DeepL web interface" dlg:group-name="backend"/>
   <dlg:radio dlg:id="deepl_api" dlg:tab-index="2" dlg:left="10" dlg:top="45" dlg:width="95" dlg:height="19" dlg:help-text="Requires subscription and API key" dlg:value="DeepL translation API" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="microsoft" dlg:tab-index="3" dlg:left="10" dlg:top="62" dlg:width="95" dlg:height="18" dlg:help-text="Requires an OAuth secret in API key" dlg:value="Microsoft Translator API" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="mymemory" dlg:tab-index="4" dlg:left="10" dlg:top="85" dlg:width="84" dlg:height="19" dlg:help-text="Add an email address instead of API key" dlg:value="MyMemory" dlg:multiline="true" dlg:group-name="backend"/>
   <dlg:radio dlg:id="cli" dlg:tab-index="5" dlg:left="10" dlg:top="105" dlg:width="83" dlg:height="18" dlg:help-text="For instace `translate-cli -t en {}`" dlg:value="command line tool" dlg:multiline="true" dlg:group-name="backend"/>
  </dlg:radiogroup>
  <dlg:textfield dlg:id="api_key" dlg:tab-index="6" dlg:left="115" dlg:top="53" dlg:width="93" dlg:height="12" dlg:help-text="Key required for DeepL, Microsoft Translator, or Google Translate API (not implemented here)"/>
  <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="7" dlg:disabled="true" dlg:left="110" dlg:top="39" dlg:width="105" dlg:height="36" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="API key / OAuth secret"/>
  </dlg:titledbox>
  <dlg:checkbox dlg:id="frames" dlg:tab-index="8" dlg:left="10" dlg:top="149" dlg:width="184" dlg:height="12" dlg:help-text="Traverse subdocuments (frames / floating frames) as well" dlg:value="also iterate over TextFrames" dlg:checked="false"/>
  <dlg:checkbox dlg:id="quick" dlg:tab-index="9" dlg:left="10" dlg:top="132" dlg:width="185" dlg:height="12" dlg:help-text="Temporary placeholders instead of iterating over newline breaks. (Only tested with Google Translate. Might screw up others.)" dlg:value="quick paragraph linebreak handling" dlg:checked="false"/>
  <dlg:checkbox dlg:id="debug" dlg:tab-index="10" dlg:left="10" dlg:top="182" dlg:width="182" dlg:height="12" dlg:help-text="Log file in /tmp/pagetranslate-libreoffice.txt" dlg:value="additonal debugging" dlg:checked="true"/>
  <dlg:titledbox dlg:id="FrameControl2" dlg:tab-index="12" dlg:disabled="true" dlg:left="100" dlg:top="76" dlg:width="105" dlg:height="25" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="Email address"/>
  </dlg:titledbox>
  <dlg:titledbox dlg:id="FrameControl3" dlg:tab-index="14" dlg:disabled="true" dlg:left="100" dlg:top="100" dlg:width="105" dlg:height="25" dlg:help-text="requires an API key / else will use *SLOWER* web page requests">
   <dlg:title dlg:value="CLI program"/>
  </dlg:titledbox>
  <dlg:textfield dlg:id="cmd" dlg:tab-index="13" dlg:left="106" dlg:top="109" dlg:width="93" dlg:height="12" dlg:help-text="Command to run, use `{}` as placeholder for text section"/>
  <dlg:textfield dlg:id="email" dlg:tab-index="11" dlg:left="105" dlg:top="85" dlg:width="93" dlg:height="12" dlg:help-text="MyMemory asks for an email addres (does not require it)"/>
  <dlg:checkbox dlg:id="slow" dlg:tab-index="15" dlg:left="11" dlg:top="165" dlg:width="183" dlg:height="12" dlg:help-text="Split sentences on formatting prior translation (= more roundtrips, less cohesive sentence structure / translation)" dlg:value="super slow mode (retain more inline-paragraph formatting)" dlg:checked="false"/>
 </dlg:bulletinboard>
</dlg:window>