DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:deeplautotranslate

This is an old revision of the document!


DeepL Autotranslate Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin This plugin automatically translates wiki pages using the DeepL API

Last updated on
2022-05-09
Provides
Action
Repository
Source

This plugin automatically creates translations based on the Translation plugin page structure using the DeepL API.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Examples/Usage

Page structure

To use the plugin, the following page/namespace structure is required:

  • [ISO-Language-Code]:foo:bar
    • The page with the name foo:bar in the language [ISO-Language-Code]
  • foo:bar
    • The original page with the name foo:bar in your default language

So for example if your default language is german and you have a namespace for english translations:

  • start
    • Your default german landing page
  • en:start
    • The english translation of the landing page

The plugin has two operating modes: the direct mode and the editor mode:

  • direct mode: missing translation pages will automatically be created if you visit it. So for example if you visit en:start and it does not exist it will be translated automatically and the translation will be shown directly.
  • editor mode (default): missing translation pages won't be created by simply visiting it, instead when you open the editor on a missing translations page, the auto-translated page will be pasted in the editor that you can edit and save it.

You can configure the default operating mode in the plugin settings. You also can define a regex for page names that should always be handled in a specific mode. Additionally you can define a blacklist regex for page names that should never be auto translated. You can define expressions (words) in texts that should never be translated (abbreviations for example).

If you want to retranslate a page, simply delete it and then it will be created again with your specified operating mode.

Configuration and Settings

You can configure the following settings:

  • Required: API-Key
  • Optional: API
    • The DeepL-API for which your key is valid
      • Free-API (default)
      • Pro-API
  • Optional: Default operating mode
    • Set the default operating mode (see explanation above)
      • direct-mode
      • editor-mode (default)
  • Optional: Show translate button
    • If enabled, it shows a button to force a (re)translation of pages in language namespaces
    • Default: enabled
  • Optional: Push languages
    • A space-separated list of languages (ISO codes) for which translations are created when the Translate button on the original page is pressed
    • The translation button is only shown on the original pages when at least one push language is given
  • Optional: Blacklist regex
    • A regular expression which matches page names that should never be translated automatically
  • Optional: Direct regex
    • A regular expression which matches page names that should always be translated in the direct-mode
  • Optional: Editor regex
    • A regular expression which matches page names that should never be translated in the editor-mode
  • Optional: Ignored expressions
    • Expressions or words that shouldn't be translated. Separated by :. Useful for abbreviations.

Changelog

  • 2022-05-09: added button for (re)translations and added output messages from plugin actions
  • 2021-12-15: added DokuWiki builtin-tags code, file and php to the translation-ignore-tags to prevent the translation of the contents in those tags
  • 2021-12-14: changed from curl to the builtin DokuWiki HTTPClient
  • 2021-12-11: first version
plugin/deeplautotranslate.1652093396.txt.gz · Last modified: 2022-05-09 12:49 by NetaliDev

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki