mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.10.x] Fixed #26832 -- Added translated language name on the get_language_info documentation
Backport of de4265e082 from master
			
			
This commit is contained in:
		| @@ -525,18 +525,24 @@ Localized names of languages | |||||||
| The ``get_language_info()`` function provides detailed information about | The ``get_language_info()`` function provides detailed information about | ||||||
| languages:: | 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') |     >>> li = get_language_info('de') | ||||||
|     >>> print(li['name'], li['name_local'], li['bidi']) |     >>> print(li['name'], li['name_local'], li['name_translated'], li['bidi']) | ||||||
|     German Deutsch False |     German Deutsch Allemand False | ||||||
|  |  | ||||||
| The ``name`` and ``name_local`` attributes of the dictionary contain the name of | The ``name``, ``name_local``, and ``name_translated`` attributes of the | ||||||
| the language in English and in the language itself, respectively.  The ``bidi`` | 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. | attribute is True only for bi-directional languages. | ||||||
|  |  | ||||||
| The source of the language information is the ``django.conf.locale`` module. | The source of the language information is the ``django.conf.locale`` module. | ||||||
| Similar access to this information is available for template code. See below. | 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: | .. _specifying-translation-strings-in-template-code: | ||||||
|  |  | ||||||
| Internationalization: in template code | Internationalization: in template code | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user