On Mon, Sep 15, 2008 at 05:56:41PM +0200, Clinton Gormley wrote:
> Hi all
> 
> Quick survey : what file extensions do you typically use for your TT
> templates?
>  - .tt
>  - .html

Both, depending on how the template is used.


> Bonus question: what file extensions do you use for your YAML files?
>  - .yaml
>  - .yml

Eh, seems both, but not on purpose.


> I'm adding:
> 
>      [% l('string to localise',args) %]
>   and
>      [% 'string to localise' | l(args) %]

To show you how screwy my setup is I have two (three?) forms:

I have a simple form:

    loc( 'string to localize' );


And if there only one argument, which is by far more common than more
than more than one argument, I can use:

    loc( 'You have [quant,_1,apple].', apple_count );


But, if I have more than one argument I pass as an array ref:


    loc(
        [
            'You have [quant,_1,apple] and [quant,_2,banana].',
            apple_count,
            banana_count,
        ],
    );


I think the reason was because loc() started out as a template macro
which then called my localize() function -- and the macro initially
only had two arguments (where the localize() function accepted both a
list and an array ref).

It's even more rare to have three arguments, and seems I don't have
any with four or more.  So, the macro could have just had a longer
argument list and avoid the array ref.





-- 
Bill Moseley
[EMAIL PROTECTED]
Sent from my iMutt


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

Reply via email to