diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-09-08 13:24:41 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-09-08 13:24:41 +0000 |
| commit | 16bb9c594cf7306f4b2fc3ba915be43b05dad5d2 (patch) | |
| tree | 447587001df5ccf70e094b6e89d796c80c54ae7a /docs/ref | |
| parent | 2b4341d532b376702a17212a9ff9f8710ca4c14a (diff) | |
Fixed #16516 -- Relaxed the blocktrans rendering a little by falling back to the default language if resolving one of the arguments fails, raising a KeyError. Thanks, Claude Paroz and Aymeric Augustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/utils.txt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 0b2e386268..1755ee77b3 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -532,15 +532,18 @@ For a complete discussion on the usage of the following see the useful when we want delayed translations to appear as the original string for some reason. -.. function:: override(language) +.. function:: override(language, deactivate=False) .. versionadded:: 1.4 A Python context manager that uses :func:`django.utils.translation.activate` to fetch the translation object for a given language, installing it as the translation object for the - current thread and deinstalls it again on exit with - :func:`django.utils.translation.deactivate`. + current thread and reinstall the previous active language on exit. + Optionally it can simply deinstall the temporary translation on exit with + :func:`django.utils.translation.deactivate` if the deactivate argument is + True. If you pass None as the language argument, a NullTranslations() + instance is installed while the context is active. .. function:: get_language() |
