Index django core urlresolvers py --- django core urlresolvers py revi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
Index: django/core/urlresolvers.py
===================================================================
--- django/core/urlresolvers.py (revision 9667)
+++ django/core/urlresolvers.py (working copy)
@@ -187,6 +187,10 @@
sub_match_dict.update(self.default_kwargs)
for k, v in sub_match[2].iteritems():
sub_match_dict[smart_str(k)] = v
+ locale = sub_match_dict.pop('locale')
+ if locale:
+ from django.utils import translation
+ translation.activate(locale)
return sub_match[0], sub_match[1], sub_match_dict
tried.append(pattern.regex.pattern)
raise Resolver404, {'tried': tried, 'path': new_path}