mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
i18n: fixed translation resolving - now project translations are pulled in allways (if they exist)
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@837 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
50f348a92f
commit
6f88c4f9ec
@ -119,12 +119,9 @@ def translation(appname, language):
|
||||
except IOError: t = gettext_module.NullTranslations()
|
||||
_translations[(appname, language)] = t
|
||||
|
||||
if appname != '*':
|
||||
parts = appname.split('.')
|
||||
project = __import__(parts[0], {}, {}, [])
|
||||
app = __import__(appname, {}, {}, ['views'])
|
||||
|
||||
apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
|
||||
projectpath = os.path.join(os.path.dirname(project.__file__), 'locale')
|
||||
|
||||
try:
|
||||
@ -135,6 +132,11 @@ def translation(appname, language):
|
||||
t.add_fallback(_translations[(appname, language)])
|
||||
_translations[(appname, language)] = t
|
||||
|
||||
if appname != '*':
|
||||
app = __import__(appname, {}, {}, ['views'])
|
||||
|
||||
apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
|
||||
|
||||
try:
|
||||
t = gettext_module.translation('django', apppath, [language, settings.LANGUAGE_CODE], klass)
|
||||
t.set_app_and_language(appname, language)
|
||||
|
Loading…
x
Reference in New Issue
Block a user