diff --git a/django/middleware/locale.py b/django/middleware/locale.py
index 1f64387..e696ff4 100644
a
|
b
|
class LocaleMiddleware(object):
|
50 | 50 | path_valid = is_valid_path("%s/" % language_path, urlconf) |
51 | 51 | |
52 | 52 | if path_valid: |
53 | | language_url = "%s://%s/%s%s" % ( |
54 | | request.scheme, request.get_host(), language, |
55 | | request.get_full_path()) |
| 53 | prefix = request.META.get('SCRIPT_NAME', '') |
| 54 | query = request.META.get('QUERY_STRING') |
| 55 | query = '?%s' % query if query else '' |
| 56 | language_url = "%s://%s%s/%s%s%s" % ( |
| 57 | request.scheme, request.get_host(), prefix, |
| 58 | language, request.path_info, query) |
56 | 59 | return self.response_redirect_class(language_url) |
57 | 60 | |
58 | 61 | if not (self.is_language_prefix_patterns_used() |