Hi Michal,
I'm not sure, but I would write the verbose names manually for each
field, wrapping each string inside a ugettext(...) function call like
so:
class Poll(models.Model):
...
field = models.CharField(ugettext("My verbose name"), max_length=40)
...
Thay way I could just use the normal './manage.py makemessages' to
extract the translatable strings.
Regards,
Jens
On Mar 8, 2:28 pm, Plovarna <[email protected]> wrote:
> Hello,
> I just developing my first aplication with internationalization. I need to
> get all verbose_name values of the model for each language defined in
> settings.LANGUAGES. I do it by this code defined inside model method :
>
> current_lang = get_language()
> names = {}
> for lang in settings.LANGUAGES:
> activate(lang[0])
> class_name = unicode(self.__class__._meta.verbose_name)
> names.append(class_name)
> deactivate()
> activate(current_lang)
>
> My question is: Is this approach thread safe? Is there any other way how to
> get verbose_name of the model for each defined language?
>
> Thank you for any advice
> Michal
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.