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
714612a6
Kaydet (Commit)
714612a6
authored
Haz 22, 2018
tarafından
Tim Graham
Kaydeden (comit)
Carlton Gibson
Haz 22, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[2.1.x] Fixed #29511 -- Added charset to JavaScriptCatalog's Content-Type header.
Backport of
7cdeb23a
from master
üst
ea75f8ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
i18n.py
django/views/i18n.py
+1
-1
test_i18n.py
tests/view_tests/tests/test_i18n.py
+1
-0
No files found.
django/views/i18n.py
Dosyayı görüntüle @
714612a6
...
@@ -309,7 +309,7 @@ class JavaScriptCatalog(View):
...
@@ -309,7 +309,7 @@ class JavaScriptCatalog(View):
)
if
context
[
'catalog'
]
else
None
)
if
context
[
'catalog'
]
else
None
context
[
'formats_str'
]
=
indent
(
json
.
dumps
(
context
[
'formats'
],
sort_keys
=
True
,
indent
=
2
))
context
[
'formats_str'
]
=
indent
(
json
.
dumps
(
context
[
'formats'
],
sort_keys
=
True
,
indent
=
2
))
return
HttpResponse
(
template
.
render
(
Context
(
context
)),
'text/javascript'
)
return
HttpResponse
(
template
.
render
(
Context
(
context
)),
'text/javascript
; charset="utf-8"
'
)
class
JSONCatalog
(
JavaScriptCatalog
):
class
JSONCatalog
(
JavaScriptCatalog
):
...
...
tests/view_tests/tests/test_i18n.py
Dosyayı görüntüle @
714612a6
...
@@ -206,6 +206,7 @@ class I18NViewTests(SimpleTestCase):
...
@@ -206,6 +206,7 @@ class I18NViewTests(SimpleTestCase):
catalog
=
gettext
.
translation
(
'djangojs'
,
locale_dir
,
[
lang_code
])
catalog
=
gettext
.
translation
(
'djangojs'
,
locale_dir
,
[
lang_code
])
trans_txt
=
catalog
.
gettext
(
'this is to be translated'
)
trans_txt
=
catalog
.
gettext
(
'this is to be translated'
)
response
=
self
.
client
.
get
(
'/jsi18n/'
)
response
=
self
.
client
.
get
(
'/jsi18n/'
)
self
.
assertEqual
(
response
[
'Content-Type'
],
'text/javascript; charset="utf-8"'
)
# response content must include a line like:
# response content must include a line like:
# "this is to be translated": <value of trans_txt Python variable>
# "this is to be translated": <value of trans_txt Python variable>
# json.dumps() is used to be able to check unicode strings
# json.dumps() is used to be able to check unicode strings
...
...
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