On Wed, 2007-11-07 at 13:01 +0000, Dmitri Fedortchenko wrote:
> I am trying to figure out the state of the translation tags in the
> django template system.
> 
> My ticket has been rejected, but I am not satisfied with the RTFM
> answer given there, based on the claim that python-stuff should not
> work in the template system.

Using Python as your guide for what should work in the template system
is mistaken. In that respect the ticket responders are correct. The
template system is not Python. The fact that it happens to use some
characters like _() and ".." that are also used in Python is
coincidence. You do have to understand that to make things easier.

As for the rest, I think there's just been some confusion in the ticket
between what accidentally works and whether it's a good idea or not.

It is fully intended that _() works in block tags. As an unintended
side-effect it also works in variable resolution tags. Okay, it's
probably not a bad thing. Send in a documentation patch for that.

Note, however, as was discovered on django-users recently, there is
actually a bug in the way translated portions are parsed in the template
variable parser. I'll fix that when I get a minute.

The double quotes versus single quotes issue just isn't the big deal
you're making it out to be. Okay, we allow single quotes for string
literals in templates, but it seems that everybody tends to use double
quotes and so they're what get tested mostly. Just use double quotes and
you'll be fine. The above fix to make _() work reliably will probably
fix this, but it's really not worth repeating over and over in your bug
report and the mail you send in.

Malcolm

-- 
The sooner you fall behind, the more time you'll have to catch up. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to