Fixed #5978 -- Gave `LOCALE_PATHS` a default setting of an empty tuple 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
This commit is contained in:
parent
331d4bba97
commit
1607acee40
|
@ -11,11 +11,10 @@ except NameError:
|
|||
|
||||
|
||||
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)))
|
||||
|
|
|
@ -90,6 +90,8 @@ LANGUAGES_BIDI = ("he", "ar", "fa")
|
|||
# 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
|
||||
|
|
|
@ -168,10 +168,9 @@ def translation(language):
|
|||
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)
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue