views:

246

answers:

3

I am making a multilingual Django website. I created a messages file, populated and compiled it. I checked the site (the admin in this case,) in my wanted language (Hebrew) and most phrases appear in Hebrew like they should, but some don't. I checked the source and these still appear as _('Whatever') like they should, also they are translated on the messages file, and yes, I remembered to do compilemessages.

What are some common causes for translations not to appear like that?

+1  A: 

A problable cause is Lazy Translation.

In example, in views.py you should use ugettext:

from django.utils.translation import ugettext as _

But in models.py, you should use ugettext_lazy:

from django.utils.translation import ugettext_lazy as _
DZPM
Thanks, but it seems like it's not the problem in this case.I log into the shell, and do `ugettext('My expression')`, and I get `'My expression'` instead of the translation. (Yes, I `activate`d the other language before doing this, and confirmed I can translate other strings with this function.)
cool-RR
+2  A: 

Maybe the translated strings are marked as fuzzy?

Ofri Raviv
You're cheating, Ofri :)Yes, this is one of the reasons for missed translations, thank you.
cool-RR
This took me a while to figure out too. Any entries marked as "fuzzy" are not used. They are intended to be reviewed by a translator and until verified (by removing the fuzzy flag) are not displayed.
Tom
http://www.gnu.org/software/hello/manual/gettext/Fuzzy-Entries.html#Fuzzy-Entries
Tom