How can I get the current language in Django?

diegueus9 picture diegueus9 · Jul 28, 2010 · Viewed 71.6k times · Source

How can I get the current language in the current thread in a model or in the admin?

Answer

micha480 picture micha480 · Jul 28, 2010

Functions of particular interest are django.utils.translation.get_language() which returns the language used in the current thread. See documentation.