Reputation: 272164
I need to know what language it returns, so that I can perform my own actions.
Upvotes: 1
Views: 413
Reputation: 19
templates with RequestContext have {{ LANGUAGE_CODE }} by default. http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#other-tags
Upvotes: 1
Reputation: 17186
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.
Upvotes: 6