Ticket #6376: gettext_domain.patch
File gettext_domain.patch, 1.7 KB (added by , 17 years ago) |
---|
-
django/conf/global_settings.py
89 89 # If you set this to False, Django will make some optimizations so as not 90 90 # to load the internationalization machinery. 91 91 USE_I18N = True 92 93 92 LOCALE_PATHS = () 93 GETTEXT_DOMAIN = None 94 94 95 95 # Not-necessarily-technical managers of the site. They get broken link 96 96 # notifications and other various e-mails. -
django/utils/translation/trans_real.py
149 149 if res is not None: 150 150 return res 151 151 152 def _translation(path ):152 def _translation(path, domain='django'): 153 153 try: 154 t = gettext_module.translation( 'django', path, [loc], klass)154 t = gettext_module.translation(domain, path, [loc], klass) 155 155 t.set_language(lang) 156 156 return t 157 157 except IOError, e: … … 163 163 t = _translation(path) 164 164 if t is not None: 165 165 if res is None: 166 re turnt166 res = t 167 167 else: 168 168 res.merge(t) 169 if settings.GETTEXT_DOMAIN: 170 t = _translation(path, settings.GETTEXT_DOMAIN) 171 if t is not None: 172 if res is None: 173 res = t 174 else: 175 res.merge(t) 169 176 return res 170 177 171 178 for localepath in settings.LOCALE_PATHS: