diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-08-25 09:20:44 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-08-25 09:20:44 +0000 |
| commit | b0764e81ad04d5bd31ff99838445761503bb3526 (patch) | |
| tree | dff24e052642adfbb3bba5d1678f79acf39ee2d3 | |
| parent | 7e66ccac4c3444918fa0721e3cbf08fb35869fac (diff) | |
Documented `translation.override` context manager introduced in r16166.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | docs/ref/utils.txt | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 3d70c2989b..0849a21c2e 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -523,9 +523,8 @@ For a complete discussion on the usage of the following see the .. function:: activate(language) - Fetches the translation object for a given tuple of application name and - language and installs it as the current translation object for the current - thread. + Fetches the translation object for a given language and installs it as + the current translation object for the current thread. .. function:: deactivate() @@ -538,6 +537,16 @@ 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) + + .. 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`. + .. function:: get_language() Returns the currently selected language code. |
