[Answered ]-Django removes translation in po file, string in mark_safe

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.

Leave a comment