Marcelo,

On Wed, 2007-04-04 at 17:46 -0300, Marcelo Ramos wrote:
> After submitting a form using a generic view I get this error:
> 
> Request Method:       POST
> [...]
> Exception Type:       ValueError
> Exception Value:      incomplete format
> Exception Location:
>       /usr/lib/python2.3/site-packages/django/views/generic/create_update.py
> in create_object, line 43
> 
> It seems an error with the format given to gettext():
> 
> request.user.message_set.create(message=gettext("The %(verbose_name)s
> was created successfully.") % {"verbose_name":
> model._meta.verbose_name})
> 
> Is that a bug or a feature? I checked that model._meta.verbose_name
> has the correct value then i'm a bit lost here.
> 
> I'm working with a svn copy of revision 4926 (today).

I'm having some trouble repeating this problem. Does the following
experiment work for you (I'm doing this under the shell from "manage.py
shell" in a Django project)?

In [1]: from django.utils.translation import activate, gettext

In [2]: gettext("The %(verbose_name)s was created successfully.") % 
{"verbose_name": "xyzzy"}
Out[2]: 'The xyzzy was created successfully.'

In [3]: activate('es')

In [4]: gettext("The %(verbose_name)s was created successfully.") % 
{"verbose_name": "xyzzy"}
Out[4]: 'El xyzzy se ha creado correctamente.'

In [5]: activate('de') 
In [6]: gettext("The %(verbose_name)s was created successfully.") % 
{"verbose_name": "xyzzy"}
Out[6]: 'xyzzy wurde erfolgreich angelegt.'

In particular, what happens when you use activate() for your preferred
locale and then run the gettext() test?

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to