[pmwiki-users] PmWikiXx/XLPageLocal and rel.page variable translat.

Patrick R. Michaud pmichaud at pobox.com
Wed Jan 24 12:17:47 CST 2007


On Wed, Jan 24, 2007 at 04:30:20PM +0100, Jiri Hladůvka / OBUTEX wrote:
> Hi list,
> has anyone met such a problem that the page variable value is not
> translated ?
> 
> I have in my source (which is included into <Group>.GroupFooter)
> (:cellnr:)$[Priority]:
> (:cell:)$[{*$:Priority}]
> The expresion $[{*$:Priority}] stays untranslated.

Yes.  $[...] translations take place before page variables
are substituted -- this is necessary in order for translations
such as $[Editing {$FullName}] to work properly.  

(In other words, the translation phrase key has to be 
'Editing {$FullName}' with the page variable itself, and not
the value of the key after the {$FullName} substitution.)

> In other sources like
> (:input select name="Priority" value="4-low"  label="$[4-low]":)
> and pagelists
> $[{=$:Priority}]
> the translation is OK

The $[{=$:Priority}] case ends up being different because of
an artifact in the pagelist template handler.  Here, the
pagelist template performs the {=$...} substitutions
before calling the markup engines, so that the translation
key ends up using the value of the page variable, instead of
the page variable itself.

Granted, this is inconsistent, but I don't have an immediate
plans to change it.  If I do change it, it would be to
make the behavior match the standard markup behavior
(translate before page variables are substituted) and
not vice-versa.

One solution to this problem is to introduce an additional
markup that performs phrase translation after page variable
substitutions take place, to complement the existing $[...]
markup which performs the translation before page variable
subsitutions take place.

Pm




More information about the pmwiki-users mailing list