Hello,
On Sat, Sep 22, 2012 at 9:41 PM, Seven Du <
duji...@gmail.com> wrote:
> Hi,
>
> Thank you for the great code and I have some questions when using erlydtl. I
> use the latest code on github.
>
>
> 1) to trans a variable, I tried many ways but only the second works:
Are you passing the data in as a string? If it is a binary it might
not get translated with the default machinery.
>
> code:
>
> when edit = Edit
>
>
> <br> 1 {{ edit }}
> <br> 2 {% trans "Edit" %}
> <br> 3 {% trans edit %}
> <br> 4 {{ _( edit ) }}
> <br> 5 {% blocktrans with e = edit %} {{ edit }} {% endblocktrans %}
>
> output:
>
> 1 Edit
> 2 编辑
> 3 Edit
> 4 Edit
> 5 Edit
>
>
> 2) Is it possible to use extends and include with variables?
No -- extends and include are evaluated at compile-time so you can't
use variables here.
Evan
>
>
> Thanks.
--
Evan Miller
http://www.evanmiller.org/