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
87d2240e
Kaydet (Commit)
87d2240e
authored
Eyl 02, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27067 -- Removed django.utils.translation.string_concat() per deprecation timeline.
üst
9463a7a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
37 deletions
+5
-37
__init__.py
django/utils/translation/__init__.py
+0
-17
utils.txt
docs/ref/utils.txt
+0
-11
2.1.txt
docs/releases/2.1.txt
+2
-0
tests.py
tests/i18n/tests.py
+3
-9
No files found.
django/utils/translation/__init__.py
Dosyayı görüntüle @
87d2240e
...
...
@@ -2,10 +2,8 @@
Internationalization support.
"""
import
re
import
warnings
from
contextlib
import
ContextDecorator
from
django.utils.deprecation
import
RemovedInDjango21Warning
from
django.utils.functional
import
lazy
__all__
=
[
...
...
@@ -216,21 +214,6 @@ def deactivate_all():
return
_trans
.
deactivate_all
()
def
_string_concat
(
*
strings
):
"""
Lazy variant of string concatenation, needed for translations that are
constructed from multiple parts.
"""
warnings
.
warn
(
'django.utils.translate.string_concat() is deprecated in '
'favor of django.utils.text.format_lazy().'
,
RemovedInDjango21Warning
,
stacklevel
=
2
)
return
''
.
join
(
str
(
s
)
for
s
in
strings
)
string_concat
=
lazy
(
_string_concat
,
str
)
def
get_language_info
(
lang_code
):
from
django.conf.locale
import
LANG_INFO
try
:
...
...
docs/ref/utils.txt
Dosyayı görüntüle @
87d2240e
...
...
@@ -1057,17 +1057,6 @@ functions without the ``u``.
See :ref:`lazy translations documentation <lazy-translations>`.
.. function:: string_concat(*strings)
.. deprecated:: 1.11
Use :meth:`django.utils.text.format_lazy` instead.
``string_concat(*strings)`` can be replaced by
``format_lazy('{}' * len(strings), *strings)``.
Lazy variant of string concatenation, needed for translations that are
constructed from multiple parts.
.. function:: activate(language)
Fetches the translation object for a given language and activates it as
...
...
docs/releases/2.1.txt
Dosyayı görüntüle @
87d2240e
...
...
@@ -234,3 +234,5 @@ how to remove usage of these features.
is removed.
* ``django.test.runner.setup_databases()`` is removed.
* ``django.utils.translation.string_concat()`` is removed.
tests/i18n/tests.py
Dosyayı görüntüle @
87d2240e
...
...
@@ -12,11 +12,9 @@ from django.conf import settings
from
django.conf.urls.i18n
import
i18n_patterns
from
django.template
import
Context
,
Template
from
django.test
import
(
RequestFactory
,
SimpleTestCase
,
TestCase
,
ignore_warnings
,
override_settings
,
RequestFactory
,
SimpleTestCase
,
TestCase
,
override_settings
,
)
from
django.utils
import
translation
from
django.utils.deprecation
import
RemovedInDjango21Warning
from
django.utils.formats
import
(
date_format
,
get_format
,
get_format_modules
,
iter_format_modules
,
localize
,
localize_input
,
reset_format_cache
,
sanitize_separators
,
time_format
,
...
...
@@ -27,8 +25,8 @@ from django.utils.translation import (
LANGUAGE_SESSION_KEY
,
activate
,
check_for_language
,
deactivate
,
get_language
,
get_language_bidi
,
get_language_from_request
,
get_language_info
,
gettext
,
gettext_lazy
,
ngettext
,
ngettext_lazy
,
npgettext
,
npgettext_lazy
,
pgettext
,
string_concat
,
to_locale
,
trans_real
,
ugettext
,
ugettext
_lazy
,
ungettext
,
ungettext_lazy
,
npgettext
,
npgettext_lazy
,
pgettext
,
to_locale
,
trans_real
,
ugettext
,
ugettext_lazy
,
ungettext
,
ungettext_lazy
,
)
from
.forms
import
CompanyForm
,
I18nForm
,
SelectDateForm
...
...
@@ -216,10 +214,6 @@ class TranslationTests(SimpleTestCase):
self
.
assertEqual
(
pgettext
(
"verb"
,
"May"
),
"Kann"
)
self
.
assertEqual
(
npgettext
(
"search"
,
"
%
d result"
,
"
%
d results"
,
4
)
%
4
,
"4 Resultate"
)
@ignore_warnings
(
category
=
RemovedInDjango21Warning
)
def
test_string_concat
(
self
):
self
.
assertEqual
(
str
(
string_concat
(
'dja'
,
'ngo'
)),
'django'
)
def
test_empty_value
(
self
):
"""Empty value must stay empty after being translated (#23196)."""
with
translation
.
override
(
'de'
):
...
...
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