0

In views:

    from django.utils.translation import ugettext_lazy as _
    messages.success(request, (_("Thank you for contacting us.")))
    return HttpResponseRedirect('/contact/')

In templates:

<div class="alert alert-{{ message.tags }}" data-alert="alert" style="margin-bottom: 0px;">
    <a class="close" href="#" onclick="$(this).parent().fadeOut('fast'); return false;">×</a>
    <p class="text-center" style="color: #0886B6; font-size: 20px;">{{ message }}</p>
{% endfor %}
</div>

All the translated are translated despite the messages. I have create and compiled the message file but not working. What's wrong?

pynovice
  • 7,424
  • 25
  • 69
  • 109
  • Please take look at my answer to this question for some hints: http://stackoverflow.com/questions/20518783/django-1-5-5-displays-original-en-strings-always-does-not-translate/20519475#20519475 – Serafeim Dec 19 '13 at 13:47
  • Like I said, sir I have already specified `locale_paths` in my settings.py and all of my translations working except the one I mentioned in the question. Thanks for the input though. Cheers – pynovice Dec 19 '13 at 14:11
  • If you are testing locally, you need to restart the development server after compiling the messages (the localisations seem to be aggressively cached...) – sk1p Dec 19 '13 at 16:29

1 Answers1

0

Replacing ugettext_lazy with ugettext worked.

pynovice
  • 7,424
  • 25
  • 69
  • 109