summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-01-25 11:57:14 -0500
committerTim Graham <timograham@gmail.com>2016-01-25 12:10:21 -0500
commitd162438c651664065816d4a16189a533df4f3fb1 (patch)
tree068c424ae860eadbc20733787f031c067a5377fa
parent7b6ab2885e800ed25570d78d3241c25d6a49cd4a (diff)
[1.8.x] Fixed Sphinx highlight warnings in docs.
Backport of 9c43d8252a926f72be5a279186b42848501819b8 from master
-rw-r--r--docs/topics/i18n/translation.txt18
-rw-r--r--docs/topics/security.txt3
2 files changed, 8 insertions, 13 deletions
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index 7f6de9e384..70a312f7f2 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -70,8 +70,6 @@ as a shorter alias, ``_``, to save typing.
global ``_()`` function causes interference. Explicitly importing
``ugettext()`` as ``_()`` avoids this problem.
-.. highlightlang:: python
-
In this example, the text ``"Welcome to my site."`` is marked as a translation
string::
@@ -1158,6 +1156,8 @@ Additionally, if there are complex rules around pluralization, the catalog view
will render a conditional expression. This will evaluate to either a ``true``
(should pluralize) or ``false`` (should **not** pluralize) value.
+.. highlightlang:: python
+
Note on performance
-------------------
@@ -1269,8 +1269,8 @@ After defining these URL patterns, Django will automatically add the
language prefix to the URL patterns that were added by the ``i18n_patterns``
function. Example::
- from django.core.urlresolvers import reverse
- from django.utils.translation import activate
+ >>> from django.core.urlresolvers import reverse
+ >>> from django.utils.translation import activate
>>> activate('en')
>>> reverse('sitemap-xml')
@@ -1327,8 +1327,8 @@ After you've created the translations, the
:func:`~django.core.urlresolvers.reverse` function will return the URL in the
active language. Example::
- from django.core.urlresolvers import reverse
- from django.utils.translation import activate
+ >>> from django.core.urlresolvers import reverse
+ >>> from django.utils.translation import activate
>>> activate('en')
>>> reverse('news:category', kwargs={'slug': 'recent'})
@@ -1624,8 +1624,6 @@ translation utilities with a ``gettext`` package if the command ``xgettext
Customizing the ``makemessages`` command
----------------------------------------
-.. highlightlang:: python
-
If you want to pass additional parameters to ``xgettext``, you need to create a
custom :djadmin:`makemessages` command and override its ``xgettext_options``
attribute::
@@ -1664,8 +1662,6 @@ Miscellaneous
The ``set_language`` redirect view
----------------------------------
-.. highlightlang:: python
-
.. currentmodule:: django.views.i18n
.. function:: set_language(request)
@@ -1728,8 +1724,6 @@ redirected in the ``redirect_to`` context variable.
Explicitly setting the active language
--------------------------------------
-.. highlightlang:: python
-
You may want to set the active language for the current session explicitly. Perhaps
a user's language preference is retrieved from another system, for example.
You've already been introduced to :func:`django.utils.translation.activate()`. That
diff --git a/docs/topics/security.txt b/docs/topics/security.txt
index 62be131145..b3639baca4 100644
--- a/docs/topics/security.txt
+++ b/docs/topics/security.txt
@@ -29,7 +29,8 @@ which are particularly dangerous to HTML. While this protects users from most
malicious input, it is not entirely foolproof. For example, it will not
protect the following:
-.. code-block:: html+django
+.. code-block:: text
+.. highlighting as html+django fails due to intentionally missing quotes.
<style class={{ var }}>...</style>