Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14735 closed (fixed)

Wrong plural formulation in search_form.html

Reported by: claudep Owned by: claudep
Component: contrib.admin Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In search_form.html template from contrib.admin, the singular of the search results message is using a number (1) instead of the variable:

  {% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %}

This is fine in English, but is causing issues in languages where the singular might be used with more than one number, like 0 and 1 for French. Fix is trivial and requires using {{ counter }} in singular form also.

Attachments (2)

search_results_plural.diff (1.2 KB) - added by claudep 6 years ago.
Add variable in singular form also
search_results_plural_zh.diff (4.1 KB) - added by claudep 6 years ago.
Include Chinese translations fixes

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by claudep

Add variable in singular form also

comment:1 Changed 6 years ago by jezdez

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by claudep

I looked at current translations, and my opinion is that we should not backport this fix, as it will break translations for a rather visible string and I doubt we have the required knowledge to guess the right change in various languages (64!).
I'm adding a second patch which includes fixes for Chinese translations, as the required changes to make them msgfmt -vc compliant are trivial. I let the committer decide if he wants to include translation fixes in the same commit or not.

Changed 6 years ago by claudep

Include Chinese translations fixes

comment:3 Changed 6 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

(In [14770]) Fixed #14735 -- Corrected plural formulation in admin search form template. Thanks, Claude.

comment:4 Changed 6 years ago by jezdez

(In [14771]) Fixed #11161 -- Added plural forms to all supported languages. Fixed other errors in the translation files that prevented them to pass the msgfmt check in preparation for the move to Transifex. Refs #14735, too.

comment:5 Changed 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top