Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Documented `translation.override` context manager introduced in r16166.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b0764e81ad04d5bd31ff99838445761503bb3526 1 parent 7e66cca
Jannis Leidel authored August 25, 2011

Showing 1 changed file with 12 additions and 3 deletions. Show diff stats Hide diff stats

  1. 15  docs/ref/utils.txt
15  docs/ref/utils.txt
@@ -523,9 +523,8 @@ For a complete discussion on the usage of the following see the
523 523
 
524 524
 .. function:: activate(language)
525 525
 
526  
-    Fetches the translation object for a given tuple of application name and
527  
-    language and installs it as the current translation object for the current
528  
-    thread.
  526
+    Fetches the translation object for a given language and installs it as
  527
+    the current translation object for the current thread.
529 528
 
530 529
 .. function:: deactivate()
531 530
 
@@ -538,6 +537,16 @@ For a complete discussion on the usage of the following see the
538 537
     useful when we want delayed translations to appear as the original string
539 538
     for some reason.
540 539
 
  540
+.. function:: override(language)
  541
+
  542
+    .. versionadded:: 1.4
  543
+
  544
+    A Python context manager that uses
  545
+    :func:`django.utils.translation.activate` to fetch the translation object
  546
+    for a given language, installing it as the translation object for the
  547
+    current thread and deinstalls it again on exit with
  548
+    :func:`django.utils.translation.deactivate`.
  549
+
541 550
 .. function:: get_language()
542 551
 
543 552
     Returns the currently selected language code.

0 notes on commit b0764e8

Please sign in to comment.
Something went wrong with that request. Please try again.