tags:

views:

56

answers:

2

I need to know what language it returns, so that I can perform my own actions.

+3  A: 
from django.utils import translation

def myview(...):
    ...
    lang = translation.get_language()
    ...

This will return the language code used in the current thread, so in your case, that set by the middleware.

KillianDS
+1  A: 

templates with RequestContext have {{ LANGUAGE_CODE }} by default. http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#other-tags