Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
9ca0961b
Kaydet (Commit)
9ca0961b
authored
Haz 02, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added headings to i18n template tags and filters.
üst
84522c0d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
10 deletions
+42
-10
translation.txt
docs/topics/i18n/translation.txt
+42
-10
No files found.
docs/topics/i18n/translation.txt
Dosyayı görüntüle @
9ca0961b
...
...
@@ -816,18 +816,33 @@ Other tags
These tags also require a ``{% load i18n %}``.
* ``{% get_available_languages as LANGUAGES %}`` returns a list of tuples in
which the first element is the :term:`language code` and the second is the
language name (translated into the currently active locale).
.. templatetag:: get_available_languages
* ``{% get_current_language as LANGUAGE_CODE %}`` returns the current user's
preferred language, as a string. Example: ``en-us``. (See
:ref:`how-django-discovers-language-preference`.)
``get_available_languages``
~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ``{% get_current_language_bidi as LANGUAGE_BIDI %}`` returns the current
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, German
etc.
``{% get_available_languages as LANGUAGES %}`` returns a list of tuples in
which the first element is the :term:`language code` and the second is the
language name (translated into the currently active locale).
.. templatetag:: get_current_language
``get_current_languages``
~~~~~~~~~~~~~~~~~~~~~~~~~
``{% get_current_language as LANGUAGE_CODE %}`` returns the current user's
preferred language as a string. Example: ``en-us``. See
:ref:`how-django-discovers-language-preference`.
.. templatetag:: get_current_language_bidi
``get_current_language_bidi``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``{% get_current_language_bidi as LANGUAGE_BIDI %}`` returns the current
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,
German, etc.
If you enable the ``django.template.context_processors.i18n`` context processor
then each ``RequestContext`` will have access to ``LANGUAGES``,
...
...
@@ -837,6 +852,11 @@ then each ``RequestContext`` will have access to ``LANGUAGES``,
The ``i18n`` context processor is not enabled by default for new projects.
.. templatetag:: get_language_info
``get_language_info``
~~~~~~~~~~~~~~~~~~~~~
You can also retrieve information about any of the available languages using
provided template tags and filters. To get information about a single language,
use the ``{% get_language_info %}`` tag::
...
...
@@ -851,6 +871,11 @@ You can then access the information::
Name in English: {{ lang.name }}<br />
Bi-directional: {{ lang.bidi }}
.. templatetag:: get_language_info_list
``get_language_info_list``
~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also use the ``{% get_language_info_list %}`` template tag to retrieve
information for a list of languages (e.g. active languages as specified in
:setting:`LANGUAGES`). See :ref:`the section about the set_language redirect
...
...
@@ -871,6 +896,13 @@ you can iterate over those languages in the template::
{% get_language_info_list for available_languages as langs %}
{% for lang in langs %} ... {% endfor %}
.. templatefilter:: language_name
.. templatefilter:: language_name_local
.. templatefilter:: language_bidi
Template filters
~~~~~~~~~~~~~~~~
There are also simple filters available for convenience:
* ``{{ LANGUAGE_CODE|language_name }}`` ("German")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment