> You aren't supposed to use _('Foo') as a standalone variable.
> (see last paragraph
> herehttp://docs.djangoproject.com/en/1.2/topics/i18n/internationalization...)
Why shouldn't I use it as a standalone variable? (A language should
have a *context free* grammar, which means, that the underscore
function can be used in any variable. But that's no problem in
Django.)
That's not the point, the bug applies to any variable, template tag or
template filter parameter. It seems like a bug to me:
Any underscore function is translated during the initialisation of the
template, and that is wrong to me.
I guess, also for this one, like mentioned in the documentation.
{% some_special_tag _("Page not found") value|yesno:_("yes,no") %}
And I did a quick test:
with language('nl'):
t = Template("{% load i18n %}{{ 1|yesno:_('yes,no') }}")
t.render(Context()) # Will output 'ja'
with language('en'):
t.render(Context()) # Will still output 'ja', even if the language
is English now...
The underscore, which is a parameter for a template filter, is also
translated during the initialisation of the template...
--
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.