django fuzzy string translation not showing up

icn picture icn · Sep 4, 2009 · Viewed 11.7k times · Source
  1. Why sometimes I get a fuzzy item in django.po language file. Actually, I have checked in my project the fuzzy string item is totally unique.

    #: .\users\views.py:81 .\users\views.py:101
    #, fuzzy
    msgid "username or email"
    msgstr "9988"
    
  2. It is ok to be fuzzy but my translation of fuzzy item not showing up on the page, only English version shows up. It is totally odd.

Answer

Martin v. Löwis picture Martin v. Löwis · Sep 4, 2009

  1. msgmerge marks strings as fuzzy if the old catalog had a translation for a strings with a similar-looking msgid. It also carries over strings marked as fuzzy from an old catalog to a new one.

  2. msgfmt excludes fuzzy messages from the compiled catalog, as the translations are likely incorrect. The translator should check correctness of the translation (in the case you posted, an empty string is clearly an incorrect translation), and remove the fuzzy mark when the translation is is verified. If you absolutely want to use fuzzy translations, pass --use-fuzzy to msgfmt:

python manage.py compilemessages --use-fuzzy