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
22a5b889
Kaydet (Commit)
22a5b889
authored
Eyl 07, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed to_lower parameter for translation's to_locale().
Unused since
2bab9d6d
.
üst
ff17ef1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
trans_real.py
django/utils/translation/trans_real.py
+6
-12
No files found.
django/utils/translation/trans_real.py
Dosyayı görüntüle @
22a5b889
...
...
@@ -56,20 +56,14 @@ def reset_cache(**kwargs):
get_supported_language_variant
.
cache_clear
()
def
to_locale
(
language
,
to_lower
=
False
):
"""
Turn a language name (en-us) into a locale name (en_US). If 'to_lower' is
True, the last component is lower-cased (en_us).
"""
def
to_locale
(
language
):
"""Turn a language name (en-us) into a locale name (en_US)."""
p
=
language
.
find
(
'-'
)
if
p
>=
0
:
if
to_lower
:
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
:]
.
lower
()
else
:
# Get correct locale for sr-latn
if
len
(
language
[
p
+
1
:])
>
2
:
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
]
.
upper
()
+
language
[
p
+
2
:]
.
lower
()
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
:]
.
upper
()
# Get correct locale for sr-latn
if
len
(
language
[
p
+
1
:])
>
2
:
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
]
.
upper
()
+
language
[
p
+
2
:]
.
lower
()
return
language
[:
p
]
.
lower
()
+
'_'
+
language
[
p
+
1
:]
.
upper
()
else
:
return
language
.
lower
()
...
...
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