In my file, models.pyI define the field in the model as follows:
description = models.CharField(
max_length=40,
default=_('Bla bla bla'),
)
Now _there is django.utils.translation.ugettext, and I want to use the Hebrew translation 'Bla bla bla', which is equal, as the default value 'בלה בלה בלה'. (The website is only in Hebrew.) The string is correctly translated into the message file. But when I start the Django admin and create a new object, I see English 'Bla bla bla'in the field. I assume that English is the active language when compiling a module models.py. How can I solve this and make it Hebrew?
I know that one solution would be to give up ugettextand just write Hebrew inside the Python module, but I prefer to avoid this to prevent hell coding.
source
share