I have the following line of code which basically returns an error – a translated error – along with a view in a case of a failure:
from django.utils.translation import ugettext_lazy as _
.....
return render_to_response('login.html',{'form': form,'error_message':_("User is not in the group %s" % group_name),'settings':SettingsManager.get()},context_instance=RequestContext(request))
And I created the message files, and compiled them. But the thing is it is only displayed as I wrote it – in English, User is not in the group %s" % group_name. Part of my django.po file:
#: application/views.py:1003
#, python-format
msgid "User is not in the group %s"
msgstr "Kullanıcı %s grubunda değil."
ANy ideas how to solve it? I cannot see the problem.
P.S: All the other translations are working like a charm, but this one is not.
Thanks in advance.
Try
instead of
that way the translation machinery has a constant string to look up.