1👍
Import it and use as underscore instead:
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_lazy as ug
_('this is seen')
ug('this is not')
1👍
I think the problem was with mark_safe and ug:
from django.utils.translation import ugettext as ug
...
mark_safe('<div style="text-align:center"><a href="/calendar/" target="_blank" onclick="return open_popup(this); return false">%s</a></div>' % ug(u'show full calendar'))
should be:
from django.utils.translation import ugettext as ug
...
mark_safe('<div style="text-align:center"><a href="/calendar/" target="_blank" onclick="return open_popup(this); return false">%s</a></div>') % ug(u'show full calendar')
Notice the brackets.
- [Answered ]-Django is not upgrading passwords
- [Answered ]-Django rest frame work – File upload fails in test but working everywhere else
Source:stackexchange.com