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
b24af2f4
Kaydet (Commit)
b24af2f4
authored
Ara 09, 2016
tarafından
Waldemar Kornewald
Kaydeden (comit)
Tim Graham
Ara 14, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27418 -- Fixed occasional missing plural forms in JavaScriptCatalog.
üst
1e629928
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
2 deletions
+69
-2
i18n.py
django/views/i18n.py
+2
-2
1.10.5.txt
docs/releases/1.10.5.txt
+3
-0
djangojs.mo
tests/view_tests/locale/pt/LC_MESSAGES/djangojs.mo
+0
-0
djangojs.po
tests/view_tests/locale/pt/LC_MESSAGES/djangojs.po
+27
-0
djangojs.mo
tests/view_tests/locale/ru/LC_MESSAGES/djangojs.mo
+0
-0
djangojs.po
tests/view_tests/locale/ru/LC_MESSAGES/djangojs.po
+13
-0
test_i18n.py
tests/view_tests/tests/test_i18n.py
+12
-0
test_i18n_deprecated.py
tests/view_tests/tests/test_i18n_deprecated.py
+12
-0
No files found.
django/views/i18n.py
Dosyayı görüntüle @
b24af2f4
...
...
@@ -253,7 +253,7 @@ def get_javascript_catalog(locale, domain, packages):
else
:
raise
TypeError
(
key
)
for
k
,
v
in
pdict
.
items
():
catalog
[
k
]
=
[
v
.
get
(
i
,
''
)
for
i
in
range
(
maxcnts
[
msgid
]
+
1
)]
catalog
[
k
]
=
[
v
.
get
(
i
,
''
)
for
i
in
range
(
maxcnts
[
k
]
+
1
)]
return
catalog
,
plural
...
...
@@ -401,7 +401,7 @@ class JavaScriptCatalog(View):
else
:
raise
TypeError
(
key
)
for
k
,
v
in
pdict
.
items
():
catalog
[
k
]
=
[
v
.
get
(
i
,
''
)
for
i
in
range
(
maxcnts
[
msgid
]
+
1
)]
catalog
[
k
]
=
[
v
.
get
(
i
,
''
)
for
i
in
range
(
maxcnts
[
k
]
+
1
)]
return
catalog
def
get_context_data
(
self
,
**
kwargs
):
...
...
docs/releases/1.10.5.txt
Dosyayı görüntüle @
b24af2f4
...
...
@@ -11,3 +11,6 @@ Bugfixes
* Fixed a crash in the debug view if ``request.user`` can't be retrieved, such
as if the database is unavailable (:ticket:`27567`).
* Fixed occasional missing plural forms in ``JavaScriptCatalog``
(:ticket:`27418`).
tests/view_tests/locale/pt/LC_MESSAGES/djangojs.mo
0 → 100644
Dosyayı görüntüle @
b24af2f4
File added
tests/view_tests/locale/pt/LC_MESSAGES/djangojs.po
0 → 100644
Dosyayı görüntüle @
b24af2f4
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-15 19:15+0200\n"
"PO-Revision-Date: 2010-05-12 12:41-0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "{count} plural2"
msgid_plural "{count} plural2s"
msgstr[0] "{count} plural2"
msgstr[1] "{count} plural2s"
msgid "{count} plural3"
msgid_plural "{count} plural3s"
msgstr[0] "{count} plural3"
msgstr[1] "{count} plural3s"
tests/view_tests/locale/ru/LC_MESSAGES/djangojs.mo
Dosyayı görüntüle @
b24af2f4
No preview for this file type
tests/view_tests/locale/ru/LC_MESSAGES/djangojs.po
Dosyayı görüntüle @
b24af2f4
...
...
@@ -22,3 +22,16 @@ msgstr "перевод"
msgid "Choose a time"
msgstr "Выберите время"
msgid "{count} plural2"
msgid_plural "{count} plural2s"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""
msgid "{count} plural3"
msgid_plural "{count} plural3s"
msgstr[0] "{count} plural3 p3"
msgstr[1] "{count} plural3 p3s"
msgstr[2] "{count} plural3 p3t"
tests/view_tests/tests/test_i18n.py
Dosyayı görüntüle @
b24af2f4
...
...
@@ -314,6 +314,18 @@ class JsI18NTests(SimpleTestCase):
self
.
assertContains
(
response
,
'il faut le traduire'
)
self
.
assertNotContains
(
response
,
"Untranslated string"
)
def
test_i18n_fallback_language_plural
(
self
):
"""
The fallback to a language with less plural forms maintains the real
language's number of plural forms.
"""
with
self
.
settings
(
LANGUAGE_CODE
=
'pt'
),
override
(
'ru'
):
response
=
self
.
client
.
get
(
'/jsi18n/'
)
self
.
assertEqual
(
response
.
context
[
'catalog'
][
'{count} plural3'
],
[
'{count} plural3'
,
'{count} plural3s'
,
'{count} plural3 p3t'
]
)
def
test_i18n_english_variant
(
self
):
with
override
(
'en-gb'
):
response
=
self
.
client
.
get
(
'/jsi18n/'
)
...
...
tests/view_tests/tests/test_i18n_deprecated.py
Dosyayı görüntüle @
b24af2f4
...
...
@@ -95,6 +95,18 @@ class JsI18NTests(SimpleTestCase):
self
.
assertContains
(
response
,
'il faut le traduire'
)
self
.
assertNotContains
(
response
,
"Untranslated string"
)
def
test_i18n_fallback_language_plural
(
self
):
"""
The fallback to a language with less plural forms maintains the real
language's number of plural forms.
"""
with
self
.
settings
(
LANGUAGE_CODE
=
'pt'
),
override
(
'ru'
):
response
=
self
.
client
.
get
(
'/jsi18n/'
)
self
.
assertEqual
(
response
.
context
[
'catalog'
][
'{count} plural3'
],
[
'{count} plural3'
,
'{count} plural3s'
,
'{count} plural3 p3t'
]
)
def
test_i18n_english_variant
(
self
):
with
override
(
'en-gb'
):
response
=
self
.
client
.
get
(
'/old_jsi18n/'
)
...
...
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