Saturnix
Saturnix

Reputation: 10554

Django makemessages decides to comment already existing translations

When I run manage.py makemessages I found some messages which were in the .po file like this:

msgid "Example"
msgstr "Example"

Transformed to this, after I ran the command:

#~ msgid "Example"
#~ msgstr "Example"

Upvotes: 12

Views: 2242

Answers (2)

djangonaut
djangonaut

Reputation: 7778

I was facing a similar problem with 3rd party apps. makemessages did not include them in the .po file and when adding them manually makemessages was commenting them out next time.

In my case I had the virtual env symlinked into the project folder. To make makemessages see those 3rd party apps I had to add -s

./manage.py makemessages -a -s -l de -i faker -i openid -i gunicorn

At the same time I want to exclude some apps from translations with -i

Upvotes: 2

GwynBleidD
GwynBleidD

Reputation: 20569

Django will comment-out all messages that are no longer in your code. It won't remove them, so you won't lose it, but that way this messages won't end up in compiled .mo file.

Upvotes: 5

Related Questions