#14174: Support for string interpolation in lazy translation
--------------------------+-------------------------------------------------
Reporter: zimnyx | Owner: nobody
Status: new | Milestone:
Component: Translations | Version: 1.2
Keywords: | Stage: Unreviewed
Has_patch: 0 |
--------------------------+-------------------------------------------------
{{{
ugettext_lazy('Hello %s') % 'Sid'
}}}
is immediately evaluated to unicode:
{{{
def __mod__(self, rhs):
if self._delegate_str:
return str(self) % rhs
elif self._delegate_unicode:
return unicode(self) % rhs
else:
raise AssertionError('__mod__ not supported for non-string
types')
}}}
My proposition is that __mod__() could return lazy again, and store params
given after %, so they can be used in final conversion to unicode:
{{{
unicode(self) % params
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/14174>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.