2

I am having issues with the Django makemessages management command. It seems like it is randomly marking messages as fuzzy in the .po file even though they have already been translated. For example....

#: templates/profile/edit.html:21
msgid "Save Changes"
msgstr "Save Changes DE"

Would become...

#: templates/profile/edit.html:21
#, fuzzy,
msgid "Save Changes"
msgstr "Save Changes DE"

The behaviour is very intermittent and hard to recreate, so debugging hasn't been straightforward.

Does anyone have any ideas?

  • Make sure you don't have two same English strings with different translations. In Your case check if `Save Changes` is declared any where else in file or not. – Aamir Rind Feb 12 '13 at 13:47
  • @aamir-adnan The file definitely contains only unique msgid strings as the compilemessages management command works ok (If the same string was declared more than once it would fail compilation) – abbas123456 Feb 12 '13 at 14:28

1 Answers1

3

I'd guess there is some change in the string - maybe some non printable character, which gets removed by translator and then the string does not match.

Definite answer could be given if you could put somewhere these two complete files...

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
  • Unfortunately I forgot to backup the django.po file before running the makemessages command so I can't actually compare the contents of the two files. The example I gave is just to illustrate what happens and is not a real diff. – abbas123456 Feb 12 '13 at 14:30
  • ``msgmerge`` (that's what ``makemessages`` uses in background) does mark strings as fuzzy on source string change, so most likely there was some, maybe it's just hard to spot - either non printable chars, whitespace, capitalization or something similar. – Michal Čihař Feb 12 '13 at 14:34
  • When you say there may be a change in the string, do you mean in the source or in the actual po file? A change in the source string can be counted out in this case as the source file has not been changed in git. – abbas123456 Feb 12 '13 at 14:36
  • It could be on both sides. I've seen several times translators inserted zero width space () somewhere, what could lead to behavior as you describe. However still this is something what should be visible from the diff as well (msgid would change). – Michal Čihař Feb 12 '13 at 14:39