Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@gdub gdub authored
View
5 django/bin/compile-messages.py
@@ -11,11 +11,10 @@
def compile_messages(locale=None):
- basedirs = [os.path.join('conf', 'locale'), 'locale']
+ basedirs = (os.path.join('conf', 'locale'), 'locale')
if os.environ.get('DJANGO_SETTINGS_MODULE'):
from django.conf import settings
- if hasattr(settings, 'LOCALE_PATHS'):
- basedirs += settings.LOCALE_PATHS
+ basedirs += settings.LOCALE_PATHS
# Gather existing directories.
basedirs = set(map(os.path.abspath, filter(os.path.isdir, basedirs)))
View
2  django/conf/global_settings.py
@@ -90,6 +90,8 @@
# to load the internationalization machinery.
USE_I18N = True
+LOCALE_PATHS = ()
+
# Not-necessarily-technical managers of the site. They get broken link
# notifications and other various e-mails.
MANAGERS = ADMINS
View
7 django/utils/translation/trans_real.py
@@ -168,10 +168,9 @@ def _merge(path):
res.merge(t)
return res
- if hasattr(settings, 'LOCALE_PATHS'):
- for localepath in settings.LOCALE_PATHS:
- if os.path.isdir(localepath):
- res = _merge(localepath)
+ for localepath in settings.LOCALE_PATHS:
+ if os.path.isdir(localepath):
+ res = _merge(localepath)
if projectpath and os.path.isdir(projectpath):
res = _merge(projectpath)
View
2  docs/settings.txt
@@ -583,7 +583,7 @@ LOCALE_PATHS
Default: ``()`` (Empty tuple)
-A list of directories where Django looks for translation files.
+A tuple of directories where Django looks for translation files.
See the `internationalization docs section`_ explaining the variable and the
default behavior.
Please sign in to comment.
Something went wrong with that request. Please try again.