summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeila20 <leila@levit.be>2016-07-02 18:10:09 +0200
committerTim Graham <timograham@gmail.com>2016-07-02 20:50:51 -0400
commit2847b22f296f4c1cbcb2abbbb0bceb81ad1bf8f4 (patch)
tree6b4a328636ec81120c32240c9e37c3bbce02d81d
parent623ab0e6ae7db1991f8d7683e2a9451a1e378b9f (diff)
[1.10.x] Fixed #26832 -- Added translated language name on the get_language_info documentation
Backport of de4265e082bcce45ef6fb0929a44205463ba552e from master
-rw-r--r--docs/topics/i18n/translation.txt16
1 files changed, 11 insertions, 5 deletions
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index 0bdaa9586a..b9c43b3b11 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -525,18 +525,24 @@ Localized names of languages
The ``get_language_info()`` function provides detailed information about
languages::
- >>> from django.utils.translation import get_language_info
+ >>> from django.utils.translation import activate, get_language_info
+ >>> activate('fr')
>>> li = get_language_info('de')
- >>> print(li['name'], li['name_local'], li['bidi'])
- German Deutsch False
+ >>> print(li['name'], li['name_local'], li['name_translated'], li['bidi'])
+ German Deutsch Allemand False
-The ``name`` and ``name_local`` attributes of the dictionary contain the name of
-the language in English and in the language itself, respectively. The ``bidi``
+The ``name``, ``name_local``, and ``name_translated`` attributes of the
+dictionary contain the name of the language in English, in the language
+itself, and in your current active language respectively. The ``bidi``
attribute is True only for bi-directional languages.
The source of the language information is the ``django.conf.locale`` module.
Similar access to this information is available for template code. See below.
+.. versionchanged:: 1.9
+
+ The ``'name_translated'`` attribute was added.
+
.. _specifying-translation-strings-in-template-code:
Internationalization: in template code