diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2012-03-31 22:24:24 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2012-03-31 22:24:24 +0000 |
| commit | b41ebcf1b9454bf0905c69594fa2dd1af19e7a60 (patch) | |
| tree | 83d864f7eb440394721f564d2fb8327673f91da5 /django | |
| parent | f38cf60c35bc9427ad14e261eea40acf91bc2c49 (diff) | |
Fixed #18040 -- Removed so-called project-level locale trees from the list of paths the translation loading process takes in account.
Deprecated in Django 1.3. Removed completely for Django 1.5.
Thanks Claude for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/translation/__init__.py | 18 | ||||
| -rw-r--r-- | django/utils/translation/trans_real.py | 12 |
2 files changed, 0 insertions, 30 deletions
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py index 02694067b3..ac062823a4 100644 --- a/django/utils/translation/__init__.py +++ b/django/utils/translation/__init__.py @@ -1,12 +1,8 @@ """ Internationalization support. """ -import warnings -from os import path - from django.utils.encoding import force_unicode from django.utils.functional import lazy -from django.utils.importlib import import_module __all__ = [ @@ -47,20 +43,6 @@ class Trans(object): from django.conf import settings if settings.USE_I18N: from django.utils.translation import trans_real as trans - # Make sure the project's locale dir isn't in LOCALE_PATHS - if settings.SETTINGS_MODULE is not None: - parts = settings.SETTINGS_MODULE.split('.') - project = import_module(parts[0]) - project_locale_path = path.normpath( - path.join(path.dirname(project.__file__), 'locale')) - normalized_locale_paths = [path.normpath(locale_path) - for locale_path in settings.LOCALE_PATHS] - if (path.isdir(project_locale_path) and - not project_locale_path in normalized_locale_paths): - warnings.warn("Translations in the project directory " - "aren't supported anymore. Use the " - "LOCALE_PATHS setting instead.", - DeprecationWarning) else: from django.utils.translation import trans_null as trans setattr(self, real_name, getattr(trans, real_name)) diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 82072b1397..76c9bfc1ea 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -111,13 +111,6 @@ def translation(language): globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale') - if settings.SETTINGS_MODULE is not None: - parts = settings.SETTINGS_MODULE.split('.') - project = import_module(parts[0]) - projectpath = os.path.join(os.path.dirname(project.__file__), 'locale') - else: - projectpath = None - def _fetch(lang, fallback=None): global _translations @@ -163,11 +156,6 @@ def translation(language): if os.path.isdir(apppath): res = _merge(apppath) - localepaths = [os.path.normpath(path) for path in settings.LOCALE_PATHS] - if (projectpath and os.path.isdir(projectpath) and - os.path.normpath(projectpath) not in localepaths): - res = _merge(projectpath) - for localepath in reversed(settings.LOCALE_PATHS): if os.path.isdir(localepath): res = _merge(localepath) |
