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 <mic...@plovarna.cz> 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 django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to