DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:translate

Translate Plugin

Compatible with DokuWiki

Rincewind

plugin Another translation plugin

Last updated on
2013-08-19
Provides
Action
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to translation

Tagged with language

This is a translation plugin that does not require the translated pages to have the same page name as the original page. Instead, metadata is used for page relation.

When a user clicks on a link to an untranslated version of a page, a form is displayed where a name can be chosen for the translated page. Thereafter, the user will come to the edit mode of the new page, where the original version of the page will be displayed side-by-side with the page editor.

Features

  • Side-by-side editing of translation pages
  • No requirements on the page name of translated pages
  • Language code as namespace is optional
  • Show translation links as language code or language name
  • Translation links can be inserted automatically or you can insert them manually in your template

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

It should be ready to use after installation. Checkout the configuration settings to find out what can be changed.

To set the user-interface language to the same language as each page, use the uilanguage plugin.

Some screenshots would be nice to add here…

Configuration and Settings

  • enabled_languages – Enabled languages. Comma separated list of codes. Leave empty for auto.
  • guess_lang_by_ns – If the namespace of a page is a valid language code, use it to guess the page language when unknown.
  • guess_lang_by_ui_lang – Use the wiki's user interface to auto-detect guess page language when unknown.
  • default_language – If the page language can not be detected, assume this language for pages.
  • use_language_namespace – Use language code as namespace for translations.
  • include_namespaces – Comma separated list of namespaces where pages can be translated. Use * for the entire wiki.
  • exclude_namespaces – Comma separated list of namespaces to exclude.
  • exclude_pagenames – Comma separated list of pagenames to exclude in any namespace.
  • translator_group – Give users in this group the right to create and edit translations, even if they only have read permission in ACL.
  • author_group – Give users in this group the right to create and edit original pages, i.e. not translated ones, even if they only have read permission in ACL. (Not recommended.)
  • insert_translation_links – Insert translation links on page. Turn this off if you want to insert them in your template manually.
  • link_style – Translation link style (language code or language name).

Development

Metadata

The following metadata is stored for a translation page:

  • language=(language code)
  • relation['istranslationof']=array of ID ⇒ language-code (assumes only single element in the array)

For the original page, its translations are stored in an associative array:

  • relation['translations']=array of ID ⇒ language-code

Change Log

This plugin was initially written 2009 and has been used in production since then.

Known Bugs and Issues

The code used to check whether a user is allowed to create a page or not is not 100% reliable, because the page name is not known until a name for the translated page has been chosen. If the user has write permission to the current page (or if the user is in the translators group), she/he is assumed to have permission to create translation pages. This affects only whether the “Translate this page” should be visible.

When activated, dblclickedit plugin doesn't work anymore.

ToDo/Wish List

  • Verify compatibility with the latest version of DokuWiki.

Discussion

issues

I am using this plug-in to develop a multilingual wiki which uses combination of LTR and RTL languages. There are couple of problems need to be considered:

1- The bullets used for translation links on pages are not in the right place.

This is probably easy to fix by adding a rtl.css file. Patches are welcome! – Viktor, 18 April 2014

2- when the UI changes to the RTL languages, the translation links are in the first line of the page in the same line with the page content. it is kind of confusing. leaving one line blank on the page didn't help.

This is probably easy to fix by adding a rtl.css file. Patches are welcome! – Viktor, 18 April 2014

3- The plug in wouldn't let me to uncheck 'insert_translation_links' in the configuration manager page.

That's not good. Does it work to change other settings? What version of DokuWiki are you using? – Viktor, 18 April 2014
The version I'm using is 2013-12-08 –Aria, 21 April 2014
suggestions and wish list

1- it would be awesome if we can select any exist page in the target language as a translate page of current language. now we must start any new pages by using translation link. it is hard when you are moderating a multilingual wiki.

The translation/original page relation and language is stored as metadata on both pages. You could use some plugin that allows you to edit the metadata of pages. Otherwise, it's not that hard do copy the text, delete the page, create the page again using the translation form and then paste the contents, is it? – Viktor, 18 April 2014

2- it would be perfect if we have a option to show translation links in the pages or in the sidemenu.

This can be done if you turn off insert_translation_links and insert the appropriate code for translation links in your template instead. – Viktor, 18 April 2014

3- It would be pretty if the translation link has a box titeling 'Other Languages', something like MediaWiki.

This can be done if you turn off insert_translation_links and insert the appropriate code for translation links in your template instead. – Viktor, 18 April 2014
Which code would it be? I saw several function in the `helper.php` of the plugin. Is there a specific code that would provide the translations links to our template ??

4- It would be great to have an obsolete functionality. To tell the user this language may be obsolete and a newer is better. It could also be the opportunity to have an option to invite people to update the translation to be on par. In admin, it would be useful to have a list of obsolete translation as so translator could easily find them. https://github.com/zuiderkwast/dokuwiki-plugin-translate/issues/8

plugin/translate.txt · Last modified: 2015-12-06 14:33 by Aleksandr