diff --git a/django/views/i18n.py b/django/views/i18n.py index 3bd240ea3d..f684da23dc 100644 --- a/django/views/i18n.py +++ b/django/views/i18n.py @@ -113,7 +113,7 @@ js_catalog_template = r""" if (typeof(value) == 'undefined') { return (count == 1) ? singular : plural; } else { - return value[django.pluralidx(count)]; + return value.constructor === Array ? value[django.pluralidx(count)] : value; } }; diff --git a/tests/view_tests/locale/de/LC_MESSAGES/djangojs.mo b/tests/view_tests/locale/de/LC_MESSAGES/djangojs.mo index 34ba691029..4ff1972928 100644 Binary files a/tests/view_tests/locale/de/LC_MESSAGES/djangojs.mo and b/tests/view_tests/locale/de/LC_MESSAGES/djangojs.mo differ diff --git a/tests/view_tests/locale/de/LC_MESSAGES/djangojs.po b/tests/view_tests/locale/de/LC_MESSAGES/djangojs.po index 03036e48ff..ed6ed226d2 100644 --- a/tests/view_tests/locale/de/LC_MESSAGES/djangojs.po +++ b/tests/view_tests/locale/de/LC_MESSAGES/djangojs.po @@ -39,3 +39,6 @@ msgid "%s result" msgid_plural "%s results" msgstr[0] "%s Resultat" msgstr[1] "%s Resultate" + +msgid "Image" +msgstr "Bild" diff --git a/tests/view_tests/templates/jsi18n.html b/tests/view_tests/templates/jsi18n.html index df1c4b400c..f0bd17c199 100644 --- a/tests/view_tests/templates/jsi18n.html +++ b/tests/view_tests/templates/jsi18n.html @@ -30,6 +30,13 @@
++ + +
+