Check-in [2bb2861a0a]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Update notes on PONS and button config. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
2bb2861a0af25d4ffe0d766422f9ea63 |
User & Date: | mario 2021-05-15 16:27:35 |
Context
2021-05-16
| ||
15:34 | Split out .skip() test, and wrap regexen in rx. classs check-in: 7512074bcc user: mario tags: trunk | |
2021-05-15
| ||
16:27 | Update notes on PONS and button config. check-in: 2bb2861a0a user: mario tags: trunk | |
16:26 | Introduce π΄ button configuration to change default language/behaviour. check-in: 57703cade1 user: mario tags: trunk | |
Changes
Changes to help/en/vnd.include-once.pagetranslate/config.page.
︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | it's optional, it unlocks more requests). No longer requires the python-translate module, but <file>langdetect</file> (for supplying the correct source language). Which is why it sometimes fails, and possibly requires the Tools β PageTranslate β From β To option. Doesn't yield quite as good machine translations. But it's an open source service. </p> </item> <item> <title>β Command line tool</title> <p>Allows to send each text paragraph to a local application. To use it, set the command in the according input field again. Placeholders are `{lang}` for the target language, and `{text}` for the paragaphs or current text section. (Both get automatically escaped). For <cmd>translate-cli</cmd> you might need the <var>-p</var> provider option or a prepared <file>~/.python-translate.cfg</file> for API keys. </item> <item> <title>β DeepL API</title> <p>Utilizes the speedier <link href="https://www.deepl.com/pro">DeepL Pro API</link> to translate documents. As of yet untested. Requires an API key and paid subscription. No XML mode (to retain full inline formatting) yet, still translates each text segment/paragraph/sentence | > > > > > > > > > | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | it's optional, it unlocks more requests). No longer requires the python-translate module, but <file>langdetect</file> (for supplying the correct source language). Which is why it sometimes fails, and possibly requires the Tools β PageTranslate β From β To option. Doesn't yield quite as good machine translations. But it's an open source service. </p> </item> <item> <title>β PONS Text Translation</title> <p>With <link href="https://en.pons.com/text-translation">Pons</link> you can also translate whole text documents. This service however requires an explicit source language. Autodetection in PageTranslate is somewhat frail. (Note that this is different from the Pons Dict support in deep-translator.)</p> </item> <item> <title>β Command line tool</title> <p>Allows to send each text paragraph to a local application. To use it, set the command in the according input field again. Placeholders are `{lang}` for the target language, and `{text}` for the paragaphs or current text section. (Both get automatically escaped). For <cmd>translate-cli</cmd> you might need the <var>-p</var> provider option or a prepared <file>~/.python-translate.cfg</file> for API keys. </p> </item> <item> <title>β DeepL API</title> <p>Utilizes the speedier <link href="https://www.deepl.com/pro">DeepL Pro API</link> to translate documents. As of yet untested. Requires an API key and paid subscription. No XML mode (to retain full inline formatting) yet, still translates each text segment/paragraph/sentence |
︙ | ︙ | |||
74 75 76 77 78 79 80 | href="https://www.deepl.com/translator/">DeepL online translator</link>. Only suitable for testing and translating single paragraphs or text selection, because it quickly blocks with "error 429 - too many requests". It's also kinda redundant now that there's a Free API option.</p> </item> </terms> | | | > > > > > > | | < < | > | | 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 | href="https://www.deepl.com/translator/">DeepL online translator</link>. Only suitable for testing and translating single paragraphs or text selection, because it quickly blocks with "error 429 - too many requests". It's also kinda redundant now that there's a Free API option.</p> </item> </terms> <p>Some are provided via <link href="https://pypi.org/project/translate/">translate-python</link> (TP):</p> <terms> <item> <title>β Microsoft Translator</title> <p>Requires an authorization key. There's also a free/test <link href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator/">subscription for an API key</link>. Not tested within PageTranslate yet.</p> </item> </terms> <p>And more via <link href="https://pypi.org/project/deep-translator/">deep-translator</link> (DT). These won't work in OpenOffice 4.x due to its Python 2.7 runtime:</p> <terms> <item> <title>β Yandex Translation</title> <p>Also requires its own <link href="https://translate.yandex.com/">API key</link>. It's supposed to support automatic language detection, and provides a vast range of target languages.</p> </item> <item> <title>β QCRI Machine Translation</title> <p>Requires a <link href="https://mt.qcri.org/api/">free API key</link>, and only supports Arabic/Spanish/English translations. Also doesn't support auto-detection, and probably needs the From-To selection.</p> </item> <item> <title>β Linguee Dictionary</title> <p>Performs word-wise <link href="https://www.linguee.com/">translation</link> lookups, so not suitable for translating whole documents, but just text selections. Albeit PageTranslate will split up sentences and pipe each word through the service; that won't yield a readable machine translation. </p> </item> <item> <title>β Pons Dictonary</title> <p>Also is more of a <link href="https://de.pons.com/">dictionary</link> than a translation service. Suitable for text-selections, but probably not paragraphs or whole documents. PageTranslate will split-process longer selections word-wise through the Pons Translation interface.</p> </item> </terms> <p>Some DT: entries are duplicates, and could be used as fallback / in case of errors.</p> </section> <section id="params"> <title>Parameters</title> <terms> <item> <title>API key</title> <p>You can set an API or OAuth key for services that require one. The same input field serves for all backends, so you can't switch between them without also changing this entry first. (Not a common use case |
︙ | ︙ | |||
173 174 175 176 177 178 179 180 181 | <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> </page> | > > > > > > > > | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | <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> <section id="flag_action"> <title>π΄ Button</title> <p>Allows to override the default behaviour of the secondary toolbar button π΄. Per default it uses the Office/system language as target. But can be changed to any langauge code. Or use the "paragraph" locale (as set in the langauge status bar). Or when set to "select" brings up the explicit FromβTo language selection popup (useful for MyMemory or Pons service).</p> </section> </page> |
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-05-15T18:25:36.474+02:00"/> </history> </meta> <body> <bookmark id="bm_d1e7" branch="hid/vnd.include-once.pagetranslate:OptionsPageTranslate" xml-lang="en"> <bookmark_value>PageTranslate settings</bookmark_value> |
︙ | ︙ | |||
53 54 55 56 57 58 59 60 61 | python-translate module, but <item type="fileitem">langdetect</item> (for supplying the correct source language). Which is why it sometimes fails, and possibly requires the Tools β PageTranslate β From β To option. Doesn't yield quite as good machine translations. But it's an open source service. </paragraph> </listitem> <listitem id="item_d1e75" xml-lang="en"> <emph>β Command line tool</emph> <br/> | > > > > > > > > > | < < < | < | | | | | | | | < | < | | | | > | | | | > > > | | | | > | | | | | | | | | > > > | | | | | | | | | | | | | > > > > > > > > | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | python-translate module, but <item type="fileitem">langdetect</item> (for supplying the correct source language). Which is why it sometimes fails, and possibly requires the Tools β PageTranslate β From β To option. Doesn't yield quite as good machine translations. But it's an open source service. </paragraph> </listitem> <listitem id="item_d1e75" xml-lang="en"> <emph>β PONS Text Translation</emph> <br/> <paragraph id="par_d1e80" role="paragraph" xml-lang="en">With <link href="https://en.pons.com/text-translation">Pons</link> you can also translate whole text documents. This service however requires an explicit source language. Autodetection in PageTranslate is somewhat frail. (Note that this is different from the Pons Dict support in deep-translator.)</paragraph> </listitem> <listitem id="item_d1e87" xml-lang="en"> <emph>β Command line tool</emph> <br/> <paragraph id="par_d1e92" role="paragraph" xml-lang="en">Allows to send each text paragraph to a local application. To use it, set the command in the according input field again. Placeholders are `{lang}` for the target language, and `{text}` for the paragaphs or current text section. (Both get automatically escaped). For <item type="command">translate-cli</item> you might need the <item type="variable">-p</item> provider option or a prepared <item type="fileitem">~/.python-translate.cfg</item> for API keys. </paragraph> </listitem> <listitem id="item_d1e105" xml-lang="en"> <emph>β DeepL API</emph> <br/> <paragraph id="par_d1e110" role="paragraph" xml-lang="en">Utilizes the speedier <link href="https://www.deepl.com/pro">DeepL Pro API</link> to translate documents. As of yet untested. Requires an API key and paid subscription. No XML mode (to retain full inline formatting) yet, still translates each text segment/paragraph/sentence individually.</paragraph> </listitem> <listitem id="item_d1e118" xml-lang="en"> <emph>β DeepL Free API</emph> <br/> <paragraph id="par_d1e123" role="paragraph" xml-lang="en">You can now get a free API key for limited usage (500K characters per month - around 1 or 2 documents per day). This secondary API might not be as well maintained. And signup still requires a credit card (use one of the privacy or temporary online credit card services).</paragraph> </listitem> <listitem id="item_d1e127" xml-lang="en"> <emph>β DeepL web interface</emph> <br/> <paragraph id="par_d1e132" role="paragraph" xml-lang="en">Utilizes web scraping on the <link href="https://www.deepl.com/translator/">DeepL online translator</link>. Only suitable for testing and translating single paragraphs or text selection, because it quickly blocks with "error 429 - too many requests". It's also kinda redundant now that there's a Free API option.</paragraph> </listitem> </list> <paragraph id="par_d1e140" role="paragraph" xml-lang="en">Some are provided via <link href="https://pypi.org/project/translate/">translate-python</link> (TP):</paragraph> <list id="terms_d1e146" xml-lang="en"> <listitem id="item_d1e148" xml-lang="en"> <emph>β Microsoft Translator</emph> <br/> <paragraph id="par_d1e153" role="paragraph" xml-lang="en">Requires an authorization key. There's also a free/test <link href="https://azure.microsoft.com/en-us/pricing/details/cognitive-services/translator/">subscription for an API key</link>. Not tested within PageTranslate yet.</paragraph> </listitem> </list> <paragraph id="par_d1e162" role="paragraph" xml-lang="en">And more via <link href="https://pypi.org/project/deep-translator/">deep-translator</link> (DT). These won't work in OpenOffice 4.x due to its Python 2.7 runtime:</paragraph> <list id="terms_d1e168" xml-lang="en"> <listitem id="item_d1e170" xml-lang="en"> <emph>β Yandex Translation</emph> <br/> <paragraph id="par_d1e175" role="paragraph" xml-lang="en">Also requires its own <link href="https://translate.yandex.com/">API key</link>. It's supposed to support automatic language detection, and provides a vast range of target languages.</paragraph> </listitem> <listitem id="item_d1e182" xml-lang="en"> <emph>β QCRI Machine Translation</emph> <br/> <paragraph id="par_d1e187" role="paragraph" xml-lang="en">Requires a <link href="https://mt.qcri.org/api/">free API key</link>, and only supports Arabic/Spanish/English translations. Also doesn't support auto-detection, and probably needs the From-To selection.</paragraph> </listitem> <listitem id="item_d1e194" xml-lang="en"> <emph>β Linguee Dictionary</emph> <br/> <paragraph id="par_d1e199" role="paragraph" xml-lang="en">Performs word-wise <link href="https://www.linguee.com/">translation</link> lookups, so not suitable for translating whole documents, but just text selections. Albeit PageTranslate will split up sentences and pipe each word through the service; that won't yield a readable machine translation. </paragraph> </listitem> <listitem id="item_d1e206" xml-lang="en"> <emph>β Pons Dictonary</emph> <br/> <paragraph id="par_d1e211" role="paragraph" xml-lang="en">Also is more of a <link href="https://de.pons.com/">dictionary</link> than a translation service. Suitable for text-selections, but probably not paragraphs or whole documents. PageTranslate will split-process longer selections word-wise through the Pons Translation interface.</paragraph> </listitem> </list> <paragraph id="par_d1e219" role="paragraph" xml-lang="en">Some DT: entries are duplicates, and could be used as fallback / in case of errors.</paragraph> </paragraph> <paragraph id="sect_d1e223" role="section" xml-lang="en"> <paragraph id="hd_d1e225" role="heading" level="2" xml-lang="en">Parameters</paragraph> <list id="terms_d1e228" xml-lang="en"> <listitem id="item_d1e230" xml-lang="en"> <emph>API key</emph> <br/> <paragraph id="par_d1e235" role="paragraph" xml-lang="en">You can set an API or OAuth key for services that require one. The same input field serves for all backends, so you can't switch between them without also changing this entry first. (Not a common use case to have multiple API subscriptions really).</paragraph> </listitem> <listitem id="item_d1e239" xml-lang="en"> <emph>Email adr</emph> <br/> <paragraph id="par_d1e244" role="paragraph" xml-lang="en">An email address is only required by MyMemory. And strictly speaking it's not even required; it just allows for more translations.</paragraph> </listitem> <listitem id="item_d1e248" xml-lang="en"> <emph>Command</emph> <br/> <paragraph id="par_d1e253" role="paragraph" xml-lang="en">This field defines the CLI tool to use for translating. Placeholders can be noted with {text} curly braces, or shell $lang and %from% percent syntax. The Python <link href="https://pypi.org/project/translate/">translate</link> or <link href="https://pypi.org/project/deep-translator/">deep-translator</link> packages provide following CLI wrappers:</paragraph> </listitem> </list> </paragraph> <paragraph id="sect_d1e279" role="section" xml-lang="en"> <paragraph id="hd_d1e281" role="heading" level="2" xml-lang="en">Options / Flags</paragraph> <list id="terms_d1e284" xml-lang="en"> <listitem id="item_d1e286" xml-lang="en"> <emph>β quick linebreak handling</emph> <br/> <paragraph id="par_d1e291" role="paragraph" xml-lang="en">Might speed up table processing with Google Translate, as it avoids sending each newline-split sentence separately. It simply conjoins multiple lines temporarily with <item type="command">"/#Β§/"</item> in place of a linebreak (and then rejoins them), so there are less requests. Primarily helps with tables, but less for documents with lengthy paragraphs.</paragraph> </listitem> <listitem id="item_d1e298" xml-lang="en"> <emph>β also iterate over TextFrames</emph> <br/> <paragraph id="par_d1e303" role="paragraph" xml-lang="en">Handles normal and floating TextFrames. Those are essentially subdocuments in a Writer page. But you probably don't need this option for standard office documents.</paragraph> </listitem> <listitem id="item_d1e307" xml-lang="en"> <emph>β super slow mode</emph> <br/> <paragraph id="par_d1e312" 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_d1e316" xml-lang="en"> <emph>β debug mode</emph> <br/> <paragraph id="par_d1e321" 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_d1e330" role="section" xml-lang="en"> <paragraph id="hd_d1e332" role="heading" level="2" xml-lang="en">π΄ Button</paragraph> <paragraph id="par_d1e335" role="paragraph" xml-lang="en">Allows to override the default behaviour of the secondary toolbar button π΄. Per default it uses the Office/system language as target. But can be changed to any langauge code. Or use the "paragraph" locale (as set in the langauge status bar). Or when set to "select" brings up the explicit FromβTo language selection popup (useful for MyMemory or Pons service).</paragraph> </paragraph> </body> </helpdocument> |