Django

Code

Changeset 6739

Show
Ignore:
Timestamp:
11/29/07 11:29:54 (1 year ago)
Author:
mtredinnick
Message:

Fixed #5853 -- Added handling for a missing 'en' PO file in translation support
(this file being missing is essentially harmless). Thanks, miracle2k.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/views/i18n.py

    r6324 r6739  
    121121        path = os.path.join(os.path.dirname(p.__file__), 'locale') 
    122122        paths.append(path) 
    123         catalog = gettext_module.translation(domain, path, ['en']) 
    124         t.update(catalog._catalog) 
     123        try: 
     124            catalog = gettext_module.translation(domain, path, ['en']) 
     125            t.update(catalog._catalog) 
     126        except IOError: 
     127            # 'en' catalog was missing. This is harmless. 
     128            pass 
    125129    # next load the settings.LANGUAGE_CODE translations if it isn't english 
    126130    if default_locale != 'en':