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
9a6fc960
Kaydet (Commit)
9a6fc960
authored
Eki 07, 2015
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added some function links in translation docs
üst
a76309f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
utils.txt
docs/ref/utils.txt
+6
-0
translation.txt
docs/topics/i18n/translation.txt
+6
-5
No files found.
docs/ref/utils.txt
Dosyayı görüntüle @
9a6fc960
...
@@ -1077,6 +1077,12 @@ For a complete discussion on the usage of the following see the
...
@@ -1077,6 +1077,12 @@ For a complete discussion on the usage of the following see the
``override`` is also usable as a function decorator.
``override`` is also usable as a function decorator.
.. function:: check_for_language(lang_code)
Checks whether there is a global language file for the given language
code (e.g. 'fr', 'pt_BR'). This is used to decide whether a user-provided
language is available.
.. function:: get_language()
.. function:: get_language()
Returns the currently selected language code. Returns ``None`` if
Returns the currently selected language code. Returns ``None`` if
...
...
docs/topics/i18n/translation.txt
Dosyayı görüntüle @
9a6fc960
...
@@ -1878,14 +1878,15 @@ For example::
...
@@ -1878,14 +1878,15 @@ For example::
Calling this function with the value 'de' will give you ``"Willkommen"``,
Calling this function with the value 'de' will give you ``"Willkommen"``,
regardless of :setting:`LANGUAGE_CODE` and language set by middleware.
regardless of :setting:`LANGUAGE_CODE` and language set by middleware.
Functions of particular interest are ``django.utils.translation.get_language()``
Functions of particular interest are
which returns the language used in the current thread,
:func:`django.utils.translation.get_language()` which returns the language used
``django.utils.translation.activate()`` which activates a translation catalog
in the current thread, :func:`django.utils.translation.activate()` which
for the current thread, and ``django.utils.translation.check_for_language()``
activates a translation catalog for the current thread, and
:func:`django.utils.translation.check_for_language()`
which checks if the given language is supported by Django.
which checks if the given language is supported by Django.
To help write more concise code, there is also a context manager
To help write more concise code, there is also a context manager
``django.utils.translation.override()`
` that stores the current language on
:func:`django.utils.translation.override()
` that stores the current language on
enter and restores it on exit. With it, the above example becomes::
enter and restores it on exit. With it, the above example becomes::
from django.utils import translation
from django.utils import translation
...
...
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