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
ba76c3c4
Kaydet (Commit)
ba76c3c4
authored
Mar 21, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27656 -- Removed "This will" prefix from djanog/templatetags/i18n.py docstrings.
üst
abe6c5de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
32 deletions
+27
-32
i18n.py
django/templatetags/i18n.py
+27
-32
No files found.
django/templatetags/i18n.py
Dosyayı görüntüle @
ba76c3c4
...
...
@@ -192,8 +192,7 @@ class LanguageNode(Node):
@register.tag
(
"get_available_languages"
)
def
do_get_available_languages
(
parser
,
token
):
"""
This will store a list of available languages
in the context.
Store a list of available languages in the context.
Usage::
...
...
@@ -202,9 +201,7 @@ def do_get_available_languages(parser, token):
...
{
%
endfor
%
}
This will just pull the LANGUAGES setting from
your setting file (or the default settings) and
put it into the named variable.
This puts settings.LANGUAGES into the named variable.
"""
# token.split_contents() isn't useful here because this tag doesn't accept variable as arguments
args
=
token
.
contents
.
split
()
...
...
@@ -216,8 +213,8 @@ def do_get_available_languages(parser, token):
@register.tag
(
"get_language_info"
)
def
do_get_language_info
(
parser
,
token
):
"""
This will store the language information dictionary for the given language
co
de in a co
ntext variable.
Store the language information dictionary for the given language code in a
context variable.
Usage::
...
...
@@ -237,10 +234,10 @@ def do_get_language_info(parser, token):
@register.tag
(
"get_language_info_list"
)
def
do_get_language_info_list
(
parser
,
token
):
"""
This will store a list of language information dictionaries for the given
language codes in a context variable. The language codes can be specified
either as a list of strings or a settings.LANGUAGES style list (or any
sequence
of sequence
s whose first items are language codes).
Store a list of language information dictionaries for the given language
codes in a context variable. The language codes can be specified either as
a list of strings or a settings.LANGUAGES style list (or any sequence of
sequences whose first items are language codes).
Usage::
...
...
@@ -283,15 +280,14 @@ def language_bidi(lang_code):
@register.tag
(
"get_current_language"
)
def
do_get_current_language
(
parser
,
token
):
"""
This will s
tore the current language in the context.
S
tore the current language in the context.
Usage::
{
%
get_current_language as language
%
}
This will fetch the currently active language and
put it's value into the ``language`` context
variable.
This fetches the currently active language and puts its value into the
``language`` context variable.
"""
# token.split_contents() isn't useful here because this tag doesn't accept variable as arguments
args
=
token
.
contents
.
split
()
...
...
@@ -303,15 +299,15 @@ def do_get_current_language(parser, token):
@register.tag
(
"get_current_language_bidi"
)
def
do_get_current_language_bidi
(
parser
,
token
):
"""
This will s
tore the current language layout in the context.
S
tore the current language layout in the context.
Usage::
{
%
get_current_language_bidi as bidi
%
}
This
will fetch the currently active language's layout and
put it's value into the ``bidi`` context variable.
True indicates right-to-left layout, otherwise left-to-right
This
fetches the currently active language's layout and puts its value into
the ``bidi`` context variable. True indicates right-to-left layout,
otherwise left-to-right.
"""
# token.split_contents() isn't useful here because this tag doesn't accept variable as arguments
args
=
token
.
contents
.
split
()
...
...
@@ -323,33 +319,32 @@ def do_get_current_language_bidi(parser, token):
@register.tag
(
"trans"
)
def
do_translate
(
parser
,
token
):
"""
This will mark a string for translation and will
translate the string for the current
language.
Mark a string for translation and translate the string for the current
language.
Usage::
{
%
trans "this is a test"
%
}
This
will mark the string for translation so it will
be pulled out by mark-messages.py into the .po files
and will run the string through the translation
engine.
This
marks the string for translation so it will be pulled out by
makemessages into the .po files and runs the string through the translation
engine.
There is a second form::
{
%
trans "this is a test" noop
%
}
This
will only mark for translation, but will return
the string unchanged. Use it when you need to store
values into forms that should be translated
later on.
This
marks the string for translation, but returns the string unchanged.
Use it when you need to store values into forms that should be translated
later on.
You can use variables instead of constant strings
to translate stuff you marked somewhere else::
{
%
trans variable
%
}
This will just try to translate the contents of
the variable ``variable``. Make sure that the string
in there is something that is in the .po file.
This tries to translate the contents of the variable ``variable``. Make
sure that the string in there is something that is in the .po file.
It is possible to store the translated string into a variable::
...
...
@@ -417,7 +412,7 @@ def do_translate(parser, token):
@register.tag
(
"blocktrans"
)
def
do_block_translate
(
parser
,
token
):
"""
T
his will t
ranslate a block of text with parameters.
Translate a block of text with parameters.
Usage::
...
...
@@ -539,7 +534,7 @@ def do_block_translate(parser, token):
@register.tag
def
language
(
parser
,
token
):
"""
This will e
nable the given language just for this block.
E
nable the given language just for this block.
Usage::
...
...
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