yossi
yossi

Reputation: 13315

How do i translate a message to an empty string with django

I am using django 1.27 with python 2.7.2.
I want a message to be translated to an empty string.

For example if i have this in my django.po file:

# .\path\file.py
msgid "word"
msgstr ""

So i want it to not show the 'word' when translating the page.

I have tried putting a space instead of "" but that did not help and i still get the original 'word' displayed.
How can i do that ?

Upvotes: 6

Views: 1059

Answers (2)

Dennis Golomazov
Dennis Golomazov

Reputation: 17359

Putting a space " " instead of "" works for me (Django 1.6, Python 3.2). Are you sure you've done django-admin.py compilemessages and reloaded the server after changing the translation?

# .\path\file.py
msgid "word"
msgstr " "

Upvotes: 0

Leonardo.Z
Leonardo.Z

Reputation: 9801

No, you can't do that.

django's translation process is based on the GNU gettext toolset. This a gettext bug many people have complained.

There is a workaround that you can translate them to invisible unicode characters like U+200B, U+180E, U+2063

Upvotes: 7

Related Questions