On Thu, 27 Sep 2007 00:14:24 +0300, <[EMAIL PROTECTED]> wrote:
> When using the MultiLanguage recipe, a page editor has to use the markup
> (:if userlang xx:)
> to switch to a different language. It is, I believe, quite tedious
> when translating a caption of an image to three languages, for example.
>
> Is there any sane reason why a line like this isn't used in
> multilanguage.php, to provide markup like (:en:) for language switching:
>
> foreach ($DefaultLanguages as $lang)
> {
>     Markup($lang, '<if',
>             "/\\(:$lang:\\)(.*)(?:\\(:(".implode('|',
>                             $DefaultLanguages)."|if):\\))?/Us",
>             "(:if userlang $lang:)$1");
> }
>
> or s/\$lang/l_$lang/ to avoid conflicts with other recipes?

yes, there is a reason. the reason is that when a page is saved the text
is parsed to find the defined languages and save the info as a page
attribute. this way the page get parsed only once (upon save) instead
than parse it each time it is referenced.
to do this the script searches for a (:if userlang xx:) inside the page
and just a (:en:) wouldn't be enough information for the script to know
that it is a language declaration.

i am thinking about a workaround, though, and this may change in the
future, i am already developing a new version.

blues


_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to