Index: views/generic/base.py
===================================================================
--- views/generic/base.py	(wersja 15528)
+++ views/generic/base.py	(kopia robocza)
@@ -5,6 +5,7 @@
 from django.utils.functional import update_wrapper
 from django.utils.log import getLogger
 from django.utils.decorators import classonlymethod
+from django.utils.translation import ugettext as _
 
 logger = getLogger('django.request')
 
@@ -35,12 +36,15 @@
         # sanitize keyword arguments
         for key in initkwargs:
             if key in cls.http_method_names:
-                raise TypeError(u"You tried to pass in the %s method name as a "
-                                u"keyword argument to %s(). Don't do that."
-                                % (key, cls.__name__))
+                raise TypeError(_("You tried to pass in the %(kwarg)s method "
+                                  "name as a keyword argument to "
+                                  "%(class_name)s(). Don't do that.")
+                                % {'kwarg': key, 
+                                   'class_name': cls.__name__})
             if not hasattr(cls, key):
-                raise TypeError(u"%s() received an invalid keyword %r" % (
-                    cls.__name__, key))
+                raise TypeError(_("%(class_name)s() received an invalid keyword %(kwarg)s")
+                                % {'class_name': cls.__name__, 
+                                   'kwarg': key})
 
         def view(request, *args, **kwargs):
             self = cls(**initkwargs)
Index: views/generic/date_based.py
===================================================================
--- views/generic/date_based.py	(wersja 15528)
+++ views/generic/date_based.py	(kopia robocza)
@@ -6,6 +6,8 @@
 from django.core.xheaders import populate_xheaders
 from django.db.models.fields import DateTimeField
 from django.http import Http404, HttpResponse
