summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTobias Kunze <r@rixx.de>2019-04-10 23:48:58 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-05-06 15:10:54 +0200
commit3166880301047a0d3ce111118123255766409ad0 (patch)
treeb6041e517c901d64c830e71fa4ed01f2716f0235 /docs
parent86a3ad351ec18d9dcd50cac1fc8ada6f904675db (diff)
Fixed #29352 -- Allowed specifying a Feed language.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/syndication.txt14
-rw-r--r--docs/releases/3.0.txt5
2 files changed, 16 insertions, 3 deletions
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
index d79db5a94a..aedf942a4d 100644
--- a/docs/ref/contrib/syndication.txt
+++ b/docs/ref/contrib/syndication.txt
@@ -307,8 +307,14 @@ Language
--------
Feeds created by the syndication framework automatically include the
-appropriate ``<language>`` tag (RSS 2.0) or ``xml:lang`` attribute (Atom). This
-comes directly from your :setting:`LANGUAGE_CODE` setting.
+appropriate ``<language>`` tag (RSS 2.0) or ``xml:lang`` attribute (Atom). By
+default, this is :func:`django.utils.translation.get_language()`. You can change it
+by setting the ``language`` class attribute.
+
+.. versionchanged:: 3.0
+
+ The ``language`` class attribute was added. In older versions, the behavior
+ is the same as ``language = settings.LANGUAGE_CODE``.
URLs
----
@@ -406,6 +412,10 @@ This example illustrates all possible attributes and methods for a
title_template = None
description_template = None
+ # LANGUAGE -- Optional. This should be a string specifying a language
+ # code. Defaults to django.utils.translation.get_language().
+ language = 'de'
+
# TITLE -- One of the following three is required. The framework
# looks for them in this order.
diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt
index 9bf4ce2205..1c222cfe7a 100644
--- a/docs/releases/3.0.txt
+++ b/docs/releases/3.0.txt
@@ -116,7 +116,10 @@ Minor features
:mod:`django.contrib.syndication`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* Added the ``language`` class attribute to the
+ :class:`django.contrib.syndication.views.Feed` to customize a feed language.
+ The default value is :func:`~django.utils.translation.get_language()` instead
+ of setting:`LANGUAGE_CODE`.
Cache
~~~~~