Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5978 -- Gave `LOCALE_PATHS` a default setting of an empty tupl…

…e and removed some code that was checking for its existance in settings before accessing it.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1607acee4020212166848363098008e60246e8f9 1 parent 331d4bb
Gary Wilson Jr. authored
5  django/bin/compile-messages.py
@@ -11,11 +11,10 @@
11 11
 
12 12
 
13 13
 def compile_messages(locale=None):
14  
-    basedirs = [os.path.join('conf', 'locale'), 'locale']
  14
+    basedirs = (os.path.join('conf', 'locale'), 'locale')
15 15
     if os.environ.get('DJANGO_SETTINGS_MODULE'):
16 16
         from django.conf import settings
17  
-        if hasattr(settings, 'LOCALE_PATHS'):
18  
-            basedirs += settings.LOCALE_PATHS
  17
+        basedirs += settings.LOCALE_PATHS
19 18
 
20 19
     # Gather existing directories.
21 20
     basedirs = set(map(os.path.abspath, filter(os.path.isdir, basedirs)))
2  django/conf/global_settings.py
@@ -90,6 +90,8 @@
90 90
 # to load the internationalization machinery.
91 91
 USE_I18N = True
92 92
 
  93
+LOCALE_PATHS = ()
  94
+
93 95
 # Not-necessarily-technical managers of the site. They get broken link
94 96
 # notifications and other various e-mails.
95 97
 MANAGERS = ADMINS
7  django/utils/translation/trans_real.py
@@ -168,10 +168,9 @@ def _merge(path):
168 168
                     res.merge(t)
169 169
             return res
170 170
 
171  
-        if hasattr(settings, 'LOCALE_PATHS'):
172  
-            for localepath in settings.LOCALE_PATHS:
173  
-                if os.path.isdir(localepath):
174  
-                    res = _merge(localepath)
  171
+        for localepath in settings.LOCALE_PATHS:
  172
+            if os.path.isdir(localepath):
  173
+                res = _merge(localepath)
175 174
 
176 175
         if projectpath and os.path.isdir(projectpath):
177 176
             res = _merge(projectpath)
2  docs/settings.txt
@@ -583,7 +583,7 @@ LOCALE_PATHS
583 583
 
584 584
 Default: ``()`` (Empty tuple)
585 585
 
586  
-A list of directories where Django looks for translation files.
  586
+A tuple of directories where Django looks for translation files.
587 587
 See the `internationalization docs section`_ explaining the variable and the
588 588
 default behavior.
589 589
 

0 notes on commit 1607ace

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