In my models.py file I define a field on a model like this:
description = models.CharField(
max_length=40,
default=_('Bla bla bla'),
)
Now, _ is django.utils.translation.ugettext, and I want to use as a default value the Hebrew translation of 'Bla bla bla', which is 'בלה בלה בלה'. (The website is in Hebrew only.) The string is properly translated in the messages file. But when I run the Django admin and create a new object, I see the English 'bla bla bla' on the field. I assume that English is the active language when compiling the models.py module. How can I solve this and make it Hebrew?
I know that one solution would be to forego ugettext and just write Hebrew inside the Python module, but I prefer to avoid that in order to prevent encoding hell.
Try
ugettext_lazyhttps://docs.djangoproject.com/en/1.3/topics/i18n/internationalization/#lazy-translation