- Summary
- wikipublisher and pmwiki multilanguage recipe
- Type
- Question
- Raised by
- Frank?
- Date opened
- Thursday, 18 December 2008
- Description
- I spare our wiki users the wikipublisher webform controls and call the server’s mkpdf.pl directly via hyperlink. Since the recipe for multiple languages on a wiki page needs a GET parameter
userlang, I use:
http://<server>/mkpdf.pl/http://<wiki>/index.php/?n=Main.TypesetTrailPage?userlang=<languagecode>...
This works fine with simple action=print for one individual page.
However, for action=typesetpublish (trail page) the xml always contains the standard language regardless of the userlang parameter. In the latter case pmwiki.php MarkupToHtml or PrintFmt functions are called by wikipublisher.php HandlePublish, PrintRetrievedText etc. without $GLOBALS['userlang'] to be set correctly.
Question: Would some developer please make wikipublisher aware of the $_GET['userlang'] in order to deal with multiple language wikis?
- Importance
- 3
- Proposed solution
- I have got things working for myself by adding
if (isset($_GET['userlang'])) $GLOBALS['userlang'] = $_GET['userlang'];
at the beginning of wikipublisher.php
But I’m just a tinkerer and I do not have oversight over the inner workings.
- Urgency
- 2
- Status
- Open
- Resolution
- It is not the role of Wikipublisher to encode support for recipes in the pmwiki cookbook. This is best provided as a separate local customisation or Cookbook recipe. Like pmwiki, the Wikipublisher library is designed so that it does not need to be modified under most circumstances. In the above example, it should not be necessary to change wikipublisher.php; it should be possible to put the same statement in local/config.php.
Since the multilanguage recipe controls $userlang, it may be better to change this recipe so that it sets $GLOBALS[‘userlang’] if $_GET[‘userlang’] is set. The recipe already includes this check to set $userlang.
- Date closed
-
« 00132 · Edit Form · 00134 »