Ticket #5581: views_i18n_py.patch
File views_i18n_py.patch, 1.3 KB (added by , 17 years ago) |
---|
-
i18n.py
110 110 packages = ['django.conf'] 111 111 if type(packages) in (str, unicode): 112 112 packages = packages.split('+') 113 packages = [p for p in packages if p == 'django.conf' or p in settings.INSTALLED_APPS]113 #packages = [p for p in packages if p == 'django.conf' or p in settings.INSTALLED_APPS] 114 114 default_locale = to_locale(settings.LANGUAGE_CODE) 115 115 locale = to_locale(get_language()) 116 116 t = {} 117 117 paths = [] 118 118 # first load all english languages files for defaults 119 119 for package in packages: 120 p = __import__(package, {}, {}, ['']) 121 path = os.path.join(os.path.dirname(p.__file__), 'locale') 122 paths.append(path) 123 catalog = gettext_module.translation(domain, path, ['en']) 124 t.update(catalog._catalog) 120 try: 121 p = __import__(package, {}, {}, ['']) 122 path = os.path.join(os.path.dirname(p.__file__), 'locale') 123 paths.append(path) 124 catalog = gettext_module.translation(domain, path, ['en']) 125 t.update(catalog._catalog) 126 except: 127 continue 125 128 # next load the settings.LANGUAGE_CODE translations if it isn't english 126 129 if default_locale != 'en': 127 130 for path in paths: