diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py index ea4f76b4aa..c989034c0b 100755 --- a/django/bin/make-messages.py +++ b/django/bin/make-messages.py @@ -14,7 +14,12 @@ if os.path.isdir(os.path.join('conf', 'locale')): elif os.path.isdir('locale'): localedir = os.path.abspath('locale') else: - print "this script should be run from the django svn tree or your project or app tree" + print "This script should be run from the django svn tree or your project or app tree." + print "If you did indeed run it from the svn checkout or your project or application," + print "maybe you are just missing the conf/locale (in the django tree) or locale (for project" + print "and application) directory?" + print "make-messages.py doesn't create it automatically, you have to create it by hand if" + print "you want to enable i18n for your project or application." sys.exit(1) (opts, args) = getopt.getopt(sys.argv[1:], 'l:d:va') diff --git a/django/conf/locale/de/LC_MESSAGES/django.mo b/django/conf/locale/de/LC_MESSAGES/django.mo index 9e5635e753..8ae549045f 100644 Binary files a/django/conf/locale/de/LC_MESSAGES/django.mo and b/django/conf/locale/de/LC_MESSAGES/django.mo differ diff --git a/django/conf/locale/de/LC_MESSAGES/django.po b/django/conf/locale/de/LC_MESSAGES/django.po index 23fafdb9b2..96bc1a363f 100644 --- a/django/conf/locale/de/LC_MESSAGES/django.po +++ b/django/conf/locale/de/LC_MESSAGES/django.po @@ -1177,8 +1177,8 @@ msgstr[1] "Tage" #: utils/timesince.py:15 msgid "hour" msgid_plural "hours" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Stunde" +msgstr[1] "Stunden" #: utils/timesince.py:16 msgid "minute" diff --git a/django/conf/locale/sk/LC_MESSAGES/django.mo b/django/conf/locale/sk/LC_MESSAGES/django.mo index d7a59b6de2..26d18a6cec 100644 Binary files a/django/conf/locale/sk/LC_MESSAGES/django.mo and b/django/conf/locale/sk/LC_MESSAGES/django.mo differ diff --git a/django/conf/locale/sk/LC_MESSAGES/django.po b/django/conf/locale/sk/LC_MESSAGES/django.po index 0b36314088..27733aa393 100644 --- a/django/conf/locale/sk/LC_MESSAGES/django.po +++ b/django/conf/locale/sk/LC_MESSAGES/django.po @@ -1191,7 +1191,6 @@ msgstr[0] "Tento mesiac" msgstr[1] "Tento mesiac" #: utils/timesince.py:14 -#, fuzzy msgid "day" msgid_plural "days" msgstr[0] "Dnes" @@ -1200,15 +1199,14 @@ msgstr[1] "Dnes" #: utils/timesince.py:15 msgid "hour" msgid_plural "hours" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "hodina" +msgstr[1] "hodín" #: utils/timesince.py:16 -#, fuzzy msgid "minute" msgid_plural "minutes" -msgstr[0] "web" -msgstr[1] "web" +msgstr[0] "minúta" +msgstr[1] "minút" #: models/core.py:7 msgid "domain name" @@ -1379,9 +1377,8 @@ msgid "Welsh" msgstr "Waleský" #: conf/global_settings.py:40 -#, fuzzy msgid "Danish" -msgstr "Španielsky" +msgstr "Dánsky" #: conf/global_settings.py:41 msgid "German" diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html index 03ae272909..4b52d3e4d8 100644 --- a/django/contrib/admin/templates/admin/index.html +++ b/django/contrib/admin/templates/admin/index.html @@ -22,7 +22,7 @@ {% else %} {{ model.name }} {% endif %} - + {{}} {% if model.perms.add %} {% trans 'Add' %} {% else %} diff --git a/django/contrib/comments/templatetags/comments.py b/django/contrib/comments/templatetags/comments.py index 72c586e206..126009a5b9 100644 --- a/django/contrib/comments/templatetags/comments.py +++ b/django/contrib/comments/templatetags/comments.py @@ -44,6 +44,7 @@ COMMENT_FORM = ''' ''' FREE_COMMENT_FORM = ''' +{% load i18n %} {% if display_form %}

{% trans "Your name:" %}

diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index 2a0dda38b8..95cc914676 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -7,7 +7,7 @@ a string) and returns a tuple in this format: (view_function, dict_of_view_function_args) """ -from django.core.exceptions import Http404, ViewDoesNotExist +from django.core.exceptions import Http404, ImproperlyConfigured, ViewDoesNotExist import re class Resolver404(Http404): @@ -74,7 +74,11 @@ class RegexURLResolver(object): try: return self._urlconf_module except AttributeError: - self._urlconf_module = __import__(self.urlconf_name, '', '', ['']) + try: + self._urlconf_module = __import__(self.urlconf_name, '', '', ['']) + except ValueError, e: + # Invalid urlconf_name, such as "foo.bar." (note trailing period) + raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e) return self._urlconf_module urlconf_module = property(_get_urlconf_module) diff --git a/django/utils/timesince.py b/django/utils/timesince.py index b1df997e2e..89af456e96 100644 --- a/django/utils/timesince.py +++ b/django/utils/timesince.py @@ -1,4 +1,4 @@ -import datetime, time +import datetime, math, time from django.utils.tzinfo import LocalTimezone from django.utils.translation import ngettext @@ -30,6 +30,8 @@ def timesince(d, now=None): count = since / seconds if count != 0: break + if count < 0: + return '%d milliseconds' % math.floor(delta.microseconds / 1000) s = '%d %s' % (count, name(count)) if i + 1 < len(chunks): # Now get the second item diff --git a/django/views/debug.py b/django/views/debug.py index 012d7f9a75..3728dffa4a 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -1,3 +1,4 @@ + from django.conf import settings from django.core.template import Template, Context from django.utils.html import escape @@ -172,6 +173,8 @@ TECHNICAL_500_TEMPLATE = """ table.vars td, table.req td { font-family:monospace; } table td.code { width:100%; } table td.code div { overflow:hidden; } + table.source th { color:#666; } + table.source td { font-family:monospace; white-space:pre; border-bottom:1px solid #eee; } ul.traceback { list-style-type:none; } ul.traceback li.frame { margin-bottom:1em; } div.context { margin: 10px 0; } @@ -184,14 +187,14 @@ TECHNICAL_500_TEMPLATE = """ #summary { background: #ffc; } #summary h2 { font-weight: normal; color: #666; } #explanation { background:#eee; } + #template { background:#f6f6f6; } #traceback { background:#eee; } #requestinfo { background:#f6f6f6; padding-left:120px; } #summary table { border:none; background:transparent; } #requestinfo h2, #requestinfo h3 { position:relative; margin-left:-100px; } #requestinfo h3 { margin-bottom:-1em; } - table.source td { font-family: monospace; white-space: pre; } - span.specific { background:#ffcab7; } .error { background: #ffc; } + .specific { color:#cc3300; font-weight:bold; }