From b3bccce1a09aae6dfb2eba7f77d3f373f03d8e0c Mon Sep 17 00:00:00 2001 From: Marc Egli Date: Sun, 19 May 2013 12:04:12 +0200 Subject: [PATCH] Fixed #20455 -- Do not use ngettext for undefined plurals Using two separate translation strings instead of gettext plural when there is no reference to the number in the translated string. This prevents some translations like Russian and Latvian to use the singular form for 11 or 21. --- .../admin/templates/admin/auth/user/change_password.html | 2 +- django/contrib/admin/templates/admin/change_form.html | 2 +- django/contrib/admin/templates/admin/change_list.html | 2 +- django/contrib/admin/templates/admin/login.html | 2 +- .../admin/templates/registration/password_change_form.html | 2 +- django/contrib/comments/templates/comments/preview.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index 9d1b917b61..2a1b4d3c90 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -24,7 +24,7 @@ {% if is_popup %}{% endif %} {% if form.errors %}

- {% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{% endif %} diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index daf37753dc..4accf80c46 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -41,7 +41,7 @@ {% if save_on_top %}{% block submit_buttons_top %}{% submit_row %}{% endblock %}{% endif %} {% if errors %}

- {% blocktrans count counter=errors|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + {% if errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{{ adminform.form.non_field_errors }} {% endif %} diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index c72b6630a3..5d1a6b2714 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -64,7 +64,7 @@ {% endblock %} {% if cl.formset.errors %}

- {% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + {% if cl.formset.errors|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{{ cl.formset.non_form_errors }} {% endif %} diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html index 4690363891..1371514d43 100644 --- a/django/contrib/admin/templates/admin/login.html +++ b/django/contrib/admin/templates/admin/login.html @@ -14,7 +14,7 @@ {% block content %} {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}

-{% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} +{% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{% endif %} diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index 5cb34739df..f7316a739f 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -17,7 +17,7 @@
{% if form.errors %}

- {% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %} + {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{% endif %} diff --git a/django/contrib/comments/templates/comments/preview.html b/django/contrib/comments/templates/comments/preview.html index 882d0fe714..0e7056795b 100644 --- a/django/contrib/comments/templates/comments/preview.html +++ b/django/contrib/comments/templates/comments/preview.html @@ -8,7 +8,7 @@
{% csrf_token %} {% if next %}
{% endif %} {% if form.errors %} -

{% blocktrans count counter=form.errors|length %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}

+

{% if form.errors|length == 1 %}{% trans "Please correct the error below" %}{% else %}{% trans "Please correct the errors below" %}{% endif %}

{% else %}

{% trans "Preview your comment" %}

{{ comment|linebreaks }}