DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:translation3

This is an old revision of the document!


Translation3 plugin

Compatible with DokuWiki

2009-12-25

plugin Another translation plugin based on plugin:translation and plugin:multilingual

Last updated on
2010-11-05
Provides
Syntax, Action
Repository
Source
Conflicts with
translation

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 multilingual, translation

Tagged with language

This is a fork of translation plugin (also have some features from multilingual plugin). This plugin shows a list of available translations for a page.

There are a few limitations:

  • separate namespaces are used to store translations
  • translated pages need to have the same pagename as the main language page

See also advantages and comparison of translation plugins.

Download and Installation

Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually.

URL:

Installation

Similar to translation (version 2009-10-25) or multilingual (version 2009-02-11).

  • Download and install the plugin through the Plugin Manager.
  • Configure it through the Config Manager
  • Add the following code in your template's main.php (or put it in a lib/tpl/default/pageheader.html file for the default template)
<?php
	$translation_plugin = &plugin_load('syntax','translation');
	if ( $translation_plugin ) {
		if ( !plugin_isdisabled($translation_plugin->getPluginName() ) ) {
		print $translation_plugin->_showTranslations();
		}
	}
?>

Note: add this piece of code not at the top or the bottom of main.php but instead in-between where it makes the best optical impression. You need to experiment a bit to find the best spot.

In default template it should be beetwen:

    <?php if($conf['breadcrumbs']){?>
    <div class="breadcrumbs">
      <?php tpl_breadcrumbs()?>
      <?php //tpl_youarehere() //(some people prefer this)?>

and

    </div>
    <?php }?>
 
    <?php if($conf['youarehere']){?>
    <div class="breadcrumbs">
      <?php tpl_youarehere() ?>
    </div>
    <?php }?>

If you have several themes or skins installed you need to add this piece of code into each main.php to allow the translation-plugin for every skin.

Configuration

You should use Config Manager or edit conf/local.php configuration file.

$conf['plugin']['translation']['translations']  = 'pl,en,fr,de,it';                     // available languages, should be ISO language two letter code
$conf['plugin']['translation']['translationns'] = '';                                   // namespace where to activate translation (recommended: empty)
$conf['plugin']['translation']['skiptrans']     = '^:(plugin|template):';               // what to skip (regexp)
$conf['plugin']['translation']['dropdown']      = 0;                                    // use a dropdown list, recommended for more than 5 languages
$conf['plugin']['translation']['dropdown2']     = 1;                                    // when dropdown is on show current flag/ISO code near combobox
$conf['plugin']['translation']['translateui']   = 1;                                    // translate the wiki user interface too
$conf['plugin']['translation']['flags']         = 1;                                    // use flags (images) instead of ISO code (text), not work with dropdown list 
$conf['plugin']['translation']['description']   = 0;                                    // display text similar to "Translations of this page" (in current wiki language)
$conf['plugin']['translation']['blankflag']     = 1;                                    // use blank flag image if flag not exist (instead of text)
$conf['plugin']['translation']['translateui']   = 1;                                    // translate wiki ui language in language namespaces
$conf['plugin']['translation']['redirectstart'] = 1;                                    // redirect start page into a language namespace using browser language detection
$conf['plugin']['translation']['checkage']      = 1;                                    // show notice on possible outdated translations
$conf['plugin']['translation']['about']         = 'translation:about';                  // page describing the translation process to users
$conf['plugin']['translation']['showabout']     = 0;                                    // show link to about translation page
$conf['plugin']['translation']['localabout']    = 1;                                    // use localized version of about page (instead of one global about translation page)

See: configuration using Config Manager

Screenshots related to dropdown:

Screenshots related to flags:

Screenshots related to dropdown off andflags off (both):

Screenshots related to blankflag:

Screenshots related to blankflag off:

Screenshots related to description:

Screenshots related to description off:

Screenshots related to showabout:

Screenshots related to showabout off:

See also translation plugin configuration and translation plugin usage.

Changes

Screenshots

Config

config in Configuration Manager

menu: dropdown list

menu: dropdown list with current flag

menu: list

menu: flags

menu: flags with blank flag

Desc

desc: description with link

desc: description without link

desc: only link right

Advantages

Advantages over the:

    • support for flags (similar to multilingual, but faster rendering)
    • support for local about translation page (and global)
    • show/hide link to about translation page
    • show/hide description “Translations of this page” in current language
    • improved CSS styles
    • good work with redirections
    • support for change wiki ui language (language of the user interface may be switched in foreign language namespaces)
    • support for dropdown list
    • faster rendering flags (not use html_wikilink, which may be slow for images)
    • support for non-ISO languages in flag mode (text or blank flag image)
    • support for selected or all namespaces (like translation)
    • support for local and global about translation page
    • support for link to about translation page
    • support for description “Translations of this page” in current language
    • all advantages of Translation plugin (version 2010-07-18/2010-11-05)

Comparison of translation plugins

Plugin FLEX Multilingual Translation Translation2 Translation3
Author Vincent Tscherter Daniel Stonier Andreas Gohr Markus Birth Tomasz Tomasik
First version 2010-02-15 2009-02-11 2007-06-04 2009-02-12 2010-11-05
Last updated 2010-02-15 2009-02-11 2010-07-18 2009-02-12 2010-12-05
Compatibility DW 2010-12-25+ DW 2008-05-05 DW 2009-12-25 DW 2009-12-25 -/+ DW 2009-12-25
Demo Yes Yes
Position in template breadcrumbs breadcrumbs breadcrumbs breadcrumbs
Popularity 3/10128 24/10128 340/10128 19/10128 0/10128
Global translation No Yes Yes Yes Yes
Local translation Yes No No No No
Allow limited namespaces Yes (translationns) Yes (translationns)
Exceptions (config) - Yes (skiptrans) Yes (skiptrans) Yes (skiptrans)
Exceptions (page) -
~~NOTRANS~~
~~NOTRANS~~
Warn about outdated translations No Yes (checkage) Yes (checkage)
Language integration
Change wiki ui lang Not work :?: (use_browser_lang) Yes (translateui) Yes (translateui)
Start page redirection Buggy Yes (redirectstart) Yes (redirectstart)
Menu
List Yes (flags off) Yes (dropdown off) Yes (dropdown & flags off)
DropDown List No Yes (dropdown) Yes (dropdown)
DropDown List with Flag No No Yes (dropdown2 & flags)
Flags Yes (flags) No Yes (flags)
Blank flag Not work Yes (blankflag)
About translation page(s) and description
About translation page - Not work :?: (about) Yes (about) Yes (about)
Global about translation page - Yes Yes
Multilang about translation pages - No Yes (localabout)
Show/hide link to about page - Always show Yes (showabout)
Show/hide description - Always show Yes (description)

Notes:

See also

Known bugs

I didn't change original author (see translation, which my plugin is based). I think it should be merged with original plugin.

It isn't possible to install/use both translation and translation3.

Requests/Issues

Section for Translation3 plugin users.

Fork at GitHub

*sigh* was it really necessary to have yet another for of the same plugin? why not send patches, or better fork at github and send pull requests? — andi 2010/11/05 14:59
+1 — bug 2010/11/05 16:19
I forked project at github. See this.
plugin/translation3.1291639267.txt.gz · Last modified: 2010-12-06 13:41 by 150.254.79.30

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