views:

345

answers:

1

1)why sometimes i got '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.

Thanks for any help!

+2  A: 

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.

Martin v. Löwis
thanks, actually i put something at real translation say msgid "username or email"msgstr "9988" and i use 'django-admin.py compilemessages' command to compile , seems no --use-fuzzy parameter to pass.
xlione
compilemessages just invokes `msgmft --check-format -o foo.mo foo.po` for all po files it finds. Just use msgfmt explicitly instead.
Martin v. Löwis