break long titles, man page updates | ||
---|---|---|
mario authored 1 days ago last checkin 887d7dac3 ⎘ | ||
π META-INF | Introduce crude help file for config options.βΉβΊ | 791 days ago |
π dingonyms | Add `selectonly` mode as per user request.βΉβΊ | 223 days ago |
π help | Add errors, update help treeβΉβΊ | 548 days ago |
π icons | resized, lighter blue tonesβΉβΊ | 824 days ago |
π off | Add more languages ('le continental submenus)βΉβΊ | 552 days ago |
π pkg-desc | move license text to pkg-desc/βΉβΊ | 809 days ago |
π pythonpath | Disable ToggleDropdown, update dependenciesβΉβΊ | 434 days ago |
π Addons.xcu | Added pt-BR (Brazilian-Portuguese) menu entryβΉβΊ | 223 days ago |
π Makefile | Move MessageBox() to unocompat (not actually used anymore, doesn't woβΉβΊ | 426 days ago |
π NEWS | Notes about ArgosTranslate, CLI alternativeβΉβΊ | 426 days ago |
π OptionsDialog.xcu | AOO compat. OptionsDialog XCU requires leaf name to equal handler ID.βΉβΊ | 803 days ago |
π OptionsDialog.xdl | readd proper icon urlβΉβΊ | 220 days ago |
π OptionsSchema.xcs | Add `selectonly` mode as per user request.βΉβΊ | 223 days ago |
π description.xml | Update documentation on new option.βΉβΊ | 223 days ago |
π pagetranslate.py | Update documentation on new option.βΉβΊ | 223 days ago |
PageTranslate
OpenOffice/LibreOffice extension that translates whole documents, whilst retaining some formatting.
- Iterates over paragraphs / text segments / and tables (only linebreaks kept)
- Utilizes Google translate (or DeepL, Microsoft Translate, MyMemory, PONS, or Yandex/Qcri/Linguee).
- And is therefore rather slow.
(Writer freezes during process for long documents!) - Still allows for text-selection mode translation (from original extension).
Install
Download the package file, and import it in LibreOffice via Tools β Extension Manager β Add.
Location | Features | Link |
---|---|---|
Source repository | Newest package, Linux-only package, no python dependencies | pagetranslate.oxt |
LibreOffice Extensions | Older/stable versions, bundles python requests library |
https://extensions.libreoffice.org/extensions/pagetranslate |
OpenOffice Extensions | Full releases, AOO/LO/Windows compatible (bundles deep-translator +requests ) |
https://extensions.openoffice.org/en/project/pagetranslate |
For using the unbundled/development package, you should install Python dependencies on your system:
pip3 install -U requests translate deep-translator six
Usage
- Hit the Tβπ¬π§ toolbar button to get entire document translated to English. Have some trust and patience for longer documents.
- The second button π΄ translates to the local/system language.
- Or select a paragraph, to get a partial translation.
- Alternatively pick a menu entry from Tools > PageTranslate.
- The βSystem lang entry refers to your OpenOffice/Desktop setting.
- Whereas β Paragraph locale respects the text language as set in the Writer status bar.
- A manual selection dialog is brought up by the From β To πΊ menu entry. (Best used in MyMemory mode)
- Configure options in ToolsβPageTranslateβOptions...
Caveats
- Generally you want to download the extension package from AOO. Those are usually full releases (2 to 20MB). The smaller package only makes sense for Linux/LibreOffice installations, because then you can automatically utilize local Python modules (
pip install requests deep-translator
). - The plugin is also likely to crash (won't affect Writer) when encountering complex documents (embedded drawings, Calc sheets, OLE elements, etc). It's only been tested with flow text and text tables.
- Generally there's a log file in /tmp.
- OpenOffice support is somewhat preliminary still (albeit it's mostly Python 2.7 fallbacks and XCU variations).
- For direct content.xml translations, there's an inconvenient tool in off/. (Each office document .odt/.odc is a zip file. Extract the content.xml, apply the script, then repackage the content.xml into the .odc)
ToDo
- Unify internal API lang=/source= handling, extract .skip() check, and outsource some of the common processing to main.
Integrate deep-translator backends (Yandex, QCRI, Pons, Linguee) and language mapping. Perhaps offer as alternative to T-P and internal variants.Finalize DeepL web translation mode (for testing really).The API mode is untested, but likely faster because longer paragraphs can be translated at once. And reportedly it yields smoother/more natural translations. (No XML block translation yet.)Unfortunately not sure yet how to bundlerequests
.Nor how to craft an options/settings page.Support for TextFrames- Figure out if getText() provides for some XML serialization,
or how to traverse Paragraphs piece by piece (super slow mode: retain more formatting). Does not yet support anything but Writer documents. (Structure is entirely distinct for Draw/Impress).Not sure if the toolbar icons work at all, or if that's a bug in the Linux version of LibreOffice.