| author | cavaliet |
| Wed, 09 Oct 2013 10:14:55 +0200 | |
| changeset 1240 | a9d953866a50 |
| parent 1191 | b6e0b1811723 |
| permissions | -rw-r--r-- |
from django.utils import translation from django.conf import settings class LanguageMiddleware(object): def process_request(self, request): if request.user.is_authenticated(): language = request.user.language else: language = settings.LANGUAGE_CODE[:2] request.user.is_regular = False translation.activate(language) request.LANGUAGE_CODE = translation.get_language()