Skip to content

Commit

Permalink
Fixed #5978 -- Gave LOCALE_PATHS a default setting of an empty tupl…
Browse files Browse the repository at this point in the history
…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
gdub committed Nov 19, 2007
1 parent 331d4bb commit 1607ace
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions django/bin/compile-messages.py
Expand Up @@ -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)))
Expand Down
2 changes: 2 additions & 0 deletions django/conf/global_settings.py
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions django/utils/translation/trans_real.py
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.txt
Expand Up @@ -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.

Expand Down

0 comments on commit 1607ace

Please sign in to comment.