Unverified Kaydet (Commit) fd06488f authored tarafından Tim Graham's avatar Tim Graham Kaydeden (comit) GitHub

Fixed links for i18n context processor docs.

üst 99157064
...@@ -690,14 +690,20 @@ the request's IP address (``request.META['REMOTE_ADDR']``) is in the ...@@ -690,14 +690,20 @@ the request's IP address (``request.META['REMOTE_ADDR']``) is in the
``django.template.context_processors.i18n`` ``django.template.context_processors.i18n``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this processor is enabled, every ``RequestContext`` will contain these two .. function:: i18n
If this processor is enabled, every ``RequestContext`` will contain these
variables: variables:
* ``LANGUAGES`` -- The value of the :setting:`LANGUAGES` setting. * ``LANGUAGES`` -- The value of the :setting:`LANGUAGES` setting.
* ``LANGUAGE_BIDI`` -- ``True`` if the current language is a right-to-left
language, e.g. Hebrew, Arabic. ``False`` if it's a left-to-right language,
e.g. English, French, German.
* ``LANGUAGE_CODE`` -- ``request.LANGUAGE_CODE``, if it exists. Otherwise, * ``LANGUAGE_CODE`` -- ``request.LANGUAGE_CODE``, if it exists. Otherwise,
the value of the :setting:`LANGUAGE_CODE` setting. the value of the :setting:`LANGUAGE_CODE` setting.
See :doc:`/topics/i18n/index` for more. See :ref:`i18n template tags <i18n-template-tags>` for template tags that
generate the same values.
``django.template.context_processors.media`` ``django.template.context_processors.media``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -845,7 +845,7 @@ If you want to select a language within a template, you can use the ...@@ -845,7 +845,7 @@ If you want to select a language within a template, you can use the
While the first occurrence of "Welcome to our page" uses the current language, While the first occurrence of "Welcome to our page" uses the current language,
the second will always be in English. the second will always be in English.
.. _template-translation-vars: .. _i18n-template-tags:
Other tags Other tags
---------- ----------
...@@ -880,8 +880,13 @@ locale's direction. If ``True``, it's a right-to-left language, e.g. Hebrew, ...@@ -880,8 +880,13 @@ locale's direction. If ``True``, it's a right-to-left language, e.g. Hebrew,
Arabic. If ``False`` it's a left-to-right language, e.g. English, French, Arabic. If ``False`` it's a left-to-right language, e.g. English, French,
German, etc. German, etc.
If you enable the ``django.template.context_processors.i18n`` context processor .. _template-translation-vars:
then each ``RequestContext`` will have access to ``LANGUAGES``,
``i18n`` context processor
~~~~~~~~~~~~~~~~~~~~~~~~~~
If you enable the :class:`django.template.context_processors.i18n` context
processor, then each ``RequestContext`` will have access to ``LANGUAGES``,
``LANGUAGE_CODE``, and ``LANGUAGE_BIDI`` as defined above. ``LANGUAGE_CODE``, and ``LANGUAGE_BIDI`` as defined above.
.. templatetag:: get_language_info .. templatetag:: get_language_info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment