1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.9.x] Added some function links in translation docs

Backport of 9a6fc9606c from master.
This commit is contained in:
Claude Paroz
2015-10-07 10:46:08 +02:00
parent fbe8930745
commit c894f215e2
2 changed files with 12 additions and 5 deletions

View File

@@ -1888,14 +1888,15 @@ For example::
Calling this function with the value 'de' will give you ``"Willkommen"``,
regardless of :setting:`LANGUAGE_CODE` and language set by middleware.
Functions of particular interest are ``django.utils.translation.get_language()``
which returns the language used in the current thread,
``django.utils.translation.activate()`` which activates a translation catalog
for the current thread, and ``django.utils.translation.check_for_language()``
Functions of particular interest are
:func:`django.utils.translation.get_language()` which returns the language used
in the current thread, :func:`django.utils.translation.activate()` which
activates a translation catalog for the current thread, and
:func:`django.utils.translation.check_for_language()`
which checks if the given language is supported by Django.
To help write more concise code, there is also a context manager
``django.utils.translation.override()`` that stores the current language on
:func:`django.utils.translation.override()` that stores the current language on
enter and restores it on exit. With it, the above example becomes::
from django.utils import translation