Code

Ticket #2372: 3382-fcgi-translation.diff

File 3382-fcgi-translation.diff, 643 bytes (added by bahamut@…, 8 years ago)

Activates translation when running as FCGI.

Line 
1Index: django/core/management.py
2===================================================================
3--- django/core/management.py   (revision 3382)
4+++ django/core/management.py   (working copy)
5@@ -1140,6 +1140,12 @@
6 
7 def runfcgi(args):
8     """Run this project as a FastCGI application. requires flup."""
9+    from django.conf import settings
10+    from django.utils import translation
11+    try:
12+        translation.activate(settings.LANGUAGE_CODE)
13+    except AttributeError:
14+        pass
15     from django.core.servers.fastcgi import runfastcgi
16     runfastcgi(args)
17 runfcgi.args = '[various KEY=val options, use `runfcgi help` for help]'