diff --git a/django/conf/locale/de/LC_MESSAGES/django.mo b/django/conf/locale/de/LC_MESSAGES/django.mo index 8ae549045f..72ba0c03ed 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 96bc1a363f..98e308c815 100644 --- a/django/conf/locale/de/LC_MESSAGES/django.po +++ b/django/conf/locale/de/LC_MESSAGES/django.po @@ -789,6 +789,7 @@ msgstr "Ihr Kennwort wurde ge #: contrib/admin/templates/registration/password_reset_form.html:4 #: contrib/admin/templates/registration/password_reset_form.html:6 +#: contrib/admin/templates/registration/password_reset_form.html:10 #: contrib/admin/templates/registration/password_reset_done.html:4 msgid "Password reset" msgstr "Kennwort zurcksetzen" @@ -1291,8 +1292,8 @@ msgid "password" msgstr "Kennwort" #: models/auth.py:37 -msgid "Use '[algo]$[salt]$[hexdigest]" -msgstr "Im Format '[algo]$[salt]$[hexdigest]" +msgid "Use '[algo]$[salt]$[hexdigest]'" +msgstr "Im Format '[algo]$[salt]$[hexdigest]'" #: models/auth.py:38 msgid "staff status" diff --git a/django/conf/locale/sk/LC_MESSAGES/django.po b/django/conf/locale/sk/LC_MESSAGES/django.po index 27733aa393..35d2182837 100644 --- a/django/conf/locale/sk/LC_MESSAGES/django.po +++ b/django/conf/locale/sk/LC_MESSAGES/django.po @@ -16,9 +16,39 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +#: contrib/redirects/models/redirects.py:7 +msgid "redirect from" +msgstr "presmerovaný z" + +#: contrib/redirects/models/redirects.py:8 +msgid "" +"This should be an absolute path, excluding the domain name. Example: '/" +"events/search/'." +msgstr "" +"Tu by sa mala použiť absolútna cesta, bez domény. Napr.: '/events/search/'." + +#: contrib/redirects/models/redirects.py:9 +msgid "redirect to" +msgstr "presmerovaný na " + +#: contrib/redirects/models/redirects.py:10 +msgid "" +"This can be either an absolute path (as above) or a full URL starting with " +"'http://'." +msgstr "" +"Tu môže byť buď absolútna cesta (ako hore) alebo plné URL začínajúce s " +"'http://'." + +#: contrib/redirects/models/redirects.py:12 +msgid "redirect" +msgstr "presmerovanie" + +#: contrib/redirects/models/redirects.py:13 +msgid "redirects" +msgstr "presmerovania" + #: contrib/comments/models/comments.py:8 #: contrib/comments/models/comments.py:161 -#, fuzzy msgid "object ID" msgstr "Ukáž objekt id" @@ -28,9 +58,8 @@ msgstr "titulok" #: contrib/comments/models/comments.py:10 #: contrib/comments/models/comments.py:162 -#, fuzzy msgid "comment" -msgstr "obsah" +msgstr "komentár" #: contrib/comments/models/comments.py:11 msgid "rating #1" @@ -79,7 +108,6 @@ msgid "is public" msgstr "je zverejnený" #: contrib/comments/models/comments.py:26 contrib/admin/views/doc.py:274 -#, fuzzy msgid "IP address" msgstr "IP adresa" @@ -100,13 +128,11 @@ msgid "Comment" msgstr "Komentár" #: contrib/comments/models/comments.py:32 -#, fuzzy msgid "Comments" msgstr "Komentáre" #: contrib/comments/models/comments.py:85 #: contrib/comments/models/comments.py:204 -#, fuzzy msgid "Content object" msgstr "Obsah objectu" @@ -126,12 +152,10 @@ msgstr "" "http://%(domain)s%(url)s" #: contrib/comments/models/comments.py:163 -#, fuzzy msgid "person's name" msgstr "meno osoby" #: contrib/comments/models/comments.py:166 -#, fuzzy msgid "ip address" msgstr "ip adresa" @@ -140,12 +164,10 @@ msgid "approved by staff" msgstr "schvalený za zamestnanca" #: contrib/comments/models/comments.py:172 -#, fuzzy msgid "Free comment" msgstr "Voľný komentár" #: contrib/comments/models/comments.py:173 -#, fuzzy msgid "Free comments" msgstr "Voľné komentáre" @@ -154,9 +176,8 @@ msgid "score" msgstr "stav" #: contrib/comments/models/comments.py:210 -#, fuzzy msgid "score date" -msgstr "dátum konca platnosti" +msgstr "údaje stavu" #: contrib/comments/models/comments.py:213 msgid "Karma score" @@ -172,17 +193,14 @@ msgid "%(score)d rating by %(user)s" msgstr "%(score)d hodnotil %(user)s" #: contrib/comments/models/comments.py:248 -#, fuzzy msgid "flag date" msgstr "návestie dátumu" #: contrib/comments/models/comments.py:251 -#, fuzzy msgid "User flag" msgstr "Návestie uživateľa" #: contrib/comments/models/comments.py:252 -#, fuzzy msgid "User flags" msgstr "Návestia užívateľa" @@ -203,7 +221,6 @@ msgstr "" "%(text)s" #: contrib/comments/models/comments.py:278 -#, fuzzy msgid "deletion date" msgstr "vymazaný dátum" @@ -225,7 +242,6 @@ msgid "Anonymous users cannot vote" msgstr "Ak chcete hlasovať, najprv sa musíte prihlásiť" #: contrib/comments/views/karma.py:22 -#, fuzzy msgid "Invalid comment ID" msgstr "Neplatný komentár ID" @@ -236,7 +252,7 @@ msgstr "Nemožete voliť vlastný príspevok" #: contrib/comments/views/comments.py:25 msgid "" "This rating is required because you've entered at least one other rating." -msgstr "" +msgstr "Toto hlasovanie je nevyhnutné, lebo súvisí s predchádzjúcou voľbou." "Táto voľba je nevyhnutná nakoľko je pokračovaním vašej predchádzajúcej." #: contrib/comments/views/comments.py:109 @@ -294,6 +310,8 @@ msgid "" "The comment form had an invalid 'target' parameter -- the object ID was " "invalid" msgstr "Formulár kometára má chybný výstupný parameter -- objectID bol chybný" +"Formulár komentára ma chybný 'cieľový' parameter -- the objekt ID bol " +"poškodený" #: contrib/comments/views/comments.py:254 #: contrib/comments/views/comments.py:318 @@ -532,17 +550,14 @@ msgid "Comma-separated integers" msgstr "Celé čísla oddelené čiarkami" #: contrib/admin/views/doc.py:266 -#, fuzzy msgid "Date (without time)" msgstr "Dátum (bez času)" #: contrib/admin/views/doc.py:267 -#, fuzzy msgid "Date (with time)" msgstr "Dátum (a čas)" #: contrib/admin/views/doc.py:268 -#, fuzzy msgid "E-mail address" msgstr "E-mailová adresa" @@ -551,7 +566,6 @@ msgid "File path" msgstr "Cesta k súboru" #: contrib/admin/views/doc.py:270 -#, fuzzy msgid "Decimal number" msgstr "Desiatkové číslo" @@ -560,7 +574,6 @@ msgid "Boolean (Either True, False or None)" msgstr "Boolean (Možné hodnoty sú True, False alebo None)" #: contrib/admin/views/doc.py:277 -#, fuzzy msgid "Phone number" msgstr "Číslo telefónu" @@ -576,10 +589,6 @@ msgstr "Text" msgid "Time" msgstr "Čas" -#: contrib/admin/views/doc.py:284 contrib/flatpages/models/flatpages.py:6 -msgid "URL" -msgstr "URL" - #: contrib/admin/views/doc.py:285 msgid "U.S. state (two uppercase letters)" msgstr "U.S. štát (dve veľké písmená)" @@ -1306,7 +1315,7 @@ msgstr "priezvisko" #: models/auth.py:36 msgid "e-mail address" -msgstr "emailová adresa" +msgstr "e-mailová adresa" #: models/auth.py:37 msgid "password" diff --git a/django/contrib/admin/templates/registration/password_reset_form.html b/django/contrib/admin/templates/registration/password_reset_form.html index 8db1ede42f..9a8ac1a6d6 100644 --- a/django/contrib/admin/templates/registration/password_reset_form.html +++ b/django/contrib/admin/templates/registration/password_reset_form.html @@ -7,7 +7,7 @@ {% block content %} -

