Hi,
Bill Moseley writes:
> On Sat, Dec 13, 2008 at 12:42:17AM +0100, Ansgar Burchardt wrote:
>>
>> Chisel Wright
>> <chisel-quio8f1ol2zzjhtm8ag3mw-xmd5yjdbdmrexy1tmh2...@public.gmane.org>
>> writes:
>> > On Fri, Dec 12, 2008 at 11:19:34PM +0100, Ansgar Burchardt wrote:
>> >> [% l("blabla [_1] bar", arg | html) %].
>> >
>> > It's late and I'm just guessing, but what about?
>> >
>> > [% l("blabla [_1] bar", arg) |html %]
>>
>> This does not work when there are (wanted) HTML tags anywhere. It would
>> require to split sentences like
>> Please <a href="mailto:...">contact us</a> if you have any problems.
>> into several unrelated parts making them harder to translate.
>
> I have separate localization functions specifically for this reason.
> Only the substitution parameters are escaped before placed in the
> localization string.
Can you explain in a bit more detail? If I understand correctly, you
have functions like l_html(s, a), l_url(s, a) which escape `a' before
placing them in the substitution?
But doesn't this lead to an additional function for every combination of
filters used? I would prefer just writing
l(s, a.html) or l(s, a | html)
or something similar. The former would just require that filters are
also registered as scalar virtual methods as well, as is already the
case for some (e.g. `repeat', `replace'). I think this might be useful
in other cases as well.
Regards,
Ansgar
--
PGP: 1024D/595FAD19 739E 2D09 0969 BEA9 9797 B055 DDB0 2FF7 595F AD19
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates