django translation doesn't work but translation in templates works
I think the problem lies in your MIDDLEWARE_CLASSES. The thing is, there are some middlewares that might change your request, including a language prefix. Especially, when you use AJAX calls for querying extra template data, translated by ugettext, gettext, etc.
I try to translate my django site to another languages but translation in python doesn't work. But translation in templates using trans tag, works as expected.
I have tried ugettext, gettext, gettext_lazy and ugettext_lazy, and every time I got original untranslated strings.
My sources all in utf-8 encoding, original strings in Ukrainian language