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
ac59ec8f
Kaydet (Commit)
ac59ec8f
authored
May 11, 2018
tarafından
Hasan Ramezani
Kaydeden (comit)
Tim Graham
May 12, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Aliased trans_null.to_locale() to trans_real.to_locale().
The implementations have unintentionally diverged.
üst
a5a2ceeb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
trans_null.py
django/utils/translation/trans_null.py
+3
-6
tests.py
tests/i18n/tests.py
+1
-0
No files found.
django/utils/translation/trans_null.py
Dosyayı görüntüle @
ac59ec8f
...
...
@@ -4,6 +4,8 @@
from
django.conf
import
settings
from
.trans_real
import
to_locale
as
trans_real_to_locale
def
gettext
(
message
):
return
message
...
...
@@ -52,12 +54,7 @@ def check_for_language(x):
return
True
def
to_locale
(
language
):
p
=
language
.
find
(
'-'
)
if
p
>=
0
:
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
:]
.
upper
()
else
:
return
language
.
lower
()
to_locale
=
trans_real_to_locale
def
get_language_from_request
(
request
,
check_path
=
False
):
...
...
tests/i18n/tests.py
Dosyayı görüntüle @
ac59ec8f
...
...
@@ -286,6 +286,7 @@ class TranslationTests(SimpleTestCase):
for
lang
,
locale
in
tests
:
with
self
.
subTest
(
lang
=
lang
):
self
.
assertEqual
(
to_locale
(
lang
),
locale
)
self
.
assertEqual
(
trans_null
.
to_locale
(
lang
),
locale
)
def
test_to_language
(
self
):
self
.
assertEqual
(
trans_real
.
to_language
(
'en_US'
),
'en-us'
)
...
...
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