{% trans "Password reset") }}

+

{% trans "Password reset") %}

{% trans "Forgotten your password? Enter your e-mail address below, and we'll reset your password and e-mail the new one to you." %}

diff --git a/django/core/template/loader.py b/django/core/template/loader.py index 10989424db..6d747d560d 100644 --- a/django/core/template/loader.py +++ b/django/core/template/loader.py @@ -59,7 +59,7 @@ def make_origin(display_name, loader, name, dirs): def find_template_source(name, dirs=None): for loader in template_source_loaders: try: - source, display_name = loader(name, dirs) + source, display_name = loader(name, dirs) return (source, make_origin(display_name, loader, name, dirs)) except TemplateDoesNotExist: pass diff --git a/django/core/template/loaders/app_directories.py b/django/core/template/loaders/app_directories.py index d7c02c68ea..390e47852e 100644 --- a/django/core/template/loaders/app_directories.py +++ b/django/core/template/loaders/app_directories.py @@ -27,9 +27,12 @@ for app in INSTALLED_APPS: # It won't change, so convert it to a tuple to save memory. app_template_dirs = tuple(app_template_dirs) -def load_template_source(template_name, template_dirs=None): +def get_template_sources(template_name, template_dirs=None): for template_dir in app_template_dirs: - filepath = os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION + yield os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION + +def load_template_source(template_name, template_dirs=None): + for filepath in get_template_sources(template_name, template_dirs): try: return (open(filepath).read(), filepath) except IOError: diff --git a/django/core/template/loaders/filesystem.py b/django/core/template/loaders/filesystem.py index 9a93481705..23ce6cd9e4 100644 --- a/django/core/template/loaders/filesystem.py +++ b/django/core/template/loaders/filesystem.py @@ -4,12 +4,15 @@ from django.conf.settings import TEMPLATE_DIRS, TEMPLATE_FILE_EXTENSION from django.core.template import TemplateDoesNotExist import os -def load_template_source(template_name, template_dirs=None): +def get_template_sources(template_name, template_dirs=None): if not template_dirs: template_dirs = TEMPLATE_DIRS - tried = [] for template_dir in template_dirs: - filepath = os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION + yield os.path.join(template_dir, template_name) + TEMPLATE_FILE_EXTENSION + +def load_template_source(template_name, template_dirs=None): + tried = [] + for filepath in get_template_sources(template_name, template_dirs): try: return (open(filepath).read(), filepath) except IOError: diff --git a/django/models/auth.py b/django/models/auth.py index 21b4c2f146..2595727ad0 100644 --- a/django/models/auth.py +++ b/django/models/auth.py @@ -34,7 +34,7 @@ class User(meta.Model): first_name = meta.CharField(_('first name'), maxlength=30, blank=True) last_name = meta.CharField(_('last name'), maxlength=30, blank=True) email = meta.EmailField(_('e-mail address'), blank=True) - password = meta.CharField(_('password'), maxlength=128, help_text=_("Use '[algo]$[salt]$[hexdigest]")) + password = meta.CharField(_('password'), maxlength=128, help_text=_("Use '[algo]$[salt]$[hexdigest]'")) is_staff = meta.BooleanField(_('staff status'), help_text=_("Designates whether the user can log into this admin site.")) is_active = meta.BooleanField(_('active'), default=True) is_superuser = meta.BooleanField(_('superuser status')) diff --git a/django/utils/translation.py b/django/utils/translation.py index 9c06b1212f..a8a943e391 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -364,12 +364,12 @@ endblock_re = re.compile(r"""^\s*endblocktrans$""") plural_re = re.compile(r"""^\s*plural$""") constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""") def templateize(src): - from django.core.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK """ Turns a Django template into something that is understood by xgettext. It does so by translating the Django translation tags into standard gettext function invocations. """ + from django.core.template import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK out = StringIO() intrans = False inplural = False diff --git a/django/views/debug.py b/django/views/debug.py index 4d2d0d05df..ca367872ce 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -1,6 +1,6 @@ from django.conf import settings -from django.core.template import Template, Context +from django.core.template import Template, Context, TemplateDoesNotExist from django.utils.html import escape from django.utils.httpwrappers import HttpResponseServerError, HttpResponseNotFound import inspect, os, re, sys @@ -10,9 +10,10 @@ from os.path import dirname, join as pathjoin HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD') def linebreak_iter(template_source): + yield 0 p = template_source.find('\n') while p >= 0: - yield p + yield p+1 p = template_source.find('\n', p+1) yield len(template_source) + 1 @@ -23,19 +24,17 @@ def get_template_exception_info(exc_type, exc_value, tb): line = 0 upto = 0 source_lines = [] - linebreaks = izip(count(0), linebreak_iter(template_source)) - linebreaks.next() # skip the nothing before initial line start - for num, next in linebreaks: + for num, next in enumerate(linebreak_iter(template_source)): if start >= upto and end <= next: line = num before = escape(template_source[upto:start]) during = escape(template_source[start:end]) - after = escape(template_source[end:next - 1]) - source_lines.append( (num, escape(template_source[upto:next - 1])) ) + after = escape(template_source[end:next]) + source_lines.append( (num, escape(template_source[upto:next])) ) upto = next total = len(source_lines) - top = max(0, line - context_lines) + top = max(1, line - context_lines) bottom = min(total, line + 1 + context_lines) template_info = { @@ -44,8 +43,8 @@ def get_template_exception_info(exc_type, exc_value, tb): 'before': before, 'during': during, 'after': after, - 'top': top , - 'bottom': bottom , + 'top': top, + 'bottom': bottom, 'total': total, 'line': line, 'name': origin.name, @@ -59,6 +58,25 @@ def technical_500_response(request, exc_type, exc_value, tb): the values returned from sys.exc_info() and friends. """ template_info = None + template_does_not_exist = False + loader_debug_info = None + if issubclass(exc_type, TemplateDoesNotExist): + from django.core.template.loader import template_source_loaders + template_does_not_exist = True + loader_debug_info = [] + for loader in template_source_loaders: + try: + source_list_func = getattr(__import__(loader.__module__, '', '', ['get_template_sources']), 'get_template_sources') + # NOTE: This assumes exc_value is the name of the template that + # the loader attempted to load. + template_list = [{'name': t, 'exists': os.path.exists(t)} \ + for t in source_list_func(str(exc_value))] + except (ImportError, AttributeError): + template_list = [] + loader_debug_info.append({ + 'loader': loader.__module__ + '.' + loader.__name__, + 'templates': template_list, + }) if settings.TEMPLATE_DEBUG and hasattr(exc_value, 'source'): exc_type, exc_value, tb, template_info = get_template_exception_info(exc_type, exc_value, tb) frames = [] @@ -101,6 +119,8 @@ def technical_500_response(request, exc_type, exc_value, tb): 'request_protocol': os.environ.get("HTTPS") == "on" and "https" or "http", 'settings': settings_dict, 'template_info': template_info, + 'template_does_not_exist': template_does_not_exist, + 'loader_debug_info': loader_debug_info, }) return HttpResponseServerError(t.render(c), mimetype='text/html') @@ -188,7 +208,8 @@ TECHNICAL_500_TEMPLATE = """ #summary { background: #ffc; } #summary h2 { font-weight: normal; color: #666; } #explanation { background:#eee; } - #template { background:#f6f6f6; } + #template, #template-not-exist { background:#f6f6f6; } + #template-not-exist ul { margin: 0 0 0 20px; } #traceback { background:#eee; } #requestinfo { background:#f6f6f6; padding-left:120px; } #summary table { border:none; background:transparent; } @@ -273,6 +294,23 @@ TECHNICAL_500_TEMPLATE = """ +{% if template_does_not_exist %} +
+

