summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-11 14:19:28 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-11 14:19:28 +0000
commitd606cf7e38a1e6f73eef8119a2f538f9de760593 (patch)
tree298077218f142929e62e152c0120ba973b7402f1 /django/utils
parent9e1640c55f8957b1827f70cc28c6ee20bbcfb8b8 (diff)
i18n: added a way to merge in some more locale paths via settings
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@839 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/translation.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/django/utils/translation.py b/django/utils/translation.py
index 73f073f68b..caf9dcd76b 100644
--- a/django/utils/translation.py
+++ b/django/utils/translation.py
@@ -119,6 +119,16 @@ def translation(appname, language):
except IOError: t = gettext_module.NullTranslations()
_translations[(appname, language)] = t
+ if hasattr(settings, 'LOCALE_PATHS'):
+ for localepath in settings.LOCALE_PATHS:
+ try:
+ t = gettext_module.translation('django', localepath, [language, settings.LANGUAGE_CODE], klass)
+ t.set_app_and_language(appname, language)
+ except IOError: t = None
+ if t is not None:
+ t.add_fallback(_translations[(appname, language)])
+ _translations[(appname, language)] = t
+
parts = os.environ['DJANGO_SETTINGS_MODULE'].split('.')
project = __import__(parts[0], {}, {}, [])