On Mon, 2007-10-29 at 04:35 +0000, Dan wrote:
> Hi
> 
> In the i18n docs it says you can pass in translations to template tags
> in the following format:
> 
> {% some_special_tag _("Page not found") value|yesno:_("yes,no") %}
> 
> * http://www.djangoproject.com/documentation/i18n/#in-template-code
> 
> Has anyone got this working? I wrote a basic custom tag just to pass
> the value back and it just displays _("Page not found")
> 
> any ideas?

Looks like a bug. Reading the code, there's no chance that it's going to
work either: we simply don't do i18n processing on template tag
arguments.

It looks like ticket #4713 contains the start of a fix for this. You
might like to try that (I don't have time right this minute to review
and apply that patch, but I thought your problem sounded familiar and
there it is). I'll probably avoid using yet another reg-exp in the final
patch, but it looks close at first glance.

Once you apply that patch, you'll have to call resolve_variable() -- or
use the Variable() class if you're using a recent subversion checkout --
on the argument in order to have it translated.

Regards,
Malcolm

-- 
The cost of feathers has risen; even down is up! 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to