Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8702 -- Set up the initial locale correctly for the developmen…

…t server.

Previously, "--noreload" wasn't picking up the default language setting. Thanks
to arien and Karen Tracey for debugging this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8749 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1729d92f71694caad39d9ed3a31e1e287104e16f 1 parent 15644cb
Malcolm Tredinnick authored August 30, 2008
8  django/core/management/commands/runserver.py
@@ -43,11 +43,18 @@ def handle(self, addrport='', *args, **options):
43 43
 
44 44
         def inner_run():
45 45
             from django.conf import settings
  46
+            from django.utils import translation
46 47
             print "Validating models..."
47 48
             self.validate(display_num_errors=True)
48 49
             print "\nDjango version %s, using settings %r" % (django.get_version(), settings.SETTINGS_MODULE)
49 50
             print "Development server is running at http://%s:%s/" % (addr, port)
50 51
             print "Quit the server with %s." % quit_command
  52
+
  53
+            # django.core.management.base forces the locale to en-us. We should
  54
+            # set it up correctly for the first request (particularly important
  55
+            # in the "--noreload" case).
  56
+            translation.activate(settings.LANGUAGE_CODE)
  57
+
51 58
             try:
52 59
                 path = admin_media_path or django.__path__[0] + '/contrib/admin/media'
53 60
                 handler = AdminMediaHandler(WSGIHandler(), path)
@@ -70,6 +77,7 @@ def inner_run():
70 77
                 if shutdown_message:
71 78
                     print shutdown_message
72 79
                 sys.exit(0)
  80
+
73 81
         if use_reloader:
74 82
             from django.utils import autoreload
75 83
             autoreload.main(inner_run)

0 notes on commit 1729d92

Please sign in to comment.
Something went wrong with that request. Please try again.