1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

Made the cache locale-dependant when USE_L10N is True, even if USE_I18N is False. Refs #5691.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin
2011-11-01 14:02:31 +00:00
parent 01964fd7e4
commit af1893c4ff
3 changed files with 20 additions and 6 deletions

View File

@@ -158,7 +158,7 @@ def has_vary_header(response, header_query):
def _i18n_cache_key_suffix(request, cache_key):
"""If enabled, returns the cache key ending with a locale."""
if settings.USE_I18N:
if settings.USE_I18N or settings.USE_L10N:
# first check if LocaleMiddleware or another middleware added
# LANGUAGE_CODE to request, then fall back to the active language
# which in turn can also fall back to settings.LANGUAGE_CODE