An edit form for translators, easing the internationalization (i18n) of a wiki. The recipe was created for pmwiki.org, in order to help with the translation and maintenance of the documentation in languages other than English. It can be adapted and used for other multi-lingual wikis.
On PmWiki.org a page PmWikiFr.PmWikiPhilosophy is a French translation of the page PmWiki.PmWikiPhilosophy in English. The recipe is automatically enabled for this page. While editing it, an author can switch between the regular edit form and a special interface to compare the original wiki text with the translation, line by line.
The array $SourceNamePatterns contains the replacement rules needed to "guess" the original page name from the current page name. The default setting is this (used on PmWiki.org):
$SourceNamePatterns = array( '/^(PmWiki|Cookbook)(\\w\\w|\\w\\w\\w\\w)\\.\\1\\2$/'=> '$1.$1', '/^(PmWiki|Cookbook)(\\w\\w|\\w\\w\\w\\w)(\\..*)$/' => '$1$3' );
In the example, the first rule says that the "source" for a Group HomePage like
The recipe will only be enabled if an "original" pagename can be guessed, and if such page exists. First, the normal edit form is displayed, with a link "Translate" over the right border of the main text area. This link switches on/off the translation interface.
The translation interface contains two smaller text areas, the first with a line from the original page, the second with the same line from the translation, that is the currently edited page.
Between the text areas, a number of buttons help manipulating the display and the translation:
You can switch between the translation interface and the normal edit form; you can use the Summary line, the buttons "Preview", "Save and edit", "Cancel", exactly like in the normal wiki editing.
Demo: the recipe is enabled for the documentation on PmWiki.org, edit any page in a non-English wiki group.
Change log / Release notes
See discussion at i19-Talk