Fixed #24073 -- Returned None for get_language when translations are deactivated

This fixes a regression caused by f7c287fca9. Thanks Markus Holtermann
for identifying the regression.
This commit is contained in:
Claude Paroz 2015-01-08 11:11:35 +01:00
parent d6c8121ed0
commit 543df07720
5 changed files with 19 additions and 8 deletions

View file

@ -1098,7 +1098,14 @@ For a complete discussion on the usage of the following see the
.. function:: get_language()
Returns the currently selected language code.
Returns the currently selected language code. Returns ``None`` if
translations are temporarily deactivated (by :func:`deactivate_all()` or
when ``None`` is passed to :func:`override()`).
.. versionchanged:: 1.8
Before Django 1.8, ``get_language()`` always returned
:setting:`LANGUAGE_CODE` when translations were deactivated.
.. function:: get_language_bidi()