diff --git a/django/views/i18n.py b/django/views/i18n.py index 3bd240ea3d9..f684da23dc8 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 34ba691029b..4ff19729280 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 03036e48ffa..ed6ed226d29 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 df1c4b400c7..f0bd17c199c 100644 --- a/tests/view_tests/templates/jsi18n.html +++ b/tests/view_tests/templates/jsi18n.html @@ -30,6 +30,13 @@
++ + +
+