[Django] #36681: blocktranslate count plural example does not work for all languages (e.g. French 0 case)

12 views
Skip to first unread message

Django

unread,
Oct 22, 2025, 10:48:42 AM10/22/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
https://docs.djangoproject.com/en/5.2/topics/i18n/translation
/#blocktranslate-template-tag

In the blocktranslate docs, there is the following example:

{{{
{% blocktranslate count counter=list|length %}
There is only one {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktranslate %}
}}}

If `list` can be empty, the 0 case (which is plural in English) is not
plural in all languages. 0 cats, 1 cat, 2 cats, 3 cats is 0 chat, 1 chat,
2 chats, 3 chats in French (notice that 0 is singular).
This means that the 0 case would say the French translation of `There is
only one {{ name }} object.` as 0 is singular in French (and this would be
a bug).

I believe the example should be updated to something like:
{{{
{% blocktranslate count counter=list|length %}
There is {{ counter }} {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktranslate %}
}}}
which would not lead to this issue.

Optionally we could add an admonition about plurals in different languages
and that folks shouldn't assume that pluralization works the same as in
English
--
Ticket URL: <https://code.djangoproject.com/ticket/36681>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 22, 2025, 5:28:07 PM10/22/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
--------------------------------------+------------------------------------
Reporter: Sarah Boyce | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* easy: 0 => 1
* stage: Unreviewed => Accepted

Comment:

Well spotted, Sarah!
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:1>

Django

unread,
Oct 23, 2025, 12:24:13 AM10/23/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Varun Kasyap Pentamaraju):

* owner: (none) => Varun Kasyap Pentamaraju
* status: new => assigned

Comment:

I would like to work on this
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:2>

Django

unread,
Oct 23, 2025, 12:53:57 AM10/23/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Varun Kasyap Pentamaraju):

* has_patch: 0 => 1

Comment:

Created PR [https://github.com/django/django/pull/19994]
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:3>

Django

unread,
Oct 25, 2025, 12:37:55 PM10/25/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin
* version: 5.2 => dev

--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:4>

Django

unread,
Oct 27, 2025, 8:50:30 AM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:5>

Django

unread,
Oct 27, 2025, 12:24:05 PM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Varun Kasyap Pentamaraju):

* needs_better_patch: 1 => 0

Comment:

PR: https://github.com/django/django/pull/19994

Patch:
1)used admonition instead of note
2)removed the non–Django/Python-related explanations
3) changes removed comma in "e.g."
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:6>

Django

unread,
Oct 27, 2025, 1:34:48 PM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:7>

Django

unread,
Oct 27, 2025, 2:42:05 PM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"0ea01101c3a35568bc43e9707ac058b9874bd425" 0ea0110]:
{{{#!CommitTicketReference repository=""
revision="0ea01101c3a35568bc43e9707ac058b9874bd425"
Fixed #36681 -- Removed English pluralization bias from example in
docs/topics/i18n/translation.txt.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:8>

Django

unread,
Oct 27, 2025, 2:43:26 PM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"f13e6c90cfc1a35888df801c36bf0e5c080515a9" f13e6c90]:
{{{#!CommitTicketReference repository=""
revision="f13e6c90cfc1a35888df801c36bf0e5c080515a9"
[6.0.x] Fixed #36681 -- Removed English pluralization bias from example in
docs/topics/i18n/translation.txt.

Backport of 0ea01101c3a35568bc43e9707ac058b9874bd425 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:9>

Django

unread,
Oct 27, 2025, 2:44:00 PM10/27/25
to django-...@googlegroups.com
#36681: blocktranslate count plural example does not work for all languages (e.g.
French 0 case)
-------------------------------------+-------------------------------------
Reporter: Sarah Boyce | Owner: Varun
Type: | Kasyap Pentamaraju
Cleanup/optimization | Status: closed
Component: Documentation | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"368f955c371cab5db18e9e239d10560cf15f5ea4" 368f955]:
{{{#!CommitTicketReference repository=""
revision="368f955c371cab5db18e9e239d10560cf15f5ea4"
[5.2.x] Fixed #36681 -- Removed English pluralization bias from example in
docs/topics/i18n/translation.txt.

Backport of 0ea01101c3a35568bc43e9707ac058b9874bd425 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36681#comment:10>
Reply all
Reply to author
Forward
0 new messages