+from django.utils.encoding import force_unicode
+from django.utils.translation import ugettext as _
 
 import warnings
 warnings.warn(
@@ -34,7 +36,8 @@
         queryset = queryset.filter(**{'%s__lte' % date_field: datetime.datetime.now()})
     date_list = queryset.dates(date_field, 'year')[::-1]
     if not date_list and not allow_empty:
-        raise Http404("No %s available" % model._meta.verbose_name)
+        raise Http404(_("No %(verbose_name)s available") 
+                % {'verbose_name': force_unicode(model._meta.verbose_name)})
 
     if date_list and num_latest:
         latest = queryset.order_by('-'+date_field)[:num_latest]
@@ -350,11 +353,13 @@
     elif slug and slug_field:
         lookup_kwargs['%s__exact' % slug_field] = slug
     else:
-        raise AttributeError("Generic detail view must be called with either an object_id or a slug/slugfield")
+        raise AttributeError(_("Generic detail view must be called with either"
+                               " an object_id or a slug/slugfield"))
     try:
         obj = queryset.get(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("No %s found for" % model._meta.verbose_name)
+        raise Http404(_("No %(verbose_name)s found for") 
+                % {'verbose_name': force_unicode(model._meta.verbose_name)})
     if not template_name:
         template_name = "%s/%s_detail.html" % (model._meta.app_label, model._meta.object_name.lower())
     if template_name_field:
Index: views/generic/list.py
===================================================================
--- views/generic/list.py	(wersja 15528)
+++ views/generic/list.py	(kopia robocza)
@@ -5,6 +5,8 @@
 from django.http import Http404
 from django.utils.encoding import smart_str
 from django.views.generic.base import TemplateResponseMixin, View
+from django.utils.translation import ugettext as _
+from django.utils.encoding import force_unicode
 
 
 class MultipleObjectMixin(object):
@@ -27,8 +29,8 @@
         elif self.model is not None:
             queryset = self.model._default_manager.all()
         else:
-            raise ImproperlyConfigured(u"'%s' must define 'queryset' or 'model'"
-                                       % self.__class__.__name__)
+            raise ImproperlyConfigured(_("'%(class_name)s' must define 'queryset' or 'model'")
+                                       % {'class_name': self.__class__.__name__})
         return queryset
 
     def paginate_queryset(self, queryset, page_size):
@@ -43,12 +45,13 @@
             if page == 'last':
                 page_number = paginator.num_pages
             else:
-                raise Http404("Page is not 'last', nor can it be converted to an int.")
+                raise Http404(_("Page is not 'last', nor can it be converted to an int."))
         try:
             page = paginator.page(page_number)
             return (paginator, page, page.object_list, True)
         except InvalidPage:
-            raise Http404(u'Invalid page (%s)' % page_number)
+            raise Http404(_('Invalid page (%(page_number)s)') 
+                    % {'page_number': page_number})
 
     def get_paginate_by(self, queryset):
         """
@@ -114,8 +117,8 @@
         self.object_list = self.get_queryset()
         allow_empty = self.get_allow_empty()
         if not allow_empty and len(self.object_list) == 0:
-            raise Http404(u"Empty list and '%s.allow_empty' is False."
-                          % self.__class__.__name__)
+            raise Http404(_("Empty list and '%(class_name)s.allow_empty' is False.")
+                          % {'class_name': self.__class__.__name__})
         context = self.get_context_data(object_list=self.object_list)
         return self.render_to_response(context)
 
Index: views/generic/list_detail.py
===================================================================
--- views/generic/list_detail.py	(wersja 15528)
+++ views/generic/list_detail.py	(kopia robocza)
@@ -3,6 +3,8 @@
 from django.core.xheaders import populate_xheaders
 from django.core.paginator import Paginator, InvalidPage
 from django.core.exceptions import ObjectDoesNotExist
+from django.utils.translation import ugettext as _
+from django.utils.encoding import force_unicode
 
 import warnings
 warnings.warn(
@@ -127,11 +129,13 @@
     elif slug and slug_field:
         queryset = queryset.filter(**{slug_field: slug})
     else:
-        raise AttributeError("Generic detail view must be called with either an object_id or a slug/slug_field.")
+        raise AttributeError(_("Generic detail view must be called with "
+                               "either an object_id or a slug/slug_field."))
     try:
         obj = queryset.get()
     except ObjectDoesNotExist:
-        raise Http404("No %s found matching the query" % (model._meta.verbose_name))
+        raise Http404(_("No %(verbose_name)s found matching the query") 
+                % {'verbose_name': force_unicode(model._meta.verbose_name)})
     if not template_name:
         template_name = "%s/%s_detail.html" % (model._meta.app_label, model._meta.object_name.lower())
     if template_name_field:
Index: views/generic/dates.py
===================================================================
--- views/generic/dates.py	(wersja 15528)
+++ views/generic/dates.py	(kopia robocza)
@@ -6,6 +6,8 @@
 from django.views.generic.base import View
 from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin
 from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin
+from django.utils.translation import ugettext as _
+from django.utils.encoding import force_unicode
 
 
 class YearMixin(object):
@@ -29,7 +31,7 @@
                 try:
                     year = self.request.GET['year']
                 except KeyError:
-                    raise Http404("No year specified")
+                    raise Http404(_("No year specified"))
         return year
 
 
@@ -54,7 +56,7 @@
                 try:
                     month = self.request.GET['month']
                 except KeyError:
-                    raise Http404("No month specified")
+                    raise Http404(_("No month specified"))
         return month
 
     def get_next_month(self, date):
@@ -95,7 +97,7 @@
                 try:
                     day = self.request.GET['day']
                 except KeyError:
-                    raise Http404("No day specified")
+                    raise Http404(_("No day specified"))
         return day
 
     def get_next_day(self, date):
@@ -134,7 +136,7 @@
                 try:
                     week = self.request.GET['week']
                 except KeyError:
-                    raise Http404("No week specified")
+                    raise Http404(_("No week specified"))
         return week
 
 
@@ -150,7 +152,8 @@
         Get the name of the date field to be used to filter by.
         """
         if self.date_field is None:
-            raise ImproperlyConfigured(u"%s.date_field is required." % self.__class__.__name__)
+            raise ImproperlyConfigured(_("%(class_name)s.date_field is required.")
+                    % {'class_name': self.__class__.__name__})
         return self.date_field
 
     def get_allow_future(self):
@@ -178,7 +181,7 @@
         """
         Obtain the list of dates and itesm
         """
-        raise NotImplementedError('A DateView must provide an implementation of get_dated_items()')
+        raise NotImplementedError(_('A DateView must provide an implementation of get_dated_items()'))
 
     def get_dated_queryset(self, **lookup):
         """
@@ -194,7 +197,8 @@
             qs = qs.filter(**{'%s__lte' % date_field: datetime.datetime.now()})
 
         if not allow_empty and not qs:
-            raise Http404(u"No %s available" % unicode(qs.model._meta.verbose_name_plural))
+            raise Http404(_("No %(verbose_name_plural)s available") 
+                    % {'verbose_name_plural': force_unicode(qs.model._meta.verbose_name_plural)})
 
         return qs
 
@@ -208,7 +212,8 @@
 
         date_list = queryset.dates(date_field, date_type)[::-1]
         if date_list is not None and not date_list and not allow_empty:
-            raise Http404(u"No %s available" % unicode(qs.model._meta.verbose_name_plural))
+            raise Http404(_("No %(verbose_name_plural)s available") 
+                    % {'verbose_name_plural': force_unicode(qs.model._meta.verbose_name_plural)})
 
         return date_list
 
@@ -458,8 +463,10 @@
         qs = self.get_queryset()
 
         if not self.get_allow_future() and date > datetime.date.today():
-            raise Http404("Future %s not available because %s.allow_future is False." % (
-                qs.model._meta.verbose_name_plural, self.__class__.__name__)
+            raise Http404(_("Future %(verbose_name_plural)s are not available "
+                            "because %(class_name)s.allow_future is False.") % (
+                {'verbose_name_plural': force_unicode(qs.model._meta.verbose_name_plural), 
+                 'class_name': self.__class__.__name__})
             )
 
         # Filter down a queryset from self.queryset using the date from the
@@ -491,7 +498,9 @@
     try:
         return datetime.date(*time.strptime(datestr, format)[:3])
     except ValueError:
-        raise Http404(u"Invalid date string '%s' given format '%s'" % (datestr, format))
+        raise Http404(_("Invalid date string '%(date)s' given format '%(format)s'") 
+                % {'date': datestr, 
+                   'format': format})
 
 
 def _month_bounds(date):
Index: views/generic/detail.py
===================================================================
--- views/generic/detail.py	(wersja 15528)
+++ views/generic/detail.py	(kopia robocza)
@@ -4,6 +4,8 @@
 from django.http import Http404
 from django.utils.encoding import smart_str
 from django.views.generic.base import TemplateResponseMixin, View
+from django.utils.translation import ugettext as _
+from django.utils.encoding import force_unicode
 
 
 class SingleObjectMixin(object):
@@ -40,15 +42,15 @@
 
         # If none of those are defined, it's an error.
         else:
-            raise AttributeError(u"Generic detail view %s must be called with "
-                                 u"either an object id or a slug."
+            raise AttributeError(_("Generic detail view %s must be called with "
+                                   "either an object id or a slug.")
                                  % self.__class__.__name__)
 
         try:
             obj = queryset.get()
         except ObjectDoesNotExist:
-            raise Http404(u"No %s found matching the query" %
-                          (queryset.model._meta.verbose_name))
+            raise Http404(_("No %(verbose_name)s found matching the query") %
+                          {'verbose_name': force_unicode(queryset.model._meta.verbose_name)})
         return obj
 
     def get_queryset(self):
@@ -60,9 +62,9 @@
             if self.model:
                 return self.model._default_manager.all()
             else:
-                raise ImproperlyConfigured(u"%(cls)s is missing a queryset. Define "
-                                           u"%(cls)s.model, %(cls)s.queryset, or override "
-                                           u"%(cls)s.get_object()." % {
+                raise ImproperlyConfigured(_("%(cls)s is missing a queryset. Define "
+                                             "%(cls)s.model, %(cls)s.queryset, or override "
+                                             "%(cls)s.get_object().") % {
                                                 'cls': self.__class__.__name__
                                         })
         return self.queryset._clone()
Index: views/generic/create_update.py
===================================================================
--- views/generic/create_update.py	(wersja 15528)
+++ views/generic/create_update.py	(kopia robocza)
@@ -3,11 +3,13 @@
 from django.http import Http404, HttpResponse, HttpResponseRedirect
 from django.core.xheaders import populate_xheaders
 from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
-from django.utils.translation import ugettext
+from django.utils.translation import ugettext as _
 from django.contrib.auth.views import redirect_to_login
 from django.views.generic import GenericViewError
 from django.contrib import messages
+from django.utils.encoding import force_unicode
 
+
 import warnings
 warnings.warn(
     'Function-based generic views have been deprecated; use class-based views instead.',
@@ -48,8 +50,8 @@
         class_name = model.__name__ + 'Form'
         form_class = ModelFormMetaclass(class_name, (ModelForm,), {'Meta': Meta})
         return model, form_class
-    raise GenericViewError("Generic view must be called with either a model or"
-                           " form_class argument.")
+    raise GenericViewError(_("Generic view must be called with either a model"
+                             " or form_class argument."))
 
 def redirect(post_save_redirect, obj):
     """
@@ -70,10 +72,10 @@
     elif hasattr(obj, 'get_absolute_url'):
         return HttpResponseRedirect(obj.get_absolute_url())
     else:
-        raise ImproperlyConfigured(
+        raise ImproperlyConfigured(_(
             "No URL to redirect to.  Either pass a post_save_redirect"
             " parameter to the generic view or define a get_absolute_url"
-            " method on the Model.")
+            " method on the Model."))
 
 def lookup_object(model, object_id, slug, slug_field):
     """
@@ -88,14 +90,15 @@
     elif slug and slug_field:
         lookup_kwargs['%s__exact' % slug_field] = slug
     else:
-        raise GenericViewError(
+        raise GenericViewError(_(
             "Generic view must be called with either an object_id or a"
-            " slug/slug_field.")
+            " slug/slug_field."))
     try:
         return model.objects.get(**lookup_kwargs)
     except ObjectDoesNotExist:
-        raise Http404("No %s found for %s"
-                      % (model._meta.verbose_name, lookup_kwargs))
+        raise Http404(_("No %(verbose_name)s found for %(lookup_kwargs)s")
+                      % {'verbose_name': force_unicode(model._meta.verbose_name), 
+                         'lookup_kwargs': lookup_kwargs})
 
 def create_object(request, model=None, template_name=None,
         template_loader=loader, extra_context=None, post_save_redirect=None,
@@ -118,7 +121,7 @@
         if form.is_valid():
             new_object = form.save()
 
-            msg = ugettext("The %(verbose_name)s was created successfully.") %\
+            msg = _("The %(verbose_name)s was created successfully.") %\
                                     {"verbose_name": model._meta.verbose_name}
             messages.success(request, msg, fail_silently=True)
             return redirect(post_save_redirect, new_object)
@@ -161,7 +164,7 @@
         form = form_class(request.POST, request.FILES, instance=obj)
         if form.is_valid():
             obj = form.save()
-            msg = ugettext("The %(verbose_name)s was updated successfully.") %\
+            msg = _("The %(verbose_name)s was updated successfully.") %\
                                     {"verbose_name": model._meta.verbose_name}
             messages.success(request, msg, fail_silently=True)
             return redirect(post_save_redirect, obj)
@@ -204,8 +207,8 @@
 
     if request.method == 'POST':
         obj.delete()
-        msg = ugettext("The %(verbose_name)s was deleted.") %\
-                                    {"verbose_name": model._meta.verbose_name}
+        msg = _("The %(verbose_name)s was deleted.") %\
+                {"verbose_name": model._meta.verbose_name}
         messages.success(request, msg, fail_silently=True)
         return HttpResponseRedirect(post_delete_redirect)
     else:
Index: views/generic/edit.py
===================================================================
--- views/generic/edit.py	(wersja 15528)
+++ views/generic/edit.py	(kopia robocza)
@@ -4,6 +4,7 @@
 from django.views.generic.base import TemplateResponseMixin, View
 from django.views.generic.detail import (SingleObjectMixin,
                         SingleObjectTemplateResponseMixin, BaseDetailView)
+from django.utils.translation import ugettext as _
 
 
 class FormMixin(object):
@@ -53,7 +54,7 @@
             url = self.success_url
         else:
             raise ImproperlyConfigured(
-                "No URL to redirect to. Provide a success_url.")
+                _("No URL to redirect to. Provide a success_url."))
         return url
 
     def form_valid(self, form):
@@ -93,9 +94,9 @@
             try:
                 url = self.object.get_absolute_url()
             except AttributeError:
-                raise ImproperlyConfigured(
+                raise ImproperlyConfigured(_(
                     "No URL to redirect to.  Either provide a url or define"
-                    " a get_absolute_url method on the Model.")
+                    " a get_absolute_url method on the Model."))
         return url
 
     def form_valid(self, form):
@@ -223,7 +224,7 @@
             return self.success_url
         else:
             raise ImproperlyConfigured(
-                "No URL to redirect to. Provide a success_url.")
+                _("No URL to redirect to. Provide a success_url."))
 
 
 class BaseDeleteView(DeletionMixin, BaseDetailView):
