|
Cookbook /
i19Summary: Translator-oriented edit form, easing the internationalization (i18n) of a wiki
Version: 20110907
Prerequisites: PmWiki 2.2.17
Status: Experimental
Maintainer: Petko
Discussion: i19-Talk
DescriptionAn 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. Installation
ConfigurationThe 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 UsageThe 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. Notes
Change log / Release notes
See alsoContributorsRecipe written by Petko, includes the library UnverseJS. CommentsSee discussion at i19-Talk User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |