Check-in [e2c879925e]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Update documentation on new option. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e2c879925e9ec6e3468d1b0cc08e44f2 |
User & Date: | mario 2021-12-30 02:18:34 |
Context
2022-01-01
| ||
22:24 | readd proper icon url check-in: 287c5372dc user: mario tags: trunk | |
2021-12-30
| ||
02:18 | Update documentation on new option. check-in: e2c879925e user: mario tags: trunk | |
02:10 | Added pt-BR (Brazilian-Portuguese) menu entry check-in: a1aea47667 user: mario tags: trunk | |
Changes
Changes to description.xml.
1 2 3 | <?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"/> | | | 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="1.9.77"/> <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 help/en/vnd.include-once.pagetranslate/config.page.
︙ | ︙ | |||
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | But you probably don't need this option for standard office documents.</p> </item> <item> <title>ā super slow mode</title> <p>Iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. And currently the formatting still bleeds into adjoining paragraph segments, so not very useful in practice yet.</p> </item> <item> <title>ā debug mode</title> <p>Will fill up the <file>/tmp/pagetranslate-libreoffice.txt</file> log file quicker. Currently the debug mode is enabled by default anyway.</p> </item> </terms> </section> | > > > > > > | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | But you probably don't need this option for standard office documents.</p> </item> <item> <title>ā super slow mode</title> <p>Iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. And currently the formatting still bleeds into adjoining paragraph segments, so not very useful in practice yet.</p> </item> <item> <title>ā selection-only mode</title> <p>Disables the whole document translation mode. This turns PageTranslate into the original Tradutor plugin, which might be useful to prevent long waiting times for big documents when only a partial translation was wanted. Will simply trigger a warning if no paragraph selection is active.</p> </item> <item> <title>ā debug mode</title> <p>Will fill up the <file>/tmp/pagetranslate-libreoffice.txt</file> log file quicker. Currently the debug mode is enabled by default anyway.</p> </item> </terms> </section> |
︙ | ︙ |
Changes to help/en/vnd.include-once.pagetranslate/config.xhp.
1 2 3 4 5 6 7 8 9 | <?xml version="1.0" encoding="UTF-8"?> <helpdocument version="1.0"> <meta> <topic id="topic_d1e3" indexer="include" status="PUBLISH"> <title xml-lang="en" id="title_d1e3">Translation settings</title> <filename>/help/vnd.include-once.pagetranslate/config.xhp</filename> </topic> <history> <created date="2020-02-02T22:22:22"/> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?xml version="1.0" encoding="UTF-8"?> <helpdocument version="1.0"> <meta> <topic id="topic_d1e3" indexer="include" status="PUBLISH"> <title xml-lang="en" id="title_d1e3">Translation settings</title> <filename>/help/vnd.include-once.pagetranslate/config.xhp</filename> </topic> <history> <created date="2020-02-02T22:22:22"/> <lastedited date="2021-12-30T03:18:08.194+01:00"/> </history> </meta> <body> <bookmark id="bm_d1e7" branch="hid/vnd.include-once.pagetranslate:OptionsPageTranslate" xml-lang="en"> <bookmark_value>PageTranslate settings</bookmark_value> |
︙ | ︙ | |||
246 247 248 249 250 251 252 253 254 | <listitem id="item_d1e353" xml-lang="en"> <emph>ā super slow mode</emph> <br/> <paragraph id="par_d1e358" role="paragraph" xml-lang="en">Iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. And currently the formatting still bleeds into adjoining paragraph segments, so not very useful in practice yet.</paragraph> </listitem> <listitem id="item_d1e362" xml-lang="en"> <emph>ā debug mode</emph> <br/> | > > > > > > > | | | | | | | | | | | | | | | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | <listitem id="item_d1e353" xml-lang="en"> <emph>ā super slow mode</emph> <br/> <paragraph id="par_d1e358" role="paragraph" xml-lang="en">Iterates over paragraph segments, to keep more inline formatting - but seriously harms mid-sentence translations. And currently the formatting still bleeds into adjoining paragraph segments, so not very useful in practice yet.</paragraph> </listitem> <listitem id="item_d1e362" xml-lang="en"> <emph>ā selection-only mode</emph> <br/> <paragraph id="par_d1e367" role="paragraph" xml-lang="en">Disables the whole document translation mode. This turns PageTranslate into the original Tradutor plugin, which might be useful to prevent long waiting times for big documents when only a partial translation was wanted. Will simply trigger a warning if no paragraph selection is active.</paragraph> </listitem> <listitem id="item_d1e371" xml-lang="en"> <emph>ā debug mode</emph> <br/> <paragraph id="par_d1e376" role="paragraph" xml-lang="en">Will fill up the <item type="fileitem">/tmp/pagetranslate-libreoffice.txt</item> log file quicker. Currently the debug mode is enabled by default anyway.</paragraph> </listitem> </list> </paragraph> <paragraph id="sect_d1e385" role="section" xml-lang="en"> <paragraph id="hd_d1e387" role="heading" level="2" xml-lang="en">š“ button default behaviour/target language</paragraph> <list id="terms_d1e390" xml-lang="en"> <listitem id="item_d1e392" xml-lang="en"> <emph>locale</emph> <br/> <paragraph id="par_d1e397" role="paragraph" xml-lang="en"> Per default uses the Office/system language as target. </paragraph> </listitem> <listitem id="item_d1e401" xml-lang="en"> <emph>paragraph</emph> <br/> <paragraph id="par_d1e406" role="paragraph" xml-lang="en"> Uses the "paragraph" locale as set in the Writer/language status bar. </paragraph> </listitem> <listitem id="item_d1e410" xml-lang="en"> <emph>select</emph> <br/> <paragraph id="par_d1e415" role="paragraph" xml-lang="en"> Always brings up the explicit FromāTošŗ language selection popup (useful for MyMemory or Pons backends).</paragraph> </listitem> <listitem id="item_d1e419" xml-lang="en"> <emph>en, de, it, fr, ...</emph> <br/> <paragraph id="par_d1e424" role="paragraph" xml-lang="en"> You can set this field to any two-letter language code - to be used as default target. </paragraph> </listitem> <listitem id="item_d1e428" xml-lang="en"> <emph>mri-debug</emph> <br/> <paragraph id="par_d1e433" role="paragraph" xml-lang="en"> Requires the MRI extension, and brings up an introspection dialog on the document when invoked. </paragraph> </listitem> </list> </paragraph> </body> </helpdocument> |
Changes to help/en/vnd.include-once.pagetranslate/errors.xhp.
1 2 3 4 5 6 7 8 9 | <?xml version="1.0" encoding="UTF-8"?> <helpdocument version="1.0"> <meta> <topic id="topic_d1e1" indexer="include" status="PUBLISH"> <title xml-lang="en" id="title_d1e1">Errors</title> <filename>/help/vnd.include-once.pagetranslate/errors.xhp</filename> </topic> <history> <created date="2020-02-02T22:22:22"/> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?xml version="1.0" encoding="UTF-8"?> <helpdocument version="1.0"> <meta> <topic id="topic_d1e1" indexer="include" status="PUBLISH"> <title xml-lang="en" id="title_d1e1">Errors</title> <filename>/help/vnd.include-once.pagetranslate/errors.xhp</filename> </topic> <history> <created date="2020-02-02T22:22:22"/> <lastedited date="2021-12-30T03:18:09.451+01:00"/> </history> </meta> <body> <link href="vnd.include-once.pagetranslate/index.xhp"/> <paragraph id="hd_d1e8" role="heading" level="1" xml-lang="en">Errors</paragraph> <paragraph id="par_d1e11" role="paragraph" xml-lang="en">Error messages will largely show up as long-winded popups with Python exceptions. Where the text usually starts with "Traceback" and then |
︙ | ︙ | |||
68 69 70 71 72 73 74 | <paragraph id="sect_d1e84" role="section" xml-lang="en"> <paragraph id="hd_d1e86" role="heading" level="2" xml-lang="en">uno.RuntimeException/AttributeError: ... object has no attribute 'getTypes'</paragraph> <paragraph id="par_d1e89" role="paragraph" xml-lang="en">Such errors are often resulting from one of the translation backends not returning a proper text string / translation. Please fill a bug report with your log, and use a different service for the time being.</paragraph> </paragraph> <paragraph id="sect_d1e94" role="section" xml-lang="en"> | | > > > > > | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > | | | | | | | | | | | | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | <paragraph id="sect_d1e84" role="section" xml-lang="en"> <paragraph id="hd_d1e86" role="heading" level="2" xml-lang="en">uno.RuntimeException/AttributeError: ... object has no attribute 'getTypes'</paragraph> <paragraph id="par_d1e89" role="paragraph" xml-lang="en">Such errors are often resulting from one of the translation backends not returning a proper text string / translation. Please fill a bug report with your log, and use a different service for the time being.</paragraph> </paragraph> <paragraph id="sect_d1e94" role="section" xml-lang="en"> <paragraph id="hd_d1e96" role="heading" level="2" xml-lang="en">AttributeError: 'LangSelection' object has no attribute 'to'</paragraph> <paragraph id="par_d1e99" role="paragraph" xml-lang="en">That's the shallow error message when the FromāTo language selection was canceled by closing the dialog.</paragraph> </paragraph> <paragraph id="sect_d1e103" role="section" xml-lang="en"> <paragraph id="hd_d1e105" role="heading" level="2" xml-lang="en">Options dialog is empty</paragraph> <paragraph id="par_d1e108" role="paragraph" xml-lang="en">This might be a development bug only. If the log shows nothing but the __init__ call, the extension usually requires removal and reinstall (per CLI *and* GUI extension manager perhaps). Presumably there's some old schema version in the OO registry, which prevents updated versions from taking effect.</paragraph> </paragraph> <paragraph id="sect_d1e112" role="section" xml-lang="en"> <paragraph id="hd_d1e114" role="heading" level="2" xml-lang="en">WARNING:root:NO TRANSLATION RESULT EXTRACTED</paragraph> <paragraph id="par_d1e117" role="paragraph" xml-lang="en">If this messsage shows up in the log, the google translate backend (`pythonpath/translationbackends.py`) requires updating. Specifically the regex in `rx_gtrans` for extracting the target string.</paragraph> </paragraph> <paragraph id="sect_d1e121" role="section" xml-lang="en"> <paragraph id="hd_d1e123" role="heading" level="2" xml-lang="en">MyMemory: PLEASE SELECT TWO DISTINCT LANGUAGES</paragraph> <paragraph id="par_d1e126" role="paragraph" xml-lang="en">The langauge detection failed. You'll probably have to use the ToolsāPageTranslateāFromāTo dialog to specify both input and target language.</paragraph> </paragraph> <paragraph id="sect_d1e130" role="section" xml-lang="en"> <paragraph id="hd_d1e132" role="heading" level="2" xml-lang="en">MyMemory: INVALID EMAIL PROVIDED</paragraph> <paragraph id="par_d1e135" role="paragraph" xml-lang="en">Add an email address (ToolsāOptionsāLanguageāPageTranslate) for MyMemory.</paragraph> </paragraph> <paragraph id="sect_d1e139" role="section" xml-lang="en"> <paragraph id="hd_d1e141" role="heading" level="2" xml-lang="en">MyMemory: 'AUTO' IS AN INVALID SOURCE LANGUAGE.</paragraph> <paragraph id="par_d1e144" role="paragraph" xml-lang="en">This error shouldn't really happen anymore, as the default fallback for MyMemory is 'en' and not 'auto'.</paragraph> </paragraph> <paragraph id="sect_d1e149" role="section" xml-lang="en"> <paragraph id="hd_d1e151" role="heading" level="2" xml-lang="en">ImportError: No module named deep_translator</paragraph> <paragraph id="par_d1e154" role="paragraph" xml-lang="en">You'll have to install this Python package first, before using some of the translation backends: `pip install deep-translator`. Or use a larger OXT with bundled extensions.</paragraph> </paragraph> <paragraph id="sect_d1e158" role="section" xml-lang="en"> <paragraph id="hd_d1e160" role="heading" level="2" xml-lang="en">ImportError: No module named argostranslate</paragraph> <paragraph id="par_d1e163" role="paragraph" xml-lang="en">The ArgosTranslate backend requires installing the according Python package.</paragraph> </paragraph> <paragraph id="sect_d1e167" role="section" xml-lang="en"> <paragraph id="hd_d1e169" role="heading" level="2" xml-lang="en">IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! / Original error was: No module named 'numpy.core._multiarray_umath'</paragraph> <paragraph id="par_d1e172" role="paragraph" xml-lang="en">This is a problem of the OpenNMT backend. It can't be used with the LibreOffice-bundled Python. It's not compatible with the numpy binary extension. This backend only works with a distro-supplied Office, which ties to the system-installed Python. // Alternatively use the CLI tool with "command line tool" as backend.</paragraph> </paragraph> <paragraph id="sect_d1e176" role="section" xml-lang="en"> <paragraph id="hd_d1e178" role="heading" level="2" xml-lang="en">How to report a bug</paragraph> <paragraph id="par_d1e181" role="paragraph" xml-lang="en">The project repository https://fossil.include-once.org/pagetranslate/ allows to file a bug report (no registration necessary).</paragraph> <list id="list_d1e184" xml-lang="en"> <listitem id="item_d1e186" xml-lang="en"> <paragraph id="par_d1e188" role="paragraph" xml-lang="en">The log file MUST be included,</paragraph> </listitem> <listitem id="item_d1e192" xml-lang="en"> <paragraph id="par_d1e194" role="paragraph" xml-lang="en">together with a sample document (as link),</paragraph> </listitem> <listitem id="item_d1e198" xml-lang="en"> <paragraph id="par_d1e200" role="paragraph" xml-lang="en">as well as the OpenOffice version (Help ā About ā Copy)</paragraph> </listitem> <listitem id="item_d1e204" xml-lang="en"> <paragraph id="par_d1e206" role="paragraph" xml-lang="en">latest or development version has been tested.</paragraph> </listitem> </list> <paragraph id="par_d1e211" role="paragraph" xml-lang="en">Insufficient submissions are unlikely to spark developer interest.</paragraph> </paragraph> </body> </helpdocument> |
Changes to pagetranslate.py.
1 2 3 4 5 6 7 | #!/usr/bin/python # encoding: utf-8 # api: uno # type: callback # category: language # title: PageTranslate # description: Action button to get whole Writer document translated | | | 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: 1.9.77 # state: beta # 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 } |
︙ | ︙ |