Sean Allen wrote:
> 
> On Aug 25, 2008, at 9:53 PM, Stuart Johnston wrote:
> 
>> Your language files would look something like:
>>
>> [% BLOCK welcome %]
>> Hello [% first_name %]
>> [% END %]
>>
>> Your other templates would then include the blocks:
>>
>> [% PROCESS welcome %]
>>
>> So, this method is one-pass and all the templates are compile-cached.
> 
> I thought of this but we have use cases where we actually embed template
> content up to 4 levels deep so that the first translation returns content
> that in return gets evaluated etc.
> 
> The one thing I like about the solution I came up with is it doesnt 
> require the template
> user to know what is coming in the string. No need for having to know if 
> it needs
> to be eval'd again or not.
> 
> Could something similar be achieved with Locale::Maketext?
> I read through the cpan listing and I don't see anything to handle that. 
> Then again,
> I used tt2 for 2 years and never noticed the eval filter.

The Block method would handle this just fine.  I suspect that Maketext 
would not.

_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to