Description

Http404 error messages in class based generic views are not translated, but model names passed to them are. Example:

raise Http404("No %s available" % model._meta.verbose_name)

Messages should be translated completely or not translated at all. As I see in Django source code they are almost always not translated. I think that model._meta.verbose_name should be replaced by model._meta.object_name.

In second patch I translated all error messages in generic class views according to russellm's suggestion. I think that it would be good to do some additional tests for errors, but I don't have time to do it now.

This patch isn't strictly ready for checkin, because it's a superset of what is needed. However, I can distill what is needed from this patch. For posterity:

We're not going to add translation strings for deprecated features (i.e., old-style function based generics)

We don't need to translate InvalidConfiguration, TypeError and other internal errors. If a user ever sees these, there is something *badly* wrong. We only need to translate the 404s. This follows the pattern established by contrib.admin.