[Django] #29390: ngettext function bug in trans_null.py

13 views
Skip to first unread message

Django

unread,
May 8, 2018, 10:16:51 AM5/8/18
to django-...@googlegroups.com
#29390: ngettext function bug in trans_null.py
------------------------------------------------+------------------------
Reporter: Hasan Ramezani | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: 2.0
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 |
------------------------------------------------+------------------------
I checked the `ngettext` function in
`django/utils/translation/trans_null.py` currently function return plurarl
form for number == 0

--
Ticket URL: <https://code.djangoproject.com/ticket/29390>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 8, 2018, 10:17:27 AM5/8/18
to django-...@googlegroups.com
#29390: ngettext function bug in trans_null.py
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* status: new => assigned
* owner: nobody => Hasan Ramezani
* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/29390#comment:1>

Django

unread,
May 8, 2018, 10:21:34 AM5/8/18
to django-...@googlegroups.com
#29390: ngettext function bug in trans_null.py
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Hasan Ramezani):

PR [https://github.com/django/django/pull/9932]

--
Ticket URL: <https://code.djangoproject.com/ticket/29390#comment:2>

Django

unread,
May 8, 2018, 9:48:35 PM5/8/18
to django-...@googlegroups.com
#29390: trans_null.ngettext() should consider values of -1 as singular

-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Old description:

> I checked the `ngettext` function in
> `django/utils/translation/trans_null.py` currently function return
> plurarl form for number == 0

New description:

This is the English convention.

--

Comment (by Tim Graham):

I don't know. Whether or not -1 is considered singular seems to
[https://www.quora.com/Is-1-singular-or-plural dependent on the context].

--
Ticket URL: <https://code.djangoproject.com/ticket/29390#comment:3>

Django

unread,
May 9, 2018, 9:20:52 AM5/9/18
to django-...@googlegroups.com
#29390: trans_null.ngettext() should consider values of -1 as singular
-------------------------------------+-------------------------------------
Reporter: Hasan Ramezani | Owner: Hasan
| Ramezani
Type: Bug | Status: closed
Component: | Version: 2.0
Internationalization |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* cc: Carlton Gibson (added)
* status: assigned => closed
* resolution: => wontfix


Comment:

Hi Hasan. Thanks for the input.

I'm inclined towards `wontfix` here. A couple of reasons:

* As per Tim's point, I'm not at all convinced that `-1` is definitely
singular. (Like "maybe" but I can't say either is wrong.)
* As
[https://github.com/django/django/pull/9932#pullrequestreview-118467505
Simon commented on the PR] it breaks BC, and (per above) it's marginal at
best, so not worth it.

I'm going to close on that basis. If someone wants to make the case and
re-open, I guess I'm happy to look again.

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

Reply all
Reply to author
Forward
0 new messages