On Feb 24, 1:19 pm, Brogno <brogno2...@hotmail.com> wrote:
> Dear djangonauts,
>
> I’m a newbie, a djangonoob ;) So, I have few little questions about
> Django’s template system. Just for you information, I get Django 1.0.2
>
> 1/ Using the i18n internationalization module, I would like to combine
> the translation with pluralize and capfirst filters. I know I’m a
> crazy dog.
>
> {% trans 'tag' %}{{ tag_list|pluralize }}
> => All right, everything is ok.
>
> But now, how can I specify the capfirst facility to these statements?

Use {% blocktrans %}...{% endblocktrans %} instead. This applies the
translation to everything between the tags. See here:
http://docs.djangoproject.com/en/dev/topics/i18n/#in-template-code

> 2/ Again in the templates system, sometimes it’s good to initialize a
> constant directly in the template (for instance, the version of the
> template theme).
> Is it possible? If yes, how can I retrieve the variable value in the
> template ?

I can't think of a use for this, but it's possible via the "with" tag:
{% with "myconstantvalue" as myconstant %}
{{ myconstant }}
{% endwith %}

--
DR.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to