mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
i18n: fixed projectpath discovery. Now the DJANGO_SETTINGS_MODULE environment variable is used to find the project base
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@838 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6f88c4f9ec
commit
9e1640c55f
@ -119,7 +119,7 @@ def translation(appname, language):
|
|||||||
except IOError: t = gettext_module.NullTranslations()
|
except IOError: t = gettext_module.NullTranslations()
|
||||||
_translations[(appname, language)] = t
|
_translations[(appname, language)] = t
|
||||||
|
|
||||||
parts = appname.split('.')
|
parts = os.environ['DJANGO_SETTINGS_MODULE'].split('.')
|
||||||
project = __import__(parts[0], {}, {}, [])
|
project = __import__(parts[0], {}, {}, [])
|
||||||
|
|
||||||
projectpath = os.path.join(os.path.dirname(project.__file__), 'locale')
|
projectpath = os.path.join(os.path.dirname(project.__file__), 'locale')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user