Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't merge in translations twice from deprecated project level tree …

…when it is also listed in LOCALE_PATHS. Thanks Claude Paroz. Refs #14924.

Also, removed some old unused variables as reported by pyflakes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ee060202409c5700fc2237ce5dab1c0a0486b1d3 1 parent eaf1747
@ramiro ramiro authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 django/utils/translation/trans_real.py
View
7 django/utils/translation/trans_real.py
@@ -67,7 +67,6 @@ class DjangoTranslation(gettext_module.GNUTranslations):
Python 2.4.
"""
def __init__(self, *args, **kw):
- from django.conf import settings
gettext_module.GNUTranslations.__init__(self, *args, **kw)
# Starting with Python 2.4, there's a function to define
# the output charset. Before 2.4, the output charset is
@@ -136,7 +135,7 @@ def _translation(path):
t = gettext_module.translation('django', path, [loc], DjangoTranslation)
t.set_language(lang)
return t
- except IOError, e:
+ except IOError:
return None
res = _translation(globalpath)
@@ -166,7 +165,7 @@ def _merge(path):
if os.path.isdir(apppath):
res = _merge(apppath)
- if projectpath and os.path.isdir(projectpath):
+ if projectpath and os.path.isdir(projectpath) and projectpath not in settings.LOCALE_PATHS:
res = _merge(projectpath)
for localepath in reversed(settings.LOCALE_PATHS):
@@ -365,8 +364,6 @@ def get_language_from_request(request):
"""
global _accepted
from django.conf import settings
- globalpath = os.path.join(
- os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
supported = dict(settings.LANGUAGES)
if hasattr(request, 'session'):

0 comments on commit ee06020

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