Permalink
Browse files

Fixed #5853 -- Added handling for a missing 'en' PO file in translati…

…on support

(this file being missing is essentially harmless). Thanks, miracle2k.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 6044ce9 commit 8d29fabe31107b627be01be7350a72b33573ba9d @malcolmt malcolmt committed Nov 29, 2007
Showing with 6 additions and 2 deletions.
  1. +6 −2 django/views/i18n.py
View
@@ -120,8 +120,12 @@ def javascript_catalog(request, domain='djangojs', packages=None):
p = __import__(package, {}, {}, [''])
path = os.path.join(os.path.dirname(p.__file__), 'locale')
paths.append(path)
- catalog = gettext_module.translation(domain, path, ['en'])
- t.update(catalog._catalog)
+ try:
+ catalog = gettext_module.translation(domain, path, ['en'])
+ t.update(catalog._catalog)
+ except IOError:
+ # 'en' catalog was missing. This is harmless.
+ pass
# next load the settings.LANGUAGE_CODE translations if it isn't english
if default_locale != 'en':
for path in paths:

0 comments on commit 8d29fab

Please sign in to comment.