Opened 9 years ago

Closed 9 years ago

#10662 closed (invalid)

lazy translation cannot be evaluated in string operation

Reported by: liangent Owned by: nobody
Component: Internationalization Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


a = ugettext_lazy('sth')
b = 'x%s' % a
c = 'x' + a

both b and c contain something like <django. ... .proxy at ...> in them.

i have to write

a = ugettext_lazy('sth')
b = 'x%s' % unicode(a)
c = 'x' + unicode(a)

to get the expected result

Change History (1)

comment:1 Changed 9 years ago by dc

Resolution: invalid
Status: newclosed

This is expected behaviour. Read the documentation carefully and use

b = u'x%s' % a


b = string_concat('x', a)
Note: See TracTickets for help on using tickets.
Back to Top