Template-loader postmortem

+ {% if loader_debug_info %} +

Django tried loading these templates, in this order:

+ + {% else %} +

Django couldn't find any templates because your TEMPLATE_LOADERS setting is empty!

+ {% endif %} +
+{% endif %} {% if template_info %}

Template error

@@ -285,7 +323,7 @@ TECHNICAL_500_TEMPLATE = """ {{ template_info.before }}{{ template_info.during }}{{ template_info.after }} {% else %} {{ source_line.0 }} - {{ source_line.1 }} + {{ source_line.1 }} {% endifequal %} {% endfor %} diff --git a/django/views/registration/passwords.py b/django/views/registration/passwords.py index 09d3037560..0dde5f7b6d 100644 --- a/django/views/registration/passwords.py +++ b/django/views/registration/passwords.py @@ -41,7 +41,7 @@ class PasswordResetForm(formfields.Manipulator): 'site_name': site_name, 'user': self.user_cache, } - send_mail('Password reset on %s' % site_name, t.render(c), None, [self.user_cache.email]) + send_mail('Password reset on %s' % site_name, t.render(Context(c)), None, [self.user_cache.email]) class PasswordChangeForm(formfields.Manipulator): "A form that lets a user change his password." diff --git a/django/views/static.py b/django/views/static.py index 28e43ec612..4ff4313dab 100644 --- a/django/views/static.py +++ b/django/views/static.py @@ -34,7 +34,7 @@ def serve(request, path, document_root=None, show_indexes=False): if part in (os.curdir, os.pardir): # strip '.' amd '..' in path continue - newpath = os.path.join(newpath, part) + newpath = os.path.join(newpath, part).replace('\\', '/') if newpath and path != newpath: return HttpResponseRedirect(newpath) fullpath = os.path.join(document_root, newpath)