From 5f24cf9705f567f081c2ec704034ef5425306eff Mon Sep 17 00:00:00 2001 From: Markus Amalthea Magnuson Date: Sun, 18 May 2014 00:26:46 +0200 Subject: [PATCH] Fixed #22635 -- Made "It worked!" page localizable. --- django/views/debug.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/django/views/debug.py b/django/views/debug.py index 2e04905f61..87f71d1eb0 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -16,6 +16,7 @@ from django.utils.html import escape from django.utils.encoding import force_bytes, smart_text from django.utils.module_loading import import_string from django.utils import six +from django.utils.translation import ugettext as _ HIDDEN_SETTINGS = re.compile('API|TOKEN|KEY|SECRET|PASS|SIGNATURE') @@ -511,7 +512,17 @@ def technical_404_response(request, exception): def default_urlconf(request): "Create an empty URLconf 404 error response." t = Template(DEFAULT_URLCONF_TEMPLATE, name='Default URLconf template') - c = Context({}) + + c = Context({ + "title": _("Welcome to Django"), + "heading": _("It worked!"), + "subheading": _("Congratulations on your first Django-powered page."), + "instructions": _("Of course, you haven't actually done any work yet. " + "Next, start your first app by running python manage.py startapp [app_label]."), + "explanation": _("You're seeing this message because you have DEBUG = True in your " + "Django settings file and you haven't configured any URLs. Get to work!"), + }) + return HttpResponse(t.render(c), content_type='text/html') # @@ -1121,7 +1132,7 @@ DEFAULT_URLCONF_TEMPLATE = """ - Welcome to Django + {{ title }}