This patch works against trunk and checks the USE_I18N setting. However, this patch is current blocked by #730. Incoming requests need to use the Session middleware, then Locale, then Cache, so that the language is determined by the time we hit the cache middleware. However, outgoing responses need Session before Cache as well so that the cookie-based Vary headers can be set.

I've updated Antoni Aloy's patch to apply cleanly after r10335 and simplified tests to only include what's needed to run them as part of the Django test suite, also fixed them so they don't break other tests leaving test environment umodified.

jezdez in my oppinion this is not a new feature, is just a bug correction, as one may expect that on a multilingual content page the cache should depend also on the language. Anyway I would be glad to